Microsoft SQL Server 2005 Express: Problem with SET IDENTITY_INSERT ON; command RRS feed

  • Question

  • I am using the Microsoft SQL Server 2005 Express to practice some SQL queries... It does not accept SET IDENTITY_INSERT <table_name> ON; command.

    Results in the following error message:
    There was an error parsing the query. [ Token line number = 9,Token line offset = 5,Token in error = IDENTITY_INSERT ]

    Could someone please advise why and if there is an option to change so that this command is accepted. Thanks.
    Monday, March 8, 2010 6:49 AM


  • The author (Ben Forta) of the book I am using (SQL Server T-SQL; ISBN 81-317-1627-9) has provided the following solution:


    I am not sure why that would not work. That command is indeed supported in SQL Server Express (although it is not supported in Compact Edition).


    I was using the Compact Edition; hence the command is not supported.

    Further, none of the <sp_> commands such as sp_databases are supported by the Compact Edition.
    • Edited by Paddy_Bear Monday, March 8, 2010 3:53 PM Unwanted HTML included
    • Marked as answer by Paddy_Bear Monday, March 8, 2010 3:54 PM
    Monday, March 8, 2010 3:52 PM