Monday, February 20, 2012

Max value for sequence table

Hi,
How do I determine the max value for Sequence table in SQL Server?
RegardsCheck out http://www.w3schools.com/sql/sql_functions.asp.

All the SQL you need when starting out is in the tutorial too.|||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|||there is no sequence table in sql server|||Unless he is talking about IDENTITY column, in which case he should use either

SCOPE_IDENTITY
@.@.IDENTITY
IDENT_CURRENT|||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.|||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.|||ah, i get it. i thought OP wanted the max allowed value.

No comments:

Post a Comment