Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sql server 2008 limit on exec statement

Tags:

sql

sql-server

I just needed to double check if there is a limit of characters on EXEC command in t-sql? If I have a variable with varchar(max) and execute the command using EXEC, you reckon that would be ok?

thanks

like image 946
user384080 Avatar asked Oct 11 '10 23:10

user384080


1 Answers

Should be fine, according to this MSDN article.

The relevant part:

Using EXECUTE with a Character String

In earlier versions of SQL Server, character strings are limited to 8,000 bytes. This requires concatenating large strings for dynamic execution. In SQL Server, the varchar(max) and nvarchar(max) data types can be specified that allow for character strings to be up to 2 gigabytes of data.

like image 75
LittleBobbyTables - Au Revoir Avatar answered Oct 07 '22 01:10

LittleBobbyTables - Au Revoir