About 462,000 results
Open links in new tab
  1. Reset identity seed after deleting records in SQL Server

    I have inserted records into a SQL Server database table. The table had a primary key defined and the auto increment identity seed is set to “Yes”. This is done primarily because in SQL …

  2. Solved: Xml/XQuery error SQL Server 2008 | Experts Exchange

    Jul 12, 2012 · SELECT @OrderId = SCOPE_IDENTITY() -- // step 2: order drops INSERT INTO [staging.telafuel.response].OrderFuel_OrderDrops (OrderId ,OrderTypeId ,DriverGUID …

  3. How to turn IDENTITY_INSERT on and off using SQL Server 2008?

    Setting the Identity Insert value and the subsequent Insert DML commands are to be run by the same session. Here @Beginner was setting Identity Insert ON separately and then running the …

  4. Add Identity column to a view in SQL Server 2008

    A view in SQL Server is just a "stored query" - it doesn't have any physical representation in the database. Therefore, you cannot add an identity column to a view

  5. SQL Server - Return value after INSERT - Stack Overflow

    INSERT INTO table (name) VALUES('bob'); Now I want to get the id back in the same step. How is this done? We're using Microsoft SQL Server 2008.

  6. SQL Server add auto increment primary key to existing table

    7 This answer is a small addition to the highest voted answer and works for SQL Server. The question requested an auto increment primary key, the current answer does add the primary …

  7. How to identify whether the table has identity column

    I want to find out whether the table has an identity column or not. Table is unknown to me. I have not done the structure of the table. Using Query? I am using Sql Server Compact Edition.

  8. sql - What is the difference between Scope_Identity (), Identity ...

    The identity() function is not used to get an identity, it's used to create an identity in a select...into query. The session is the database connection. The scope is the current query or the current …

  9. How to update Identity Column in SQL Server? - Stack Overflow

    Oct 3, 2013 · You can not update identity column. SQL Server does not allow to update the identity column unlike what you can do with other columns with an update statement. Although …

  10. sql - Store the value of output inserted._ID to local variable to …

    If it is an identity column and you are inserting multiple rows and want to return all the newly inserted Identity values, or it is not an identity column but you need the last inserted value then …