dbTalk Databases Forums  

DTS Package Error on Multiple SQL SELECTS

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


Discuss DTS Package Error on Multiple SQL SELECTS in the microsoft.public.sqlserver.dts forum.



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

Default DTS Package Error on Multiple SQL SELECTS - 06-14-2005 , 11:28 AM






I am new to SQL. I have coded a query that has 4 separate SELECT statements.
Each step stores the result in temporary tables that are then referenced in
the next step. When I execute this series of steps in SQL Analyzer it works
fine. When I inlcude this query in a DTS package and execute it, I get this
error...
"Incomplete file format information - file cannot be opened."
Any help would be greatly appreciated.
--
Stan Gosselin

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

Default Re: DTS Package Error on Multiple SQL SELECTS - 06-14-2005 , 04:17 PM






The error suggests you are doing something with a text file?

Are you sure the file exists?
Are you sure you can get a lock on the file i.e. not still being written?
Are you sure the format of the file is as you want and have specified.?

--



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


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

Quote:
I am new to SQL. I have coded a query that has 4 separate SELECT
statements.
Each step stores the result in temporary tables that are then referenced
in
the next step. When I execute this series of steps in SQL Analyzer it
works
fine. When I inlcude this query in a DTS package and execute it, I get
this
error...
"Incomplete file format information - file cannot be opened."
Any help would be greatly appreciated.
--
Stan Gosselin



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

Default Re: DTS Package Error on Multiple SQL SELECTS - 06-15-2005 , 08:42 AM



The DTS package is exporting data to a .txt file. I have used this technique
7 or 8 time before and it has never failed. This is the only time, however,
that me SQL code: 1. Uses temporary tables and 2. Uses multiple Selects.
Here is the code (which may be a very round about way of accomplishing my
task). My whole intent is to create 1 Row for each Sku with it Case Location
and Bottle Location when the original Locations table has that info in 2 rows.
Thanks for any direction. My unknowledgable gut feeling is that the DTS is
having trouble with the multi-select syntax when it is executed as a package
vs. being executed 'real-time' in SQL Analyzer??????????
*******
Select Distinct lo.Sku, [Description 1], [Size]
into #ls
From Locations lo Left Outer Join Sku ws on lo.Sku = ws.Sku

Select #ls.Sku
Case LocationTypeID
When 3 Then LocationID
When 4 Then LocationID
End As CaseLoc
Into #lsc
From #ls Left Outer Join Locations lo on #ls.Sku = lo.Sku
Where LocationTypeID Between 3 And 4

Select #ls.Sku
Case LocationTypeID
When 1 Then LocationID
When 2 Then LocationID
End As BtlLoc
Into #lsb
From #ls Left Outer Join Locations lo on #ls.Sku = lo.Sku
Where LocationTypeID Between 1 And 2

Select #ls.Sku, #ls.[Description 1], #ls.[Size], #lsc.CaseLoc, #lsb.BtlLoc
From #ls Left Outer Join #lsc on #ls.Sku = #lsc.Sku
Left Outer Join #lsb on #ls.Sku = #lsb.Sku

**********


"Allan Mitchell" wrote:

Quote:
The error suggests you are doing something with a text file?

Are you sure the file exists?
Are you sure you can get a lock on the file i.e. not still being written?
Are you sure the format of the file is as you want and have specified.?

--



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


"Stan" <Stan (AT) discussions (DOT) microsoft.com> wrote in message
news82E1F95-81D1-4356-82D2-EED1E0ACD869 (AT) microsoft (DOT) com...
I am new to SQL. I have coded a query that has 4 separate SELECT
statements.
Each step stores the result in temporary tables that are then referenced
in
the next step. When I execute this series of steps in SQL Analyzer it
works
fine. When I inlcude this query in a DTS package and execute it, I get
this
error...
"Incomplete file format information - file cannot be opened."
Any help would be greatly appreciated.
--
Stan Gosselin




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

Default Re: DTS Package Error on Multiple SQL SELECTS - 06-15-2005 , 03:10 PM



Have you tried using SET NOCOUNT ON?

--



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


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

Quote:
The DTS package is exporting data to a .txt file. I have used this
technique
7 or 8 time before and it has never failed. This is the only time,
however,
that me SQL code: 1. Uses temporary tables and 2. Uses multiple Selects.
Here is the code (which may be a very round about way of accomplishing my
task). My whole intent is to create 1 Row for each Sku with it Case
Location
and Bottle Location when the original Locations table has that info in 2
rows.
Thanks for any direction. My unknowledgable gut feeling is that the DTS
is
having trouble with the multi-select syntax when it is executed as a
package
vs. being executed 'real-time' in SQL Analyzer??????????
*******
Select Distinct lo.Sku, [Description 1], [Size]
into #ls
From Locations lo Left Outer Join Sku ws on lo.Sku = ws.Sku

Select #ls.Sku
Case LocationTypeID
When 3 Then LocationID
When 4 Then LocationID
End As CaseLoc
Into #lsc
From #ls Left Outer Join Locations lo on #ls.Sku = lo.Sku
Where LocationTypeID Between 3 And 4

Select #ls.Sku
Case LocationTypeID
When 1 Then LocationID
When 2 Then LocationID
End As BtlLoc
Into #lsb
From #ls Left Outer Join Locations lo on #ls.Sku = lo.Sku
Where LocationTypeID Between 1 And 2

Select #ls.Sku, #ls.[Description 1], #ls.[Size], #lsc.CaseLoc, #lsb.BtlLoc
From #ls Left Outer Join #lsc on #ls.Sku = #lsc.Sku
Left Outer Join #lsb on #ls.Sku = #lsb.Sku

**********


"Allan Mitchell" wrote:

The error suggests you are doing something with a text file?

Are you sure the file exists?
Are you sure you can get a lock on the file i.e. not still being written?
Are you sure the format of the file is as you want and have specified.?

--



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


"Stan" <Stan (AT) discussions (DOT) microsoft.com> wrote in message
news82E1F95-81D1-4356-82D2-EED1E0ACD869 (AT) microsoft (DOT) com...
I am new to SQL. I have coded a query that has 4 separate SELECT
statements.
Each step stores the result in temporary tables that are then
referenced
in
the next step. When I execute this series of steps in SQL Analyzer it
works
fine. When I inlcude this query in a DTS package and execute it, I get
this
error...
"Incomplete file format information - file cannot be opened."
Any help would be greatly appreciated.
--
Stan Gosselin






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.