Since the GUID doesn't have to come from the db, I would create it on the
client and pass it to your sproc...
Here is just a bunch of random code that uses GUID's client side, hope it is
not too confusing. :^)
Dim g As Guid
g = System.Guid.NewGuid
cmd.Parameters.Add(New SqlParameter("@GUID", SqlDbType.UniqueIdentifier,
16)).Value = g
Dim myGUID(8) As Byte
myGUID = g.ToByteArray
myGUID = CType(dr.GetSqlBinary(0).Value, Byte())
myGUID = CType(cmd.Parameters("@GUID").Value, Byte())
HTH,
Greg
"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:u5**************@TK2MSFTNGP12.phx.gbl...
I am trying to insert a new record into my database, and have it return a
uniqueidentifier as the "newcatid". I don't use integers as my "id"'s,
but rather uniqueidentifiers. Here's my Stored Proc:
ALTER PROCEDURE dbo.spNewCat
(
@newcatidID uniqueidentifier OUTPUT,
@catname varchar(50) )
AS
INSERT INTO Categories (catname) VALUES (@catname)
/* SET NOCOUNT ON */
RETURN
Any help please?!