Home Forums SQL Server 2008 T-SQL (SS2K8) SELECT * INTO Table without propagating IDENTITY attribute? RE: SELECT * INTO Table without propagating IDENTITY attribute?

  • Please try this:

    SELECT *

    INTO dbo.newtable

    FROM dbo.oldtable_with_identity

    UNION ALL

    SELECT TOP (1) *

    FROM dbo.oldtable_with_identity

    WHERE 1 = 0

    The identity property should be left off the column in the new table :-).

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.