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!

what is the database that you are using ?

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).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.