Skip to Content.
Sympa Menu

freetds - Re: IDENTITY_INSERT ON

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Blair Colbey <colbey AT dreamwerx.net>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: IDENTITY_INSERT ON
  • Date: Wed, 11 Oct 2000 09:32:39 -0400 (EDT)



It looks like you have the "ID" column set to be the identity, or
auto_increment seed column.. you cannot specify the id for this column
when it is in the mode.. you have to just insert the data "test" into the
"Lieferadresse" column, then query the system to determine what the rowid
was set to by mssql..

If you want to specify the ID (probably not reccommended to ensure no
duplicates, etc) you will need to unclick the identity column in mssql
server enterprise manager, table design mode for the ID column.



On Wed, 11 Oct 2000, exxs - matevz sernc wrote:
> but i receive following error with INSERT. How can i set "IDENTITY_INSERT
> OFF" via TDS ?
>
> Warning: Sybase error: Cannot insert explicit value for identity column in
> table 'Adresse' when IDENTITY_INSERT is set to OFF. (severity 16) in
> /home/www/freedomland/mssql2.php on line 17
> result = 1

> $query="INSERT INTO adresse (KD_Id, Lieferadresse) VALUES('5','test')";
> $junk=mssql_query($query);
> echo "\n result = $junk \n\n";





Archive powered by MHonArc 2.6.24.

Top of Page