Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
evanburen
Posting Yak Master
167 Posts |
Posted - 2011-08-19 : 11:38:47
|
| HiI'm not sure why I'm getting this errorMsg 156, Level 15, State 1, Line 10Incorrect syntax near the keyword 'DELETE'.Msg 102, Level 15, State 1, Line 16Incorrect syntax near ')'.INSERT dbo.CustomersInactive ( CustomerID, FirstName, LastName) SELECT CustomerID, FirstName, Lastname FROM ( DELETE dbo.CustomersActive OUTPUT DELETED.CustomerID, DELETED.FirstName, DELETED.LastName WHERE CustomerID IN ( 1001, 1003, 1005 ) ) AS RowsToMove SELECT * FROM dbo.CustomersActiveSELECT * FROM dbo.CustomersInactive |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-08-19 : 12:03:38
|
| [code]INSERT dbo.CustomersInactive (CustomerID,FirstName,LastName) SELECT CustomerID,FirstName,LastnameFROM (DELETE dbo.CustomersActiveOUTPUTDELETED.CustomerID,DELETED.FirstName,DELETED.LastNameWHERE CustomerID IN ( 1001, 1003, 1005 )) AS RowsToMove (CustomerID,FirstName,lastName) [/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-08-19 : 12:35:02
|
| b/w are you using correct compatibility level? it should be 100 or abovecheck it firstsp_dbcmptlevel 'database name here'------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|
|