Results 1 to 2 of 2

Thread: sp_executeSQL

  1. #1
    Join Date
    Mar 2002

    Unanswered: sp_executeSQL

    Is there anything that will allow you to execute a line of sql code if it is longer than 4000 Unicode characters? The line of code is stored in a NVARCHAR Variable.

    I'm using sp_ExecuteSQL and have hit the 4000 character wall

  2. #2
    Join Date
    Jul 2003
    The Dark Planet
    Executes a Transact-SQL statement or batch that can be reused many times, or that has been built dynamically. The Transact-SQL statement or batch can contain embedded parameters.

    sp_executesql [@stmt =] stmt
    {, [@params =] N'@parameter_name data_type [,...n]' }
    {, [@param1 =] 'value1' [,...n] }

    [@stmt =] stmt

    Is a Unicode string containing a Transact-SQL statement or batch. stmt must be either a Unicode constant or a variable that can be implicitly converted to ntext. More complex Unicode expressions (such as concatenating two strings with the + operator) are not allowed. Character constants are not allowed. If a constant is specified, it must be prefixed with an N. For example, the Unicode constant N'sp_who' is legal, but the character constant 'sp_who' is not. The size of the string is limited only by available database server memory.

    stmt can contain parameters having the same form as a variable name, for example:

    N'SELECT * FROM Employees WHERE EmployeeID = @IDParameter'

    Each parameter included in stmt must have a corresponding entry in both the @params parameter definition list and the parameter values list.
    (Books online) says just the opposite ..
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts