Showing posts with label temp. Show all posts
Showing posts with label temp. Show all posts

Friday, March 9, 2012

osql question

Re:
osql -i test.sql -e -b -r 1 > temp.log
I intend to use osql to submit a bunch of SQL scripts from
a batch file.
If the SQL script has an error, the message is logged with
a line number. But the echoed input does not have line
numbers. Instead, the SQL text is preceded by a line that
looks like:
1> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17>
18> 19> 20> 21> 22> 23>
The above looks to me like the line numbers without the
text. The text is successfully echoed after that, but
with out line numbers.
Is there any way to get the text echoed to the log file
with line numbers?
Hi
I don't think you can do exactly what you want. -n will turn of the N>
prompts and -m can set the error level to display.
John
"Randy" <anonymous@.discussions.microsoft.com> wrote in message
news:1c7c801c4524c$36dbc0a0$a001280a@.phx.gbl...
> Re:
> osql -i test.sql -e -b -r 1 > temp.log
> I intend to use osql to submit a bunch of SQL scripts from
> a batch file.
> If the SQL script has an error, the message is logged with
> a line number. But the echoed input does not have line
> numbers. Instead, the SQL text is preceded by a line that
> looks like:
> 1> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17>
> 18> 19> 20> 21> 22> 23>
> The above looks to me like the line numbers without the
> text. The text is successfully echoed after that, but
> with out line numbers.
> Is there any way to get the text echoed to the log file
> with line numbers?
>
>

OSQL performance slow vs ISQLW

I have a script to run against a SQL Server 2000 database Windows 2003 OS).
The script creates temp tables and then uses the manipulated data to update
the database.
The probelem is when I run the script in Query Analyzer it takes less then
10 minutes to execute. When run the same script using OSQL it takes over an
hour.
Has anyone seen anything like this? Any suggestions would be great.
Possibly different SET setting can affect things. Also, you could try SET NOCOUNT ON and see if it
makes any difference.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Wex" <Wex@.discussions.microsoft.com> wrote in message
news:1B68CD56-168D-419F-A01D-8FF310F2EC96@.microsoft.com...
>I have a script to run against a SQL Server 2000 database Windows 2003 OS).
> The script creates temp tables and then uses the manipulated data to update
> the database.
> The probelem is when I run the script in Query Analyzer it takes less then
> 10 minutes to execute. When run the same script using OSQL it takes over an
> hour.
> Has anyone seen anything like this? Any suggestions would be great.

OSQL performance slow vs ISQLW

I have a script to run against a SQL Server 2000 database Windows 2003 OS).
The script creates temp tables and then uses the manipulated data to update
the database.
The probelem is when I run the script in Query Analyzer it takes less then
10 minutes to execute. When run the same script using OSQL it takes over an
hour.
Has anyone seen anything like this? Any suggestions would be great.Possibly different SET setting can affect things. Also, you could try SET NO
COUNT ON and see if it
makes any difference.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Wex" <Wex@.discussions.microsoft.com> wrote in message
news:1B68CD56-168D-419F-A01D-8FF310F2EC96@.microsoft.com...
>I have a script to run against a SQL Server 2000 database Windows 2003 OS).
> The script creates temp tables and then uses the manipulated data to updat
e
> the database.
> The probelem is when I run the script in Query Analyzer it takes less then
> 10 minutes to execute. When run the same script using OSQL it takes over
an
> hour.
> Has anyone seen anything like this? Any suggestions would be great.

OSQL performance slow vs ISQLW

I have a script to run against a SQL Server 2000 database Windows 2003 OS).
The script creates temp tables and then uses the manipulated data to update
the database.
The probelem is when I run the script in Query Analyzer it takes less then
10 minutes to execute. When run the same script using OSQL it takes over an
hour.
Has anyone seen anything like this? Any suggestions would be great.Possibly different SET setting can affect things. Also, you could try SET NOCOUNT ON and see if it
makes any difference.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Wex" <Wex@.discussions.microsoft.com> wrote in message
news:1B68CD56-168D-419F-A01D-8FF310F2EC96@.microsoft.com...
>I have a script to run against a SQL Server 2000 database Windows 2003 OS).
> The script creates temp tables and then uses the manipulated data to update
> the database.
> The probelem is when I run the script in Query Analyzer it takes less then
> 10 minutes to execute. When run the same script using OSQL it takes over an
> hour.
> Has anyone seen anything like this? Any suggestions would be great.