Please help me move these records to another table...
-
hi all, I am trying to copy the records from one table to another like this...
INSERT INTO [Claims].[dbo].[DocumentData] ([DocumentId] ,[DocumentData] ,[DocumentName] ,[ContentType] ,[LastUser] ,[LastDate]) VALUES (SELECT DocumentQueueId, DocumentData, DocumentName, ContentType, AssignedTo, GetDate() FROM DocumentQueue WHERE (AssignedTo = 'nbad\SlabbertH'))
yet i get an error:Msg 156, Level 15, State 1, Line 14 Incorrect syntax near the keyword 'SELECT'. Msg 102, Level 15, State 1, Line 14 Incorrect syntax near ')'.
what is the correct syntax for copying the records from one table to another? After i copied the records to the other table i will truncate the previouse table...."Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
-
hi all, I am trying to copy the records from one table to another like this...
INSERT INTO [Claims].[dbo].[DocumentData] ([DocumentId] ,[DocumentData] ,[DocumentName] ,[ContentType] ,[LastUser] ,[LastDate]) VALUES (SELECT DocumentQueueId, DocumentData, DocumentName, ContentType, AssignedTo, GetDate() FROM DocumentQueue WHERE (AssignedTo = 'nbad\SlabbertH'))
yet i get an error:Msg 156, Level 15, State 1, Line 14 Incorrect syntax near the keyword 'SELECT'. Msg 102, Level 15, State 1, Line 14 Incorrect syntax near ')'.
what is the correct syntax for copying the records from one table to another? After i copied the records to the other table i will truncate the previouse table...."Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
-
Remove 'Values' for select statement and also one ')' at the end of select statement like insert into Table() (select from table1) :cool:
thank you... if this works... it would be a great start to a great weekend :-)
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
-
Remove 'Values' for select statement and also one ')' at the end of select statement like insert into Table() (select from table1) :cool:
Thank you, That did the trick... :-)
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
-
thank you... if this works... it would be a great start to a great weekend :-)
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison