SET IDENTITY_INSERT tableA ON
You have to make a column list for your INSERT statement:
INSERT Into tableA ([id], [c2], [c3], [c4], [c5] )
SELECT [id], [c2], [c3], [c4], [c5] FROM tableB
not like “INSERT Into tableA SELECT ……..”
SET IDENTITY_INSERT tableA OFF
More Related Contents:
- SQL Server – error when creating stored procedure
- What do Clustered and Non-Clustered index actually mean?
- Regex pattern inside SQL Replace function?
- Does T-SQL have an aggregate function to concatenate strings? [duplicate]
- Add IIS 7 AppPool Identities as SQL Server Logons
- SQL Server: Query fast, but slow from procedure
- Errors: “INSERT EXEC statement cannot be nested.” and “Cannot use the ROLLBACK statement within an INSERT-EXEC statement.” How to solve this?
- Is there a way to loop through a table variable in TSQL without using a cursor?
- sql server invalid object name – but tables are listed in SSMS tables list
- How to get a date in YYYY-MM-DD format from a TSQL datetime field?
- How do I format a number with commas in T-SQL?
- What columns generally make good indexes?
- What is a free tool to compare two SQL Server Databases? [closed]
- How can I make HTTP request from SQL server?
- SQL Server Management Studio alternatives to browse/edit tables and run queries [closed]
- SQL Server: Database stuck in “Restoring” state
- Format SQL in SQL Server Management Studio
- Split one column into multiple rows
- #DELETE viewing SQL Server table in Access
- Get ROWS as COLUMNS (SQL Server dynamic PIVOT query)
- Grant Select on a view not base table when base table is in a different database
- SQL Server (localdb)\v11.0 explained
- How to store directory / hierarchy / tree structure in the database?
- SQL Server – join rows into comma separated list
- Which is quicker COALESCE OR ISNULL?
- Merge multiple rows into a single row
- Is there an “IF EXISTS” test for a linked server?
- Unique identifier (guid) as primary key in database design
- How to extract this specific substring in SQL Server?
- SQL Server stored procedure return code oddity