Category Archives: T-SQL

SQL Identity – Catalog View – SQL Server


sys.Identity_columns : catalog view contains information for each identity column in a table in that database. This view contains identity column information such as seed, increment, last_value and etc. This view also contains information from the sys.columns view. Basic column … Continue reading

Posted in SQL Server, T-SQL | Tagged , , , , , , , , , | Leave a comment

IDENT_SEED() – SQL Identity – SQL Server


IDENT_SEED() : This function returns the original seed value that is defined while the table was created or altered. This function needs a table name as an argument. It returns a numeric value as an output of size numeric(38,0).  It … Continue reading

Posted in SQL Server, T-SQL | Tagged , , , , , | Leave a comment

IDENT_INCR – SQL Identity – SQL Server


IDENT_INCR() : this function returns the current identity increment value of an identity column in a table. We need to pass the table name in the function argument to get the value. But, if user does not have permission to … Continue reading

Posted in SQL Server, T-SQL | Tagged , , , , , , | Leave a comment

SCOPE_IDENTITY (T-SQL) – SQL Server


SCOPE_IDENTITY(): This function returns the latest identity value inserted into an identity column in a table. As given in the function name, this function returns the output with in the scope. The scope is a code boundary such as a stored … Continue reading

Posted in SQL Server, T-SQL | Tagged , , , , , , | 2 Comments

Check access to the database using HAS_DBACCESS – SQL Server


HAS_DBACCESS():  This function is used to check whether the user has access to the given database or not. This function returns an integer value 1 or 0  or null. If the return value is 1 then the user has access … Continue reading

Posted in SQL Server, T-SQL | Tagged , , , , , | Leave a comment