if you do not use table variable
Rob,
I am reading your articles just now and must say You really doing great job here. thank you.
I've just had an idea I wanted to share. The speed up here should be significant as generally I find table variable much slower for larger amount of data.
CREATE TABLE test (i UNIQUEIDENTIFIER DEFAULT (NEWID()))
CREATE TABLE test_hist (i UNIQUEIDENTIFIER)
GO
--insert test values and output data straight to history table
INSERT INTO test
OUTPUT inserted.i INTO test_hist (i)
DEFAULT VALUES
INSERT INTO test
OUTPUT inserted.i INTO test_hist (i)
DEFAULT VALUES
SELECT * FROM test
SELECT * FROM test_hist
GO
DROP TABLE test, test_hist
You Have To Be Happy With What You Have To Be Happy With (KC)