About 81,300 results
Open links in new tab
  1. sql server - How to insert in a table with only an IDENTITY column ...

    Apr 25, 2013 · 28 Given a table with only an IDENTITY column, how do you insert a new row? I've tried the following: INSERT INTO TABLE (Syntax error) INSERT INTO TABLE VALUES() …

  2. sql server - Best way to get last identity inserted in a table ...

    Dec 30, 2015 · Use SCOPE_IDENTITY() if you are inserting a single row and want to retrieve the ID that was generated. CREATE TABLE #a(identity_column INT IDENTITY(1,1), x CHAR(1)); …

  3. Copy tables to another SQL Server keeping the identity property

    May 6, 2021 · Objective I want to make a exact copy of 10 tables from a database on a SQL Server into my local SQL Server. The local copy is used for testing. Problem The copied tables …

  4. Change IDENTITY_INSERT to ON in SQL server [duplicate]

    Jan 11, 2016 · How can I insert an ID into an identity column in SQL Server? I'll make a special item into my table and I will quickly detect that item by the ID. So because all other ID's are …

  5. sql server - Insert from another table, then update using Identity ...

    Oct 31, 2017 · Insert from another table, then update using Identity Ask Question Asked 8 years, 1 month ago Modified 8 years, 1 month ago

  6. sql server - How do you retrieve the identity value of a row …

    May 22, 2019 · The last-inserted row has an identity value of 1, yet the @@IDENTITY and SCOPE_IDENTITY() functions are returning their original values from the original INSERT …

  7. t sql - SET IDENTITY_INSERT inside INSTEAD OF INSERT trigger not ...

    Oct 28, 2014 · SET IDENTITY_INSERT PixTest off END ELSE INSERT INTO PixTest(Teste) SELECT TESTE FROM inserted; END; go INSERT INTO PixTest(ID, TESTE) VALUES (1, …

  8. sql server - Regretting an identity: Is there a way to force inserts to ...

    Mar 24, 2023 · Enable Identity Insert Insert the row (s) with hard-coded integer IDs Disable Identity Insert If everyone does that the data will either remain synced, or a script will fail and …

  9. sql server - How do I copy a table with SELECT INTO but ignore …

    Jan 27, 2011 · Down the page: When an existing identity column is selected into a new table, the new column inherits the IDENTITY property, unless one of the following conditions is true: The …

  10. sql server - IDENTITY_INSERT seems stuck - Database …

    Before adding the database name to the reference, were you referencing the target table exactly the same way in both the SET IDENTITY_INSERT and the INSERT command?