Why am I receiving the identity insert error even after explicitly setting IDENTITY_INSERT ON and using a column list? [on hold]IDENTITY_INSERT seems stuckSQL Server 2008 R2 Transactional Replication “Cannot insert explicit value for identity column…”How to set identity_insert to on in SQL ServerUpdate statement is giving an invalid column name error, even though the column existsWhy doesn't SQL Server rollback the identity_insert state?Unable to insert explicit value in table due to IDENTITY_INSERT is ON ErrorChange IDENTITY_INSERT to ON in SQL serverWhy can a SQL Server table not have more than one IDENTITY column?Generated bug data script how not to set the IDENTITY in the insert statements?Use Multiple Expressions In Select List
Game artist computer workstation set-up – is this overkill?
Extracting the parent, leaf, and extension from a valid path
Why is there a cap on 401k contributions?
Is there a reason why Turkey took the Balkan territories of the Ottoman Empire, instead of Greece or another of the Balkan states?
Assuming a normal distribution: what is the sd for a given mean?
Gift for mentor after his thesis defense?
Are modes in jazz primarily a melody thing?
How to make a kid's bike easier to pedal
How does jetBlue determine its boarding order?
The unknown and unexplained in science fiction
Bash prompt takes only the first word of a hostname before the dot
Scaling rounded rectangles in Illustrator
How can I draw a rectangle around venn Diagrams?
What’s the interaction between darkvision and the Eagle Aspect of the beast, if you have Darkvision past 100 feet?
Why always 4...dxc6 and not 4...bxc6 in the Ruy Lopez Exchange?
Does this website provide consistent translation into Wookiee?
Is throwing dice a stochastic or a deterministic process?
All of my Firefox add-ons have been disabled suddenly, how can I re-enable them?
LiOH hydrolysis of methyl 2,2-dimethoxyacetate not giving product?
Make me a minimum magic sum
Why was Gemini VIII terminated after recovering from the OAMS thruster failure?
Concatenate all values of the same XML element using XPath/XQuery
What's the difference between "ricochet" and "bounce"?
Function annotation with two or more return parameters
Why am I receiving the identity insert error even after explicitly setting IDENTITY_INSERT ON and using a column list? [on hold]
IDENTITY_INSERT seems stuckSQL Server 2008 R2 Transactional Replication “Cannot insert explicit value for identity column…”How to set identity_insert to on in SQL ServerUpdate statement is giving an invalid column name error, even though the column existsWhy doesn't SQL Server rollback the identity_insert state?Unable to insert explicit value in table due to IDENTITY_INSERT is ON ErrorChange IDENTITY_INSERT to ON in SQL serverWhy can a SQL Server table not have more than one IDENTITY column?Generated bug data script how not to set the IDENTITY in the insert statements?Use Multiple Expressions In Select List
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
My code:
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn ON
INSERT INTO SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn
SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
FROM ALinkedServer.PrettyCoolDatabaseAsWell.StandardSchema.TableWithIdentityColumn
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn OFF
The error:
Msg 8101, Level 16, State 1, Line 4
An explicit value for the identity column in table
'SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn' can only be specified when a column list
is used and IDENTITY_INSERT is ON.
What gives?
sql-server sql-server-2008-r2 insert table identity
put on hold as off-topic by LowlyDBA, MDCCL, Colin 't Hart, Andriy M, Vérace yesterday
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – LowlyDBA, MDCCL, Colin 't Hart, Andriy M, Vérace
add a comment |
My code:
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn ON
INSERT INTO SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn
SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
FROM ALinkedServer.PrettyCoolDatabaseAsWell.StandardSchema.TableWithIdentityColumn
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn OFF
The error:
Msg 8101, Level 16, State 1, Line 4
An explicit value for the identity column in table
'SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn' can only be specified when a column list
is used and IDENTITY_INSERT is ON.
What gives?
sql-server sql-server-2008-r2 insert table identity
put on hold as off-topic by LowlyDBA, MDCCL, Colin 't Hart, Andriy M, Vérace yesterday
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – LowlyDBA, MDCCL, Colin 't Hart, Andriy M, Vérace
Isn't this the column list (or am I being stupid? lol): SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
– J.D.
May 3 at 16:16
add a comment |
My code:
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn ON
INSERT INTO SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn
SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
FROM ALinkedServer.PrettyCoolDatabaseAsWell.StandardSchema.TableWithIdentityColumn
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn OFF
The error:
Msg 8101, Level 16, State 1, Line 4
An explicit value for the identity column in table
'SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn' can only be specified when a column list
is used and IDENTITY_INSERT is ON.
What gives?
sql-server sql-server-2008-r2 insert table identity
My code:
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn ON
INSERT INTO SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn
SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
FROM ALinkedServer.PrettyCoolDatabaseAsWell.StandardSchema.TableWithIdentityColumn
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn OFF
The error:
Msg 8101, Level 16, State 1, Line 4
An explicit value for the identity column in table
'SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn' can only be specified when a column list
is used and IDENTITY_INSERT is ON.
What gives?
sql-server sql-server-2008-r2 insert table identity
sql-server sql-server-2008-r2 insert table identity
asked May 3 at 16:08
J.D.J.D.
568414
568414
put on hold as off-topic by LowlyDBA, MDCCL, Colin 't Hart, Andriy M, Vérace yesterday
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – LowlyDBA, MDCCL, Colin 't Hart, Andriy M, Vérace
put on hold as off-topic by LowlyDBA, MDCCL, Colin 't Hart, Andriy M, Vérace yesterday
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – LowlyDBA, MDCCL, Colin 't Hart, Andriy M, Vérace
Isn't this the column list (or am I being stupid? lol): SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
– J.D.
May 3 at 16:16
add a comment |
Isn't this the column list (or am I being stupid? lol): SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
– J.D.
May 3 at 16:16
Isn't this the column list (or am I being stupid? lol): SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
– J.D.
May 3 at 16:16
Isn't this the column list (or am I being stupid? lol): SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
– J.D.
May 3 at 16:16
add a comment |
1 Answer
1
active
oldest
votes
Add a column list to your code:
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn ON
INSERT INTO SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn
(ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable)
SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
FROM ALinkedServer.PrettyCoolDatabaseAsWell.StandardSchema.TableWithIdentityColumn
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn OFF
GO
Basically, a column list is when you explicitly state what columns you're inserting into.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Add a column list to your code:
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn ON
INSERT INTO SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn
(ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable)
SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
FROM ALinkedServer.PrettyCoolDatabaseAsWell.StandardSchema.TableWithIdentityColumn
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn OFF
GO
Basically, a column list is when you explicitly state what columns you're inserting into.
add a comment |
Add a column list to your code:
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn ON
INSERT INTO SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn
(ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable)
SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
FROM ALinkedServer.PrettyCoolDatabaseAsWell.StandardSchema.TableWithIdentityColumn
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn OFF
GO
Basically, a column list is when you explicitly state what columns you're inserting into.
add a comment |
Add a column list to your code:
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn ON
INSERT INTO SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn
(ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable)
SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
FROM ALinkedServer.PrettyCoolDatabaseAsWell.StandardSchema.TableWithIdentityColumn
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn OFF
GO
Basically, a column list is when you explicitly state what columns you're inserting into.
Add a column list to your code:
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn ON
INSERT INTO SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn
(ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable)
SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
FROM ALinkedServer.PrettyCoolDatabaseAsWell.StandardSchema.TableWithIdentityColumn
SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn OFF
GO
Basically, a column list is when you explicitly state what columns you're inserting into.
answered May 3 at 16:19
CowthulhuCowthulhu
22318
22318
add a comment |
add a comment |
Isn't this the column list (or am I being stupid? lol): SELECT ColumnWithIdentity, OtherColumnWithoutIdentity, LastColumnInThisTable
– J.D.
May 3 at 16:16