|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL-questioni have a script that insert a variable amount of rows in a table. each row
is identified by an autonumber by SQL how can i find out the number of the newly added rows without having to much troubles? I'm not sure but I think you can use a sql command and then use it's
ExecuteNonQuery method It should return the number of rows affected hth greetz Peter Show quoteHide quote "RTT" <R**@pandora.be> schreef in bericht news:OFSxAdFNFHA.2020@TK2MSFTNGP10.phx.gbl... > i have a script that insert a variable amount of rows in a table. each row > is identified by an autonumber by SQL > > how can i find out the number of the newly added rows without having to much > troubles? > > Hello,
If you need to get back the last autonumber value of the last record that has been entered then I would suggest you have a read of this article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconRetrievingIdentityOrAutonumberValues.asp Hope this is of some help? Thanks Kevin Show quoteHide quote "Peter Proost" wrote: > I'm not sure but I think you can use a sql command and then use it's > ExecuteNonQuery method It should return the number of rows affected > > hth greetz Peter > > "RTT" <R**@pandora.be> schreef in bericht > news:OFSxAdFNFHA.2020@TK2MSFTNGP10.phx.gbl... > > i have a script that insert a variable amount of rows in a table. each row > > is identified by an autonumber by SQL > > > > how can i find out the number of the newly added rows without having to > much > > troubles? > > > > > > > Hi
I misread the question so my solution won't help you out sorry, but Kevin's link probably will Greetz Peter "..:: Kevin ::.." <Ke***@discussions.microsoft.com> schreef in bericht http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htmnews:7E7064EB-9EC2-4C0C-A8C9-3C8CBF4AF3F0@microsoft.com... > Hello, > > If you need to get back the last autonumber value of the last record that > has been entered then I would suggest you have a read of this article: > > l/cpconRetrievingIdentityOrAutonumberValues.asp Show quoteHide quote > > Hope this is of some help? > > Thanks > > Kevin > > "Peter Proost" wrote: > > > I'm not sure but I think you can use a sql command and then use it's > > ExecuteNonQuery method It should return the number of rows affected > > > > hth greetz Peter > > > > "RTT" <R**@pandora.be> schreef in bericht > > news:OFSxAdFNFHA.2020@TK2MSFTNGP10.phx.gbl... > > > i have a script that insert a variable amount of rows in a table. each row > > > is identified by an autonumber by SQL > > > > > > how can i find out the number of the newly added rows without having to > > much > > > troubles? > > > > > > > > > > > > thxs, i still have to tweak it some more so it fits my needs perfectaly but
is does the trick.. thxs "..:: Kevin ::.." <Ke***@discussions.microsoft.com> wrote in message http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconRetrievingIdentityOrAutonumberValues.aspnews:7E7064EB-9EC2-4C0C-A8C9-3C8CBF4AF3F0@microsoft.com... > Hello, > > If you need to get back the last autonumber value of the last record that > has been entered then I would suggest you have a read of this article: > > Show quoteHide quote > > Hope this is of some help? > > Thanks > > Kevin > > "Peter Proost" wrote: > > > I'm not sure but I think you can use a sql command and then use it's > > ExecuteNonQuery method It should return the number of rows affected > > > > hth greetz Peter > > > > "RTT" <R**@pandora.be> schreef in bericht > > news:OFSxAdFNFHA.2020@TK2MSFTNGP10.phx.gbl... > > > i have a script that insert a variable amount of rows in a table. each row > > > is identified by an autonumber by SQL > > > > > > how can i find out the number of the newly added rows without having to > > much > > > troubles? > > > > > > > > > > > > RTT
A command.executescalar with an SQL string for @@identity gives you the last inserted identity. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_globals_50u1.asp I hope this helps, Cor In what language? How did you add the record? What does this question have
to do with all the newsgroups you posted to? You have posted this question to both VB and DotNet newsgroups.. Check out the @@Identity statement -- Show quoteHide quoteChris Hanscom - Microsoft MVP (VB) Veign's Resource Center http://www.veign.com/vrc_main.asp -- Read. Decide. Sign the petition to Microsoft. http://classicvb.org/petition/ "RTT" <R**@pandora.be> wrote in message news:OFSxAdFNFHA.2020@TK2MSFTNGP10.phx.gbl... > i have a script that insert a variable amount of rows in a table. each row > is identified by an autonumber by SQL > > how can i find out the number of the newly added rows without having to much > troubles? > >
64 HI/LO DWORD extraction vb.net
Excel ADO question Using a variable to specify the name of a control Datalist/datatable sorting Cannot Get MenuItem's name[Notsolved] VB.NET (ASP) Can't convert Dates...help! Formatting timespan objects how to use CurrentRowIndex for datagrid control ? memory stream XML and unicode problem Writing E-Mail Notfications |
|||||||||||||||||||||||