Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to insert a column in SQL Server
Message
From
15/04/2002 15:19:08
 
 
To
15/04/2002 07:01:08
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
00644907
Message ID:
00645144
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform