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 |
|
wgpubs
Yak Posting Veteran
67 Posts |
Posted - 2004-05-08 : 12:26:53
|
| I'm getting this error when I try to compile the following INSTEAD OF trigger ... and its driving me mad!error: Incorrect syntax near 'inserted'.CREATE TRIGGER sampleTrig_INS ON [dbo].[my_view]INSTEAD OF INSERTASBEGINSET NOCOUNT ON INSERT my_table (Column1) SELECT Col1 FROM insertedGO |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-05-08 : 15:20:56
|
| ???? You don't have an END, or did you just forget to post it.Either way, this compiles:-- CREATE TABLE my_table(-- Column1 VARCHAR(55))-- CREATE TABLE my_table2(-- Column1 VARCHAR(55))-- CREATE VIEW my_view AS-- -- SELECT Column1 AS Col1-- FROM my_table2CREATE TRIGGER sampleTrig_INS ON [dbo].[my_view]INSTEAD OF INSERTASBEGINSET NOCOUNT ONINSERT my_table (Column1)SELECT Col1FROM insertedENDGOMeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
|
|
|