September 4, 2013 at 2:22 pm
The syntax errors are because this is using REALLY old sql syntax. IIRC *= means a left join.
You really need to convert this to ANSI-92 style joins instead of the older style join and get rid of the even older left join style.
Unfortunately this is not the end of your issues here. You have created this as a trigger when inserting into a table. Nowhere in your code do you reference the inserted virtual table. This is generally the point of a trigger, so you can capture the data that is being inserted.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing post 1 (of 2 total)
You must be logged in to reply to this topic. Login to reply