Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper form of INSERT INTO SELECT ...
Message
From
06/02/2002 11:10:07
Keith Payne
Technical Marketing Solutions
Florida, United States
 
 
To
06/02/2002 10:45:57
Keith Payne
Technical Marketing Solutions
Florida, United States
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00616056
Message ID:
00616081
Views:
21
Problem solved :)

FYI: The answer is to leave out the VALUES keyword.
INSERT INTO basetable (col2, col3, col4) (SELECT col2, col3, col4 FROM Inserted)
>I am trying to create an INSTEAD OF INSERT trigger for a view. The base table has an auto-incremented identity column. Intuitively, I would like to write the following statement:
>
>
>INSERT INTO basetable (col2, col3, col4) VALUES (SELECT col2, col3, col4 FROM Inserted)
>
>Unfortunately, that statement is not allowed in SQL2000. Can anyone suggest the correct way to do this or point me in the right direction?
>
>TIA,
>
>Keith Payne
Previous
Reply
Map
View

Click here to load this message in the networking platform