Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2006
    Posts
    119

    Unanswered: Max value for sequence table

    Hi,
    How do I determine the max value for Sequence table in SQL Server?
    Regards

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Check out http://www.w3schools.com/sql/sql_functions.asp.

    All the SQL you need when starting out is in the tutorial too.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    that would depend on the datatype you are using for the identity column.

    smallest is tinyint at 255, biggest is bigint at 9,223,372,036,854,775,807

    http://msdn2.microsoft.com/en-us/library/ms187745.aspx

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    there is no sequence table in sql server
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Apr 2007
    Posts
    183
    Unless he is talking about IDENTITY column, in which case he should use either

    SCOPE_IDENTITY
    @@IDENTITY
    IDENT_CURRENT

  6. #6
    Join Date
    Jan 2006
    Posts
    119
    Quote Originally Posted by Peso
    Unless he is talking about IDENTITY column, in which case he should use either

    SCOPE_IDENTITY
    @@IDENTITY
    IDENT_CURRENT
    Yes I am talking about identiy colum, how do I determine it's max value?

    SCOPE_IDENTITY @@IDENTITY IDENT_CURRENT

    returns [Error Code: 102, SQL State: S0001] Incorrect syntax near on SQLServer 2005.

  7. #7
    Join Date
    Apr 2007
    Posts
    183
    You can use the functions mentioned above.
    Read about them in Books Online, because they all have their strengts and weaknesses.

    I prefer the SCOPE_IDENTITY() function.

  8. #8
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    ah, i get it. i thought OP wanted the max allowed value.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •