Formatting issue in SQL

  • Thanks guys for the input, however as Gazareth said it's going to break after the limit.

  • Gazareth (3/7/2013)


    ScottPletcher (3/6/2013)


    To confirm, try writing the results returned by OBJECT_DEFINITION() to an nvarchar(max) column and checking the length of that column: I think you'll find that the entire code is actually returned by that function.

    It is; but you will still hit the 8192 character limit of SSMS' results to text if the definition's longer than that.

    There's always powershell:

    (gci 'sqlserver:\sql\machine\instance\databases\dbname\storedprocedures' | where {$_.name -eq 'procname'}).Script() + "GO"

    XML can display very long values, even in SSMS. Maybe slap a couple tags around the object text and display it as XML 🙂

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 2 posts - 16 through 16 (of 16 total)

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