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
 retrieve code of a view

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2014-12-11 : 10:47:16
Hello,
I can retrieve the sql code of a view as follows:
exec sp_helptext @viewName

The result will be in several lines which shows the lines of the sqlcode...
Is it possible to return the sql but not the line numbers?
Thanks

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-12-11 : 11:14:41
In SSMS, click the "Results to Text" button before executing
Go to Top of Page

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2014-12-11 : 11:16:57
would you happen to know how to get it into a textbox on a windows UI?
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-12-11 : 12:03:50
SSMS *is* a Windows UI
Go to Top of Page

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2014-12-11 : 12:45:52
Thanks
Go to Top of Page
   

- Advertisement -