J
Jon Haakon Ariansen
Hi all,
I don't know where to publish this question but hope this newsgroup is okey.
I'm working in Visual Studio 2005 and are now creating a dataset file where
I will do all the transactions with the database.
I have a consumer table where I want to insert, update and delete consumers.
In the database I use uniqueidentifier on the primary key and said that it
is a rowGuid - (newid()).
When I try to generate a stored procedure to insert new consumers I have to
insert without adding the primary key because it is automatically generated
on a new insertion. However when using the wizard to generate the stored
procedure the wizard fails when I remove the primary key.
After the insert query the wizard created a select query with a where -
clause like the primary key variable.
(uidConsumerID = @uidConsumerID). Here I changed to SCOPE_IDENTITY( )
instead to get the databaserow from the current scope.
But this fails.
So what's wrong? What is the best way to make an insertion to a row using
RowGuid on the primary key?
Until further I will try to create the sp manually in the database and force
dotnet to use my own stored procedure.
In advance thanks a lot for your help!
Kind regards,
Jon Haakon
I don't know where to publish this question but hope this newsgroup is okey.
I'm working in Visual Studio 2005 and are now creating a dataset file where
I will do all the transactions with the database.
I have a consumer table where I want to insert, update and delete consumers.
In the database I use uniqueidentifier on the primary key and said that it
is a rowGuid - (newid()).
When I try to generate a stored procedure to insert new consumers I have to
insert without adding the primary key because it is automatically generated
on a new insertion. However when using the wizard to generate the stored
procedure the wizard fails when I remove the primary key.
After the insert query the wizard created a select query with a where -
clause like the primary key variable.
(uidConsumerID = @uidConsumerID). Here I changed to SCOPE_IDENTITY( )
instead to get the databaserow from the current scope.
But this fails.
So what's wrong? What is the best way to make an insertion to a row using
RowGuid on the primary key?
Until further I will try to create the sp manually in the database and force
dotnet to use my own stored procedure.
In advance thanks a lot for your help!
Kind regards,
Jon Haakon