Microsoft
Software
Hardware
Network
Question : how so I get the uniqueidentifier after insert in SQLEXPRESS?
I need to create a batch number for entering a set of records. I have a batch table that stores the unique batch number and other information about the batch. When the user clicks "New" to create a new batch, I use the Insert command to add the record. But then I need the uniqueidentifier that was created for the batch number. What is the SQL syntax for this?
Thanks in advance!
Answer : how so I get the uniqueidentifier after insert in SQLEXPRESS?
DECLARE @GUID uniqueidentifier
SET @GUID = NEWID()
INSERT Item VALUES (@GUID,'Yak Hoof')
and return the value of @GUID as output parameter
Random Solutions
Receiving error when submitting data to SQL Server through asp.net vb
Access 2003 Macro Question: How to set focus to a specific tab on a tab control within an existing macro?
Outlook 2007 search
DPM 2007: Unable to extend the AD schema for end user recovery
SQL Query writing
How do I add an equal to or greater than sign to a text box
SQL problem returning records
xlThick > VBA Conditional Formatting
Combine tables for query
HP LaserJet P1005 on Terminal services - sometimes it works, most times it won't!