December 16, 2003 at 4:26 am
How do I insert a uniqueidentifier into a table?
December 16, 2003 at 4:39 am
You should use the NEWID() function.
Look up NEWID in BOL.
Cheers,
- Mark
Cheers,
- Mark
December 16, 2003 at 4:42 am
something like
CREATE TABLE MyUniqueTable
(UniqueColumn UNIQUEIDENTIFIER DEFAULT NEWID(),
Characters VARCHAR(10) )
GO
INSERT INTO MyUniqueTable(Characters) VALUES ('abc')
INSERT INTO MyUniqueTable VALUES (NEWID(), 'def')
GO
taken from BOL.
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
December 16, 2003 at 7:38 am
Thankyou very much.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply