dbTalk Databases Forums  

how to autogenerate ID field

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss how to autogenerate ID field in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JasonMeyer
 
Posts: n/a

Default how to autogenerate ID field - 07-13-2005 , 10:04 AM







Trying to import a excel spreadsheet and I have setup the transform as
such...

Function Main()
DTSDestination("id")=
DTSDestination("fn") = DTSSource("First")
DTSDestination("ln") = DTSSource("Last")
DTSDestination("uid") = DTSSource("Nalphakey")
DTSDestination("bldg") = DTSSource("Building Desc")
DTSDestination("cat") = DTSSource("Cat")
DTSDestination("hiredate") = DTSSource("Hire Date")
......


I don't know how to auto fill the ID field. It is an INT datatype is set
for Identity and the increment is set to 1. But when I run my
transform...usually just leaving out the DTSDestination("id") portion I
get an error stating I can't insert a null value into ID.

As you can tell I am rather new to DTS transforms. Thanks for the info.

Jason

Reply With Quote
  #2  
Old   
Jeffrey K. Ericson
 
Posts: n/a

Default RE: how to autogenerate ID field - 07-13-2005 , 10:11 AM






If the identity is set at the table level, take it out of your script
completely.

"JasonMeyer" wrote:

Quote:
Trying to import a excel spreadsheet and I have setup the transform as
such...

Function Main()
DTSDestination("id")=
DTSDestination("fn") = DTSSource("First")
DTSDestination("ln") = DTSSource("Last")
DTSDestination("uid") = DTSSource("Nalphakey")
DTSDestination("bldg") = DTSSource("Building Desc")
DTSDestination("cat") = DTSSource("Cat")
DTSDestination("hiredate") = DTSSource("Hire Date")
......


I don't know how to auto fill the ID field. It is an INT datatype is set
for Identity and the increment is set to 1. But when I run my
transform...usually just leaving out the DTSDestination("id") portion I
get an error stating I can't insert a null value into ID.

As you can tell I am rather new to DTS transforms. Thanks for the info.

Jason


Reply With Quote
  #3  
Old   
JasonMeyer
 
Posts: n/a

Default Re: how to autogenerate ID field - 07-13-2005 , 10:32 AM



Jeffrey K. Ericson wrote:
Quote:
If the identity is set at the table level, take it out of your script
completely.

"JasonMeyer" wrote:


Trying to import a excel spreadsheet and I have setup the transform as
such...

Function Main()
DTSDestination("id")=
DTSDestination("fn") = DTSSource("First")
DTSDestination("ln") = DTSSource("Last")
DTSDestination("uid") = DTSSource("Nalphakey")
DTSDestination("bldg") = DTSSource("Building Desc")
DTSDestination("cat") = DTSSource("Cat")
DTSDestination("hiredate") = DTSSource("Hire Date")
......


I don't know how to auto fill the ID field. It is an INT datatype is set
for Identity and the increment is set to 1. But when I run my
transform...usually just leaving out the DTSDestination("id") portion I
get an error stating I can't insert a null value into ID.

As you can tell I am rather new to DTS transforms. Thanks for the info.

Jason

Thanks for the reply.

The script actually doesn't have the identity in it. I just left it in
there if there was some sort of function that I needed to add to get it
to autoincrement the field.


Reply With Quote
  #4  
Old   
JasonMeyer
 
Posts: n/a

Default Re: how to autogenerate ID field - 07-13-2005 , 10:54 AM



Jeffrey K. Ericson wrote:
Quote:
If the identity is set at the table level, take it out of your script
completely.

"JasonMeyer" wrote:


Trying to import a excel spreadsheet and I have setup the transform as
such...

Function Main()
DTSDestination("id")=
DTSDestination("fn") = DTSSource("First")
DTSDestination("ln") = DTSSource("Last")
DTSDestination("uid") = DTSSource("Nalphakey")
DTSDestination("bldg") = DTSSource("Building Desc")
DTSDestination("cat") = DTSSource("Cat")
DTSDestination("hiredate") = DTSSource("Hire Date")
......


I don't know how to auto fill the ID field. It is an INT datatype is set
for Identity and the increment is set to 1. But when I run my
transform...usually just leaving out the DTSDestination("id") portion I
get an error stating I can't insert a null value into ID.

As you can tell I am rather new to DTS transforms. Thanks for the info.

Jason

Ok I figured it out. I opened the package in design mode, edited the
transform and removed the tick in Enable Idenity Insert and removed the
ID field from the available destination columns. Thanks for the help.

Jason


Reply With Quote
  #5  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: how to autogenerate ID field - 07-13-2005 , 01:06 PM



You are suffering from this by the looks of things

Problems With IDENTITY() and the DataPump task.
(http://www.sqldts.com/default.aspx?293)

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"JasonMeyer" <jason.meyer (AT) nospam (DOT) isd623.org> wrote

Quote:
Trying to import a excel spreadsheet and I have setup the transform as
such...

Function Main()
DTSDestination("id")=
DTSDestination("fn") = DTSSource("First")
DTSDestination("ln") = DTSSource("Last")
DTSDestination("uid") = DTSSource("Nalphakey")
DTSDestination("bldg") = DTSSource("Building Desc")
DTSDestination("cat") = DTSSource("Cat")
DTSDestination("hiredate") = DTSSource("Hire Date")
.....


I don't know how to auto fill the ID field. It is an INT datatype is set
for Identity and the increment is set to 1. But when I run my
transform...usually just leaving out the DTSDestination("id") portion I
get an error stating I can't insert a null value into ID.

As you can tell I am rather new to DTS transforms. Thanks for the info.

Jason



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.