dbTalk Databases Forums  

converting error

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


Discuss converting error in the microsoft.public.sqlserver.dts forum.



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

Default converting error - 01-04-2004 , 09:41 PM






I have a dts package that copys information into staging tables. When the table are empty the package runs correctly.
When i try to run it a second time with a select * from table where field+field+field not in (select field+field+field from table)

I get a syntax error converting chartacter to string to smalldatetime data type.

If tables are truncated it runs fine i only want to update information that is not in the last table

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

Default Re: converting error - 01-05-2004 , 01:33 AM






If the tables are truncated then you have no data and therefore do not need
to convert anything
You are trying to join attributes together with incompatible datatypes

What is the structure of the table, sample data and your expected result?

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"shane" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have a dts package that copys information into staging tables. When the
table are empty the package runs correctly.
When i try to run it a second time with a select * from table where
field+field+field not in (select field+field+field from table)

I get a syntax error converting chartacter to string to smalldatetime data
type.

If tables are truncated it runs fine i only want to update information
that is not in the last table




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

Default Re: converting error - 01-05-2004 , 04:16 PM



when the package is first run, it inserts the data into the tables correctly. But when i run the package for the second to update any new records with the select statement that is when i get the error message. If i remove the field that hs the datestamp the package excutes fine. But i need to test the timestamp because there could be to values the same. And the time stamp will seperate them

----- Allan Mitchell wrote: -----

If the tables are truncated then you have no data and therefore do not need
to convert anything
You are trying to join attributes together with incompatible datatypes

What is the structure of the table, sample data and your expected result?

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"shane" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have a dts package that copys information into staging tables. When the
table are empty the package runs correctly.
When i try to run it a second time with a select * from table where
field+field+field not in (select field+field+field from table)
I get a syntax error converting chartacter to string to smalldatetime data
type.
If tables are truncated it runs fine i only want to update information
that is not in the last table





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

Default Re: converting error - 01-06-2004 , 01:22 AM



First tim e you run it there is no data so no problems.
Second time you run it the tables have data.

Forget DTS right now and issue the same query in Query Analyser. Does that
allow the statement ?

select * from table where field+field+field not in (select field+field+field
from table)

If you remove the timestamp field and it works that suggests the casting of
the field is not implicit and you may need to

CAST(field as varchar(20)) before concatenting the fields.



--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"shane" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
when the package is first run, it inserts the data into the tables
correctly. But when i run the package for the second to update any new
records with the select statement that is when i get the error message. If i
remove the field that hs the datestamp the package excutes fine. But i need
to test the timestamp because there could be to values the same. And the
time stamp will seperate them
Quote:
----- Allan Mitchell wrote: -----

If the tables are truncated then you have no data and therefore do
not need
to convert anything
You are trying to join attributes together with incompatible
datatypes

What is the structure of the table, sample data and your expected
result?

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"shane" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message
news:8DF41DDE-61EF-4F8A-92C8-59EE5D8FDCE1 (AT) microsoft (DOT) com...
I have a dts package that copys information into staging tables.
When the
table are empty the package runs correctly.
When i try to run it a second time with a select * from table where
field+field+field not in (select field+field+field from table)
I get a syntax error converting chartacter to string to
smalldatetime data
type.
If tables are truncated it runs fine i only want to update
information
that is not in the last table






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.