HELP: isql is driving me nuts! 
Author Message
 HELP: isql is driving me nuts!

Greetings all,

I am attempting to populate a temporary table with INSERT INTO EXECUTE, and
then executing an extended stored proc that calls isql, and isql reads in a
text file that contains a select statement. The problem is, it thinks that
the output from isql is one column! It is not, it's just a simple select
(that contains three columns). Here is the call:

INSERT INTO #temptable (List, IDCol, RecordCol)


containing a select statement that is selecting THREE columns, however, when
it does the insert, it thinks that only ONE column has resulted and it gives
me an error. I know it thinks it's one column because if I only insert one
column, it works fine, and the one column I end up with is a composite of
the three columns from the select statement...HELP!! Is this an isql bug? I
find it hard to believe they would make it work this way!

Thanks

Randal



Sat, 19 Aug 2000 03:00:00 GMT
 HELP: isql is driving me nuts!

Randal,

Quote:
>INSERT INTO #temptable (List, IDCol, RecordCol)

>...only ONE column has resulted

That is correct, as xp_cmdshell always returns a single column
consisting of whatever would have gone to the screen if the command
were run interactively.  Remember that ISQL.EXE does not return a
relational result set, it just shows lines of text.

Roy



Sun, 20 Aug 2000 03:00:00 GMT
 HELP: isql is driving me nuts!

Randal,

        You are command shelling out to NT to run ISQL to run your query.  I've
never done this, but I would expect that you are getting the equivalent of
a listing back to your Insert.  In other words, a single character string
per line, ended by a new line.  Not very surprising.  You _might_ be able
to muscle it into working by manually including a tab character between
each column.

        But...  

        Since I don't know what constraints you are operating under, I can't give
direct advice.   But, I would suggest that your problem could stand some
rethinking.  Why is the SQL command on disk?  Could the tool that put it
there transmit to MSSQL itself?  Etc.

        An alternative, assuming that nothing can fundamentally change in your
environment, create a global ##temp table (named uniquely as suits your
app), then have the ISQL insert directly into the ##temp table.  Then go
from there.

-- Russell Fields, MVP



Sun, 20 Aug 2000 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Please Help, this is driving me nuts !!

2. This query is driving me nuts - please help !!

3. help vb & access2k is driving me nuts

4. HELP - ADO data Environment driving me nuts!

5. msdn docs drive me nuts, help find CDaoTableDef connect string format description

6. Help: Find mode is driving me nuts.

7. I am having a problem with a hard disk drive or floppy disk drive

8. SQL 7.0 Backup/Restore , Maybe I am nuts

9. Am I nuts?

10. Am I nuts or......

11. I am going *#&^! NUT about JDBC

12. Filtered Popups - Am I Nuts?


 
Powered by phpBB® Forum Software