|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#31
|
||||
|
||||
|
Assuming you have ID defined as an Identity field:
Code:
INSERT <into first table> SET @newId = @@IDENTITY <more code> INSERT userId, <more columns> VALUES (@newId, <more variables)
__________________
Wolffy ------------------------ Teaching people to fish. |
|
#32
|
|||
|
|||
|
Any thoughts on how to save the ID using the SProc u sent?
|
|
#33
|
|||
|
|||
|
OOPs I see there's a new page
I'll try that thanks. I tried something like it but my page gave me an error. I'll have to look closer at what you sent |
|
#34
|
|||
|
|||
|
Quote:
Yes, I cam up with exactly that, now that I took another look The error: Code:
Microsoft OLE DB Provider for SQL Server error '80040e10' Procedure 'Insertuser' expects parameter '@CustID', which was not supplied. /nupkshp.asp, line 192 |
|
#35
|
||||
|
||||
|
You probably have it in the Procedure header rather than DECLAREing it.
|
|
#36
|
|||
|
|||
|
More help?
Quote:
Using the previous example, how do I do this Also, what is the "-10101" in the example that you gave to me? Is that a standard error code? I also have a list of SQL 2000 error codes and the "547" that I included, does not exist. Last edited by ArtJunky : May 9th, 2008 at 02:08 PM. |
|
#37
|
||||
|
||||
|
The -10101 was just a number I made up. Tho, for SQL Server, user error should be >50,000 (if I remember correctly). So, check the return code from your ExecuteNonQuery to determine if the proc was successful or not.
To return a value from the sproc, you could use OUT parameters for this. However, there is no point if all you are doing is returning what was pass in to begin with. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > SQL Server 2000 - Store Procedure - Add new user - check before adding - return value if taken |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|