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
Wake on lan from Server 2008 64 bit
need a nic driver for an HP Pavillion - went from Vista to XP-PRO
MS SQL2005 Linked Server Setup for MySQL 7399 7312 error
How do you find a duplicated MAC address (spoofing)?
Add Records to Updateable Views and Making them visible in Real Time
TOP Percentage puzzle with SQL
Is there a MAC equivalent for Windows Remote Desktop
Access Report to PDF
Secure SQL Server 2005 - Password recovery
What SQL versions are VSS aware?