G
Guest
Hi,
I have a typed dataset with tables including timestamp type field, when ready to commit the change back to the SQL server trough the data adapter and my storeprocedure, I receive the error.
How can I force SQL server inside a storeprocedure a NULL value for that timestamp field?
Is there a better solution from my c# code?
I try the following,
----------------------------------------------------------------------------
ALTER PROCEDURE dbo.InsertUser
(
@last_name char(25),
@first_name char(20),
@phone char(20),
@login_name char(30),
@email char(100),
@last_login datetime,
@datemodif datetime,
@timestamp timestamp,
@user_id uniqueidentifier OUTPUT
)
AS
SET NOCOUNT OFF;
SET @user_id = NEWID()
SET @timestamp = NULL
INSERT INTO [user] (user_id, last_name, first_name, phone, login_name, email, last_login, timestamp, datemodif) VALUES (@user_id, @last_name, @first_name, @phone, @login_name, @email, @last_login, @timestamp, @datemodif);
SELECT user_id, last_name, first_name, phone, login_name, email, last_login, timestamp, datemodif FROM [user] WHERE (user_id = @user_id)
I have a typed dataset with tables including timestamp type field, when ready to commit the change back to the SQL server trough the data adapter and my storeprocedure, I receive the error.
How can I force SQL server inside a storeprocedure a NULL value for that timestamp field?
Is there a better solution from my c# code?
I try the following,
----------------------------------------------------------------------------
ALTER PROCEDURE dbo.InsertUser
(
@last_name char(25),
@first_name char(20),
@phone char(20),
@login_name char(30),
@email char(100),
@last_login datetime,
@datemodif datetime,
@timestamp timestamp,
@user_id uniqueidentifier OUTPUT
)
AS
SET NOCOUNT OFF;
SET @user_id = NEWID()
SET @timestamp = NULL
INSERT INTO [user] (user_id, last_name, first_name, phone, login_name, email, last_login, timestamp, datemodif) VALUES (@user_id, @last_name, @first_name, @phone, @login_name, @email, @last_login, @timestamp, @datemodif);
SELECT user_id, last_name, first_name, phone, login_name, email, last_login, timestamp, datemodif FROM [user] WHERE (user_id = @user_id)