SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Maximum size of SQL variable in SSIS ?


Maximum size of SQL variable in SSIS ?

Author
Message
blasto_max
blasto_max
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1163 Visits: 480
I have a string variable which stores a big set of sql statements, ie insert statements. The insert statement intends to inserts about 200K rows with 10 columns (Lots !)

I think that my package always fails when the SQL string is this big. So, I was wondering if there is any limit on the size of the sql string ? It shows no errors or warnings.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52436 Visits: 21180
I have a string variable which stores a big set of sql statements, ie insert statements. The insert statement intends to inserts about 200K rows with 10 columns (Lots !)

I think that my package always fails when the SQL string is this big. So, I was wondering if there is any limit on the size of the sql string ? It shows no errors or warnings.


Yes there's a limit. I searched Google and found it in two minutes. Have you even tried?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: General Forum Members
Points: 63434 Visits: 13298
blasto_max (11/17/2013)
I have a string variable which stores a big set of sql statements, ie insert statements. The insert statement intends to inserts about 200K rows with 10 columns (Lots !)

I think that my package always fails when the SQL string is this big. So, I was wondering if there is any limit on the size of the sql string ? It shows no errors or warnings.


How does your package fail? How do you know it fails if there are no errors or warnings.
Regarding the limit: try using a stored procedure instead.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
blasto_max
blasto_max
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1163 Visits: 480
Phil Parkin (11/17/2013)
I have a string variable which stores a big set of sql statements, ie insert statements. The insert statement intends to inserts about 200K rows with 10 columns (Lots !)

I think that my package always fails when the SQL string is this big. So, I was wondering if there is any limit on the size of the sql string ? It shows no errors or warnings.


Yes there's a limit. I searched Google and found it in two minutes. Have you even tried?


Yes, but may be my words were not correct. What words did you use ?
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52436 Visits: 21180
Have a look at this page. All sorts of useful info on limits there, including max. batch size.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
blasto_max
blasto_max
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1163 Visits: 480
Phil Parkin (11/17/2013)
Have a look at this page. All sorts of useful info on limits there, including max. batch size.


Maximum Capacity Specifications for SQL Server....I'll keep that in mind and bookmarks. Thanks.
Which part of the link tells me how to find the max size of SQL string ?
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52436 Visits: 21180
Batch size.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: General Forum Members
Points: 63434 Visits: 13298
Phil Parkin (11/18/2013)
Batch size.


I think the limit in SSIS is smaller.
I've had issues with very large SQL statements in Execute SQL Tasks, but they were less than 64K characters if I remember correctly.

If the string is stored in an SSIS variable configured with an expression, prior to SQL Server 2012 the limit was 4000 characters.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52436 Visits: 21180
Koen Verbeeck (11/18/2013)
Phil Parkin (11/18/2013)
Batch size.


I think the limit in SSIS is smaller.
I've had issues with very large SQL statements in Execute SQL Tasks, but they were less than 64K characters if I remember correctly.

If the string is stored in an SSIS variable configured with an expression, prior to SQL Server 2012 the limit was 4000 characters.


Interesting. My ExecuteSQL statements are usually very short, so I have not come up against any limit.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: General Forum Members
Points: 63434 Visits: 13298
Phil Parkin (11/18/2013)
Koen Verbeeck (11/18/2013)
Phil Parkin (11/18/2013)
Batch size.


I think the limit in SSIS is smaller.
I've had issues with very large SQL statements in Execute SQL Tasks, but they were less than 64K characters if I remember correctly.

If the string is stored in an SSIS variable configured with an expression, prior to SQL Server 2012 the limit was 4000 characters.


Interesting. My ExecuteSQL statements are usually very short, so I have not come up against any limit.


I have. :-D
A lot of views with a lot of columns strung together with UNION ALL.
When using expressions to create dynamic SQL, you can hit the limit of 4k characters pretty fast.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search