Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table With Identity PK
Message
 
 
À
10/01/2003 14:18:54
Dave Sonier
Technologies Nter inc.
Gatineau, Québec, Canada
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00740445
Message ID:
00740584
Vues:
24
Dave,

You've to provide the list of columns for your INSERT statement.
SET IDENTITY_INSERT dbo.tblOperations ON
insert INTO dbo.tblOperations (IdOperation, Nosite) 
select 	IdOperation, 3
from #tblOperations
>Hi,
>
>I have a table with an Identity Primary Key.
>
>I want to insert some records without using the identity.
>
>So, I tried that and I got an error:
>
>CREATE TABLE dbo.tblOperations (
> IdOperation int IDENTITY (1, 1) NOT NULL ,
> NoSite int NOT NULL ,
>blabla...
>
>SET IDENTITY_INSERT dbo.tblOperations ON
>insert dbo.tblOperations
>select IdOperation,
> 3
>from #tblOperations
>
>
>and I GOT THIS ERROR:
>Server: Msg 8101, Level 16, State 1, Line 1
>An explicit value for the identity column in table 'dbo.tblOperations' can only be specified when a column list is used and IDENTITY_INSERT is ON.
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform