?
Solved

How to increase the execute sql task query lenth

Posted on 2012-08-17
6
Medium Priority
?
308 Views
Last Modified: 2012-09-11
HI Expers

i have very big query
when i am trying to place the query in to the exacute sql task, it is not copying all the quey
is there any way to increathe size in the sql execute task

i am using the OLED connect

i cant create peocedure or view, i have to use the quey

please help me here
0
Comment
Question by:parpaa
  • 3
  • 2
6 Comments
 
LVL 16

Expert Comment

by:EvilPostIt
ID: 38304537
You can use a variable. To execute it do the following

DECLARE @SQL VARCHAR(MAX)
EXEC (@SQL)

Open in new window

0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 38304746
My one experience with this is what EvilPostIt commented.  
We created the super-large query in a text file, then in SSIS loaded the contents of that text file into a variable, then executed the variable.
0
 

Author Comment

by:parpaa
ID: 38304995
could you please suggeste me how how to move the how can i move the query from text file to variable in execution
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 16

Expert Comment

by:EvilPostIt
ID: 38305100
You could load the query into a table with the column data type of VARCHAR(MAX) and then run the command stated above.
0
 

Author Comment

by:parpaa
ID: 38329569
i cant do these because of the production DB
0
 
LVL 16

Accepted Solution

by:
EvilPostIt earned 1500 total points
ID: 38329585
If you want to export the query out to a file you could use SQLCMD or OSQL to execute it.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are some very powerful Dynamic Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a di…
by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question