I am creating sequence in SQL Server with the following code. But it displays error as unknown object type. Please give a solution
Here\'s my code :
We can't use Sequence easily in SQL Server 2008.
You can use CTE(Common Table Expressions) for Sequence Generation in SQL Server 2008
WITH NUM_GEN (n) AS ( SELECT 1 UNION ALLSELECT n+1 FROM NUM_GEN WHERE n+1< MAX_VALUE ) SELECT n FROM NUM_GEN