Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SELECT definition : result to grid vs. text

Author  Topic 

dmilam
Posting Yak Master

185 Posts

Posted - 2010-06-07 : 17:00:54
When I run

SELECT DATALENGTH(Definition)
FROM sys.sql_modules
WHERE Object_ID IN (
SELECT Object_ID
FROM sys.all_objects
WHERE Schema_ID = '36' --created by UserA
)

in either text or grid mode, the same results are returned. (In a real world case, datalength is 1128).

However, when I run it without datalength,

SELECT Definition
FROM sys.sql_modules
WHERE Object_ID IN (
SELECT Object_ID
FROM sys.all_objects
WHERE Schema_ID = '36' --created by UserA
)


Then I cannot see the entire code definition in text view, only in grid view. (The text version result is truncated). How do I change text view to allow for the entire definition?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-06-07 : 17:08:30
Go to Tools..Options..Query Results..SQL Server..Results to Text. Change the "Maximum number of ..." field to 8000.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

dmilam
Posting Yak Master

185 Posts

Posted - 2010-06-07 : 17:19:20
Thank you! I had an inkling it was some buried setting I wouldn't know where to find.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-06-07 : 17:33:16
You're welcome, glad to help.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -