how to load data into sybase tables with identity columns using Informatica

using Inforamtica load flat files into SYbase tables with identity columns, I try to set :
pre SQL : set identity_insert tablename on
post SQL: set identity_insert tablename off

or also set at target in the mapping:
pre SQL : set identity_insert tablename on
post SQL: set identity_insert tablename off

but it gives the same error message :

"Explicit value specified for identity field in table 'tablename' when 'SET IDENTITY_INSERT' is OFF"

any idea to fix it?

SayYou_SayMeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dbaSQLCommented:
I believe you need to put the SET IDENTITY_INSERT command into the property "Connection Environment SQL" of the DB connetion.
0
Anthony PerkinsCommented:
Has this got anything to do with MS SQL Server?
0
SayYou_SayMeAuthor Commented:
thanks guys

--Running following statments in Sybase database , it works very well
set identity_insert tablename on
insert into tablename (id,name ...) values(1,'fs',..)
     
set identity_insert tablename off

--if setting SET IDENTITY_INSERT command into the property "Connection Environment SQL" of the DB connetion,
  i have 7 sybase target tables to load, they are using the same DBConnention
  but the syntax of it is SET IDENTITY_INSERT +tablename
  how to set up 1 SET IDENTITY_INSERT  for all tables?


 
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Anthony PerkinsCommented:
With MS SQL Server (I cannot speak for Sybase) you do each one individually as in:

SET IDENTITY_INSERT YourTableName1 ON
INSERT YourTableName1()... VALUES (...)
SET IDENTITY_INSERT YourTableName1 OFF

SET IDENTITY_INSERT YourTableName2 ON
INSERT YourTableName2()... VALUES (...)
SET IDENTITY_INSERT YourTableName2 OFF

...
0
SayYou_SayMeAuthor Commented:
--acperkins
it works well in Sybase too for above statments
but it does work in Informatica for setting pre SQL & Post SQL


0
Anthony PerkinsCommented:
Fair enough.  I have no clue then.
0
SayYou_SayMeAuthor Commented:
still waiting........ solutiion


any advice?
0
SayYou_SayMeAuthor Commented:
set the target identiyt column=>numeric identity
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SayYou_SayMeAuthor Commented:
it works,
0
Anthony PerkinsCommented:
In future don't post non-SQL Server questions in SQL Server zones.  It is not appropriate and is a total waste of time.

Thanks.
0
SayYou_SayMeAuthor Commented:
-acperkins

this question was posted Sybase and Informatica, but it is better to select more zone ,right? so select SQL Server.

if you do not know the solution, right now ,you get benefit ,correct?

thanks
0
Anthony PerkinsCommented:
>>this question was posted Sybase and Informatica, but it is better to select more zone ,right? so select SQL Server.<<
No.  SQL Server does not apply.

>>if you do not know the solution, right now ,you get benefit ,correct?<<
No, it means I wasted time on your thread when I should have been helping someone else.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.