|
Posted by David Portas on 05/17/05 00:37
Re-read what I said before. Now look at your code:
<snip>
INSERT INTO #tbl_Script
VALUES ('INSERT INTO #tbl_TestAttr(AttrRef, TestRef, Seq, PrtRef,
AttrType, Value, TermDate, AttrID, DefSw, WantSw, ActSw)')
INSERT INTO #tbl_Script
VALUES ('VALUES (' + @AttrStr + ', ' + @TestRefStr + ', ' +
@SeqStr
+ ', ' + @PrtStr + ', ' + @AttrTypeStr + ', ' + @Value + ', ' +
@TermDateStr + ', ' + @AttrIDStr + ', ' + @DefStr + ', ' + @WantStr
+
', '+ @ActSwStr + ')')
</snip>
The "INSERT" and "VALUES" parts are in separate rows, but when you query the
table:
SELECT t.ScriptText
FROM #tbl_Script t
You have no ORDER BY clause! So you can't expect to see the result in the
same order you inserted the data.
--
David Portas
SQL Server MVP
--
Navigation:
[Reply to this message]
|