Loading ...
Sorry, an error occurred while loading the content.

RE: [SQLQueriesNoCode] getting value of identitity columns next value

Expand Messages
  • Saravana Gandhi K
    Hi, select Isnull(Max(Id)+1,1) from TableName. Assuming no records are available in the table since it get created. Thanks, Saravana ... From:
    Message 1 of 4 , Apr 30, 2007
    • 0 Attachment
      Hi,

      select Isnull(Max(Id)+1,1) from TableName.

      Assuming no records are available in the table since it get created.

      Thanks,
      Saravana



      -----Original Message-----
      From: SQLQueriesNoCode@yahoogroups.com
      [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of manisha kadam
      Sent: Saturday, April 28, 2007 12:46 PM
      To: asp; asp; asp; ASP; asp; c_sharp_world@yahoogroups.com; l; d; SQL
      Subject: [SQLQueriesNoCode] getting value of identitity columns next value

      hi friends
      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

      thanks

      ---------------------------------
      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
      and more!

      Watch the hottest videos from Bollywood, Fashion, News and more only on
      www.sifymax.com

      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! .
    Your message has been successfully submitted and would be delivered to recipients shortly.