Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copying a Table Structure
Message
 
À
24/03/2012 20:41:08
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01539254
Message ID:
01539341
Vues:
37
Hi Bonnie. Thanks fore your reply.
The Table I am trying to copy is just a 'History' Table, so I want to keep the Field Names the same
I prefix all my Field name with the Table Name e.g. Table is INV and Field is INV_CUSNUM
My History Table would be HIS , but I want to keep all the names as INV_CUSNUM etc

Regards,
Gerard




>Easiest thing to do is just do a "Replace All" of "OldTable" with "MyNewTable" in the script.
>
>~~Bonnie
>
>
>
>>Many thanks for reply.
>>Yes, I only changed Table Name.
>>I thought that this was the only thing that needs to be changed
>>I was getting messages to the effec that the name was already used
>>Regards,
>>Gerard
>>
>>>
>>>Did you change only table name?
>>>
>>>You must change name of indexes, primary key, foreign keys, default values, checks.
>>>
>>>MartinaJ
>>>
>>>>HI.
>>>>I want to create a new Table in a SQLServer database, with exactly the sam structure as an exisitng Table (i.e. Same Field names, same Indexes, Same defaults)
>>>>
>>>>I tried this in SSMS and scripted the Existing Table, then chnged the name in the script (Create table MyNewTable) and executed it, but it is still giving errors. I have Defaults set on a lot of the fields and I also have indexes set up.
>>>>
>>>>Is there any easy way to do this , rather than having to set up from scratch , as there are about 150 fields
>>>>
>>>>Tia
>>>>Gerard
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform