|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
So, your server assigns the new GUID for the new record? And the primary key is a GUID?
Then you'll want your stored procedure to look like this:
CREATE Procedure sp_MyTable_Insert ( @field_pk GUID OUTPUT, @field_1 INT, @field_2 INT)
AS
BEGIN
SELECT @field_pk = NEWID();
INSERT INTO MyTable (field_pk, field_1, field_2)
VALUES (@field_pk, @field_1, @field_2);
END
GO
Don't forget to define the GUID as a OUTPUT. Then get the guid and insert it into the row as the pk, and it will be returned and retrieved into the business object by the output variable.
|