Hi Patrick
>I'd like to do something like
>? SQLEXEC(lnHandle,"SET IDENTITY_INSERT dbo.Auftrag ON")
>
>This returns 1, but unfortunately does not change the IDENTITY_INSERT-Setting of my Sql Server.
>
>Is there an other way or solution?
The code you are using is correct, and as Sergey has pointed out, your test for functionality is not conclusive. Try the following:
? SQLEXEC(lnHandle,"SET IDENTITY_INSERT dbo.Auftrag ON")
? SQLEXEC(lnHandle,"SET IDENTITY_INSERT <other table> ON")
If the second command fails - then all is well. If it succeeds, then you probably don't have sufficient rights on your log-in in order to do this. You need either 'sysadmin', 'db_owner', 'db_ddladmin' or must be the object owner.
----
Regards
Andy Kramek