Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to insert a column in SQL Server
Message
De
15/04/2002 15:19:08
 
 
À
15/04/2002 07:01:08
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
00644907
Message ID:
00645144
Vues:
16
Thank you Daniel. I have modified the upsize wizard and currently use its classes for upsizing under program control.

Problem is that I want to make the first column the identity column and PK. However, in order to speed sending the data the wizard creates a SPROC that uses INSERT INTO xxx VALUES( ) without naming the fields. This means that a value gets sent to the first field, which gives an error.

So I now am looking for a command to convert the first column into the identity column after the export is already made. If you know how I'd appreciate it.

Alex


>Alejandro,
>
>Since the upsizing wizard comes with source code, you may be able to modify it to fit your needs. Have a look at the following program (you need to unzip xSource.zip):
>
>
>
>MODIFY COMMAND HOME() + "tools\xsource\wizards\wzUpsize\wizusz.prg"
>
>*-- you could try to change the following line of the CreateTableSQL() method:
>
>If llIdentity
>  *lcCreateString = lcCreateString + lcIdentityCol + " int IDENTITY(1,1), "
>  *-- add identity column as column 1
>  lcCreateString = lcIdentityCol + " int IDENTITY(1,1), " + lcCreateString
>Endif
>
>
>I'm not sure how the upsize wizard will map columns when upsizing the data. If it's done by fieldnames, then above should work. If it's handled by ordinal position, then you might have to change a couple of other settings. It might be worth a try.
>
>
>HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform