db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Amaya <joecool_30...@yahoo.com>
Subject MSSQL Insert problem
Date Tue, 17 Oct 2006 16:48:22 GMT
I'm getting this error whenever I try to insert into
my identity table through my website.

Cannot insert explicit value for identity column in
table 'CONTACTS' when IDENTITY_INSERT is set to OFF.

Supposedly you add:
 
"SET IDENTITY_INSERT <table>  ON
...........
SET IDENTITY_INSERT <table>  OFF"
 
around your generated Insert statement, but I'm not
sure where, I was thinking I should add to my row.vm
located in templates/sql/load/mssql but this doesn't
work. What is the exact syntax needed if this is
correct? My row.vm follows. 

This generated sql wasn't created by me, although I
don't think it was through the datasql task.

I was thinking of running datasql, the Ant task, to
see what sql it generated, but I would need to run
datadump first and my database is too large.  

------------------
row.vm

INSERT INTO $row.Table.Name (##
#set ($comma="")#foreach($col in
$row.ColumnValues)$comma${col.Column.Name}#set($comma=",")#end)
    VALUES (#set ($comma="")#foreach($col in
$row.ColumnValues)$comma${generator.parse("sql/load/mssql/val.vm",
"", "column", $col)}#set ($comma=",")#end);



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around 
http://mail.yahoo.com 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message