October 12, 2011 at 8:57 am
Keep in mind that your trigger will still only capture data accurately for single row inserts.
-- @OUTPUT should receive the concatenation of the data separated with a pipe
SELECT @OUTPUT = (SELECT LEFT(ISNULL(SerialNumber,'NOSERIAL!'), 30) + @SEPARATOR + ISNULL(ModuleName,'NOMODULE!'), + @SEPARATOR + CONVERT(VARCHAR, ISNULL(Reduction,0), 120)
FROM inserted)
The content of @OUTPUT at this point will be the values from the last record in the inserted table. If you need to capture all the data you will need to get the data from ALL rows into @OUTPUT.
_______________________________________________________________
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/
October 12, 2011 at 9:45 am
Got it 😉
It is not an issue as only one test result could be written at the time.
October 14, 2011 at 2:20 am
Hi guys,
the issue is solve and came from the concatenated NULL value ; By testing each of them in my select query, I managed to make it work !
Thx too all for you help !
RAF
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply