SET NOCOUNT has no relationship to what you are trying to do. This only
prints out the number of records affected by a given SQL statement.

try something like this

DECLARE procedure usp_save_something
@sSomeValue char(20)

AS

    SET NOCOUNT ON

    DECLARE @nNewID INT

    INSERT INTO SomeTable (SomeValue) values (@sSomeValue)
    SELECT @nNewID = @@IDENTITY

RETURN @nNewID

Robert M. Teague

----- Original Message ----- 
From: "Diane Schips" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 31, 2003 2:56 PM
Subject: [wdvltalk] RE: Help getting auto-increment field data in SQL


> The same as before - the record is added, but I can't get the ID number
>
> Diane
>
> -----Original Message-----
> From: Linden, Todd [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 31, 2003 2:35 PM
> To: [EMAIL PROTECTED]
> Subject: [wdvltalk] RE: Help getting auto-increment field data in SQL
>
>
> What does it do if you take the NOCOUNT off?
>
> -----Original Message-----
> From: Diane Schips [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 31, 2003 7:30 PM
> To: [EMAIL PROTECTED]
> Subject: [wdvltalk] RE: Help getting auto-increment field data in SQL
>
>
> Still having problems.  If I add the SET NOCOUNT ON, it won't allow me to
> add a new record!
>
> Diane
>
> -----Original Message-----
> From: Linden, Todd [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 31, 2003 1:30 PM
> To: [EMAIL PROTECTED]
> Subject: [wdvltalk] RE: Help getting auto-increment field data in SQL
>
>
> Diane,
>
> Try this...
>
>    Set rsRecord = Server.CreateObject("ADODB.Recordset")
>    strSQL = "SET NOCOUNT ON SELECT * FROM members WHERE File2 = '" & sFile
&
> "'"
>    rsRecord.Open strSQL,cnn,3,3
>    if type = "new"
>       if rsRecord.EOF then
>          rsRecord.AddNew
>       else
>          error message that we already have this record
>          response.end
>       end if
>    end if
>    ...get data from form fields
>    rsRecord.update
>    myID = rsRecord("ID")
>
> I think the myID would then have your new value...
>
> HTH,
>
>  - Todd
>
>
> ____ . The WDVL Discussion List from WDVL.COM . ____
> To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED]
>        Send Your Posts To: [EMAIL PROTECTED]
> To set a personal password send an email to [EMAIL PROTECTED] with the
> words: "set WDVLTALK pw=yourpassword" in the body of the email.
> To change subscription settings to the wdvltalk digest version:
>     http://wdvl.internet.com/WDVL/Forum/#sub
>
> ________________  http://www.wdvl.com  _______________________
>
> You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to %%email.unsub%%
>
>
>
>
> ____ . The WDVL Discussion List from WDVL.COM . ____
> To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED]
>        Send Your Posts To: [EMAIL PROTECTED]
> To set a personal password send an email to [EMAIL PROTECTED] with the
words: "set WDVLTALK pw=yourpassword" in the body of the email.
> To change subscription settings to the wdvltalk digest version:
>     http://wdvl.internet.com/WDVL/Forum/#sub
>
> ________________  http://www.wdvl.com  _______________________
>
> You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to %%email.unsub%%
>



____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set 
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to