Monday, March 26, 2012

Job SQL Limitation

Does anyone know what is the limitation on SQL Server job
SQL statement is ?. I am trying to create a job that has a
long SQL (Select) statement but it does not allow me to
put the whole statement (It truncates). What are the
alternatives (NOT DTS or QA)? These are more that 15
separeate SQL statements I need to schedule and get the
result in 1 file.
T.I.A
When you say one file do you mean the output file for the job? If so why
not place these in stored procedures and simply run them?
Andrew J. Kelly SQL MVP
"Ken" <anonymous@.discussions.microsoft.com> wrote in message
news:210b01c50239$2df26960$a401280a@.phx.gbl...
> Does anyone know what is the limitation on SQL Server job
> SQL statement is ?. I am trying to create a job that has a
> long SQL (Select) statement but it does not allow me to
> put the whole statement (It truncates). What are the
> alternatives (NOT DTS or QA)? These are more that 15
> separeate SQL statements I need to schedule and get the
> result in 1 file.
> T.I.A
|||> SQL statement is ?. I am trying to create a job that has a
> long SQL (Select) statement but it does not allow me to
> put the whole statement (It truncates). What are the
> alternatives
Put your T-SQL code in a stored procedure?
http://www.aspfaq.com/
(Reverse address to reply.)
|||If you cannot or do not want to create a stored procedure (for whatever
reason) I suggest you save your T-SQL to a file on the local hard drive.
You can use osql.exe to execute the script file within the job step.
Keith
"Ken" <anonymous@.discussions.microsoft.com> wrote in message
news:210b01c50239$2df26960$a401280a@.phx.gbl...
> Does anyone know what is the limitation on SQL Server job
> SQL statement is ?. I am trying to create a job that has a
> long SQL (Select) statement but it does not allow me to
> put the whole statement (It truncates). What are the
> alternatives (NOT DTS or QA)? These are more that 15
> separeate SQL statements I need to schedule and get the
> result in 1 file.
> T.I.A
|||Just to add...the limit is 3200 characters.
-Sue
On Mon, 24 Jan 2005 09:21:45 -0800, "Ken"
<anonymous@.discussions.microsoft.com> wrote:

>Does anyone know what is the limitation on SQL Server job
>SQL statement is ?. I am trying to create a job that has a
>long SQL (Select) statement but it does not allow me to
>put the whole statement (It truncates). What are the
>alternatives (NOT DTS or QA)? These are more that 15
>separeate SQL statements I need to schedule and get the
>result in 1 file.
>T.I.A
|||Thanks to all.........
I will use SP.......
[vbcol=seagreen]
>--Original Message--
has a
>Put your T-SQL code in a stored procedure?
>--
>http://www.aspfaq.com/
>(Reverse address to reply.)
>
>.
>
|||Although, I put the statements into a SP, I don't get the
same output in Scheduled job output as I get out of the QA
(I like to get it as it is in QA output).
Thanks.
[vbcol=seagreen]
>--Original Message--
has a
>Put your T-SQL code in a stored procedure?
>--
>http://www.aspfaq.com/
>(Reverse address to reply.)
>
>.
>
|||But EM might be more restrictive then 3200 characters. I recall a case a long time ago when I tested
it, and conclusion was that if you need more than what EM allows, you need to add the jobsteps using
sp_add_jobstep.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:djeav0140graejhho9kee8u1qkd68olvgf@.4ax.com...
> Just to add...the limit is 3200 characters.
> -Sue
> On Mon, 24 Jan 2005 09:21:45 -0800, "Ken"
> <anonymous@.discussions.microsoft.com> wrote:
>
|||I have 1 Select statement that is 3750 characters which
does not go into any job steps.........

>--Original Message--
>But EM might be more restrictive then 3200 characters. I
recall a case a long time ago when I tested
>it, and conclusion was that if you need more than what EM
allows, you need to add the jobsteps using[vbcol=seagreen]
>sp_add_jobstep.
>--
>Tibor Karaszi, SQL Server MVP
>http://www.karaszi.com/sqlserver/default.asp
>http://www.solidqualitylearning.com/
>http://www.sqlug.se/
>
>"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
>news:djeav0140graejhho9kee8u1qkd68olvgf@.4ax.com.. .
job[vbcol=seagreen]
has a
>
>.
>
|||If you are > 3200 characters, you cannot have it directly in the jobstep regardless of whether you
are using EM or call sp_add_jobstep directly. Use any of the other suggested methods (put it in a
stored procedure, or use CmdExec jobstep which calls OSQL.EXE with an inputfile).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Ken" <anonymous@.discussions.microsoft.com> wrote in message
news:062b01c502e5$e2bc1330$a601280a@.phx.gbl...[vbcol=seagreen]
>I have 1 Select statement that is 3750 characters which
> does not go into any job steps.........
>
> recall a case a long time ago when I tested
> allows, you need to add the jobsteps using
> job
> has a
sql

No comments:

Post a Comment