June 5, 2003 at 5:22 pm
The following query works for Views that are under the 4000 character Nvarchar limitation;
SELECT VIEW_DEFINITION
FROM {TableName}.INFORMATION_SCHEMA.VIEWS
WHERE TABLE_NAME = @TABLEorVIEWName
However any View over this limit returns Null. I have a need where I must return the view code, any suggestions, ideas?
June 5, 2003 at 8:26 pm
Try the system stored procedure sp_helptext. For instance:
EXEC sp_helptext MyView
K. Brian Kelley
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1
K. Brian Kelley
@kbriankelley
June 6, 2003 at 12:27 pm
Brian thanks a lot that answer is a life safer.
My only other issue : Does account with datareader have enough access to execute it. My initial test seems to be Yes, any futher comments?
June 6, 2003 at 1:32 pm
Short answer, yes.
K. Brian Kelley
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1
K. Brian Kelley
@kbriankelley
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply