Set displayed characters programmatically

  • Hi All,

    I just wrote a code-generating proc (it creates lines of code to execute in a different, proprietary application manually) and it has to output all (up to) 8000 characters per line.

    This is normally accomplished by right clicking the query window, going to "Query Options", selecting "Text" under the "Results" header, and setting "Maximum number of characters displayed in each column" = 8000.

    Trouble is I have the memory of a goldfish with Alzheimers, and often forget to do that, cutting off critical pieces of the code (to say nothing about someone else running it).

    Is there anything I can put into the proc to set this limit programmtically? In complete pseudocode, something like "SET MAX_OUTPUT_CHARACTERS 8000"?

    Executive Junior Cowboy Developer, Esq.[/url]

  • I don't believe there's a way in T-SQL. Certainly you might be able to manage this by hitting the registry, but that would be some external program, not your script.

    I might suggest that you either include a trigger code at the end of your output, so that if it's not there, you know something is wrong, or running this code and outputting to a file directly. Not easy in T-SQL, but perhaps you'd write to some output file with xp_cmdshell instead as a way of reminding you? Or running your code generator from PoSh or a batch file.

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

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