How insert a row into table with IDENTITY col with defined value for that col

How insert a row into table with IDENTITY col with defined value for that col

Post by Felix Brun » Thu, 18 Sep 2003 01:02:28


I work with SQL Server 2000 and VC60/ATL OLE DB Consumer
Templates

How can I insert a row into a table with IDENTITY column
where the application is giving the value for the IDENTITY
column.
With T-SQL I simply execute "SET IDENTITY_INSERT
TabWithIdent ON" and then insert the row.

When I create a command object on a session with Consumer
Templates, this does not work.

Are there any C++ (OLE DB Consumer Templates) code
examples to do this job ?

Any help would be appreciated,
Felix
 
 
 

How insert a row into table with IDENTITY col with defined value for that col

Post by Alex Mitch » Fri, 19 Sep 2003 00:45:12

Felix,

I solution would be to use a Stored Procedure for
inserting rows.

Alex

IDENTITY