|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
@@Identity - problem getting data back
Hi,
I have some asp that should be inserting a shopper into my SQL Server DB. Code:
' call a stored procedure to create a new shopper
sql = "execute sp_InsertShopper"
set rsShopper = dbShopper.execute(sql)
session("idShopper") = rsShopper("idShopper")
And here is the Code for sp_InsertShopper: Code:
/* Utilized to insert a new shopper into the database */
Create Procedure sp_InsertShopper
AS
insert into shopper(chrUserName, chrPassword) values('','')
select idShopper = @@identity
I checked the DB and the shopper is being created but the session is not storing the ID. Any Ideas? Matt |
|
#2
|
||||
|
||||
|
Oh the shame...
I asked this question before: Here is the answer: You donīt have to create an Output parameter unless you want to call this from another Stored Procedure. Try using this stored procedure: Create Procedure sp_CreateBasket @idShopper int AS Set nocount on Insert into basket(idShopper) values(@idShopper) Select @@identity as idBasket Simon (I thought it sounded like a familiar problem) Matt |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > @@Identity - problem getting data back |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|