Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add records from one table to another
Message
 
 
To
06/07/2017 18:36:52
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01652499
Message ID:
01652524
Views:
42
>>BTW, the correct syntax for above INSERT will be:
>>
>>insert into Ten_name (ten_pk, user_id, user_pwrd)
>>select ten_pk, user_id, user_pwrd from Tenant x
>
>Will that work if the primary key is an auto-increment integer?

What is the goal? Insert exactly same PK or let the PK autogenerate?

In the latter case you need to remove PK column from the INSERT command fields.

In the former case see SET INDENTITY INSERT command.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform