954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

[Help] Get the SQL View's String

hi all, please help me on this...

Is there a way to get the SQl View's String Command used to create said View?

For Example,

I have a View named tryView, now I want to get the string command used to create tryView like this one...

CREATE VIEW tryView AS SELECT titles.title, publishers.pub_name, pub_info.logo, titles.pub_id as tpid, publishers.pub_id as ppid FROM (titles LEFT JOIN publishers ON titles.pub_id=publishers.pub_id) LEFT JOIN pub_info ON titles.pub_id=pub_info.pub_id WITH CHECK OPTION

how do i retrieve this string using vb.Net?

Thank You!

zepi
Newbie Poster
7 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

what is the database that you are using ?

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

In MS SQL Server Management Studio: Right click the view and select script view as > create to > New Query Editor Window.

A more "advanced" approach is to visit sys.sql_modules (I'm not sure about the modules part of the table).

adam_k
Practically a Posting Shark
803 posts since Jun 2011
Reputation Points: 256
Solved Threads: 149
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: