RE: [SQLQueriesNoCode] getting value of identitity columns next value
select Isnull(Max(Id)+1,1) from TableName.
Assuming no records are available in the table since it get created.
[mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of manisha kadam
Sent: Saturday, April 28, 2007 12:46 PM
To: asp; asp; asp; ASP; asp; firstname.lastname@example.org; l; d; SQL
Subject: [SQLQueriesNoCode] getting value of identitity columns next value
i am using sql server 2000
in a table i have identity column with seed value
i want to find the next value which will be given to new row
before actaully inserting row
i use select max
but if there is no any current row
then i am getting problem
how can i solve this
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.
[Non-text portions of this message have been removed]
********** DISCLAIMER **********
Information contained and transmitted by this E-MAIL is proprietary to
Sify Limited and is intended for use only by the individual or entity to
which it is addressed, and may contain information that is privileged,
confidential or exempt from disclosure under applicable law. If this is a
forwarded message, the content of this E-MAIL may not have been sent with
the authority of the Company. If you are not the intended recipient, an
agent of the intended recipient or a person responsible for delivering the
information to the named recipient, you are notified that any use,
distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at admin@...
Complete Coverage of the ICC World Cup '07! Log on to www.sify.com/khel for
latest updates, expert columns, schedule, desktop scorecard, photo galleries
Watch the hottest videos from Bollywood, Fashion, News and more only on
For the Expert view of the ICC World Cup log on to www.sify.com/khel.
Read exclusive interviews with Sachin, Ganguly, Yuvraj, Sreesanth, Expert
Columns by Gavaskar, Web chat with Dhoni and more! .