PASSING PERSISTED NTEXT TO SP_EXECUTESQL

  • namaste ji

    how can i use ntext data persisted in a table to feed sp_executesql within a stored procedure?

    i have seen this kind of question posted before, but i am looking to sp_executesql vs execute since i need to parameterize within the persisted tsql.

    i am working on a generic reporting tool written as a stored procedure.  consequently, the data source for the report needs to be stored and passed to the procedure.  obviously some queries can get large, so storing them in necessary.  i thought about creating views and passing the view name to the procedure but this will prevent the ability to limit within the view at run time (unless the limits are persisted as well).

    the challenge is getting the data from the table using a cursor and then passing the ntext to sp_executesql.  i have not used a blob before and am having a hard time finding clear examples of there use.

    respectfully,

    aaron

  • seems like kinda of a catch 22...you want to use sp_executesql, which is limited by it's paramater to a NVARCHAR 4000, but your command is potentially larger than 4000 chars.

    I know you don't want to hear it, but I believe it's the wrong tool for the job.

    I'm pretty sure Big SQL's require using EXEC or farming it out to isql/osql commands. I'll search for examples, but I'm sure that's the only solutions.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I appreciate your efforts Lowel and look forward to anything you may find.

    kind regards,

    aaron

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply