--- description: "IDENT_SEED (Transact-SQL)" title: "IDENT_SEED (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "03/14/2017" ms.prod: sql ms.prod_service: "database-engine, sql-database" ms.reviewer: "" ms.technology: t-sql ms.topic: reference f1_keywords: - "IDENT_SEED_TSQL" - "IDENT_SEED" dev_langs: - "TSQL" helpviewer_keywords: - "identity columns [SQL Server], IDENT_SEED function" - "seed values [SQL Server]" - "IDENT_SEED function" ms.assetid: e4cb8eb8-affb-4810-a8a9-0110af3c247a author: VanMSFT ms.author: vanto --- # IDENT_SEED (Transact-SQL) [!INCLUDE [SQL Server SQL Database](../../includes/applies-to-version/sql-asdb.md)] Returns the original seed value specified when creating an identity column in a table or a view. Changing the current value of an identity column by using DBCC CHECKIDENT doesn't change the value returned by this function. ![Article link icon](../../database-engine/configure-windows/media/topic-link.gif "Article link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md) ## Syntax ```syntaxsql IDENT_SEED ( 'table_or_view' ) ``` [!INCLUDE[sql-server-tsql-previous-offline-documentation](../../includes/sql-server-tsql-previous-offline-documentation.md)] ## Arguments **'** *table_or_view* **'** Is an [expression](../../t-sql/language-elements/expressions-transact-sql.md) that specifies the table or view to check for an identity seed value. *table_or_view* can be a character string constant enclosed in quotation marks, a variable, a function, or a column name. *table_or_view* is **char**, **nchar**, **varchar**, or **nvarchar**. ## Return Types **numeric**([@@MAXPRECISION](../../t-sql/functions/max-precision-transact-sql.md),0)) ## Exceptions Returns NULL on error or if a caller doesn't have permission to view the object. In [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], a user can only view the metadata of securables that the user either owns or is granted permission on. This security means that metadata-emitting, built-in functions such as IDENT_SEED may return NULL if the user doesn't have any permission on the object. For more information, see [Metadata Visibility Configuration](../../relational-databases/security/metadata-visibility-configuration.md). ## Examples ### A. Returning the seed value from a specified table The following example returns the seed value for the `Person.Address` table in the [!INCLUDE[ssSampleDBnormal](../../includes/sssampledbnormal-md.md)] database. ```sql USE AdventureWorks2012; GO SELECT IDENT_SEED('Person.Address') AS Identity_Seed; GO ``` ### B. Returning the seed value from multiple tables The following example returns the tables in the [!INCLUDE[ssSampleDBnormal](../../includes/sssampledbnormal-md.md)] database with an identity column with a seed value. ```sql USE AdventureWorks2012; GO SELECT TABLE_SCHEMA, TABLE_NAME, IDENT_SEED(TABLE_SCHEMA + '.' + TABLE_NAME) AS IDENT_SEED FROM INFORMATION_SCHEMA.TABLES WHERE IDENT_SEED(TABLE_SCHEMA + '.' + TABLE_NAME) IS NOT NULL; GO ``` Here is a partial result set. ``` TABLE_SCHEMA TABLE_NAME IDENT_SEED ------------ --------------------------- ----------- Person Address 1 Production ProductReview 1 Production TransactionHistory 100000 Person AddressType 1 Production ProductSubcategory 1 Person vAdditionalContactInfo 1 dbo AWBuildVersion 1 ``` ## See Also [Expressions (Transact-SQL)](../../t-sql/language-elements/expressions-transact-sql.md) [System Functions (Transact-SQL)](../../relational-databases/system-functions/system-functions-category-transact-sql.md) [IDENT_CURRENT (Transact-SQL)](../../t-sql/functions/ident-current-transact-sql.md) [IDENT_INCR (Transact-SQL)](../../t-sql/functions/ident-incr-transact-sql.md) [DBCC CHECKIDENT (Transact-SQL)](../../t-sql/database-console-commands/dbcc-checkident-transact-sql.md) [sys.identity_columns (Transact-SQL)](../../relational-databases/system-catalog-views/sys-identity-columns-transact-sql.md)