Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB, C#, and VFP data handling examples
Message
From
12/04/2007 16:32:11
 
 
To
12/04/2007 15:20:36
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01215120
Message ID:
01215231
Views:
47
Craig,

Just one suggestion (not a criticism of what you're doing, just a suggestion)...

SQL 2005 contains a new OUTPUT clause that you can include on an INSERT statement in a stored proc - it allows you to get the value of an identity column, without needing to make a round-trip back to the server just to get a PK value.

Whereas previously most people did something like...
INSERT INTO MyTable ( ColumnList) VALUES ( @ColumnList)
SELECT @primkey = SCOPE_IDENTITY()
SELECT * FROM MyTable WHERE primkey = @primkey
You can now do this...
INSERT INTO MyTable (ColumnList) output inserted.*  VALUES (@ColumnList)
Essentially, SQl 2005 is now allowing developers to query the inserted (and deleted) system tables as part of the OUTPUT clause. The tables were previously invisible outside of a trigger.


Again, what you're doing works, just a suggestion for you.

Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform