We have a SQL server 2008R2, we need to extract view create command but we couldn't find it and Generate scripts throws error message.
Any workaround or alternate way to extract create view command.
We have a SQL server 2008R2, we need to extract view create command but we couldn't find it and Generate scripts throws error message.
Any workaround or alternate way to extract create view command.
Hi @SarveshPandey-7139,
How are things going on? Did the answers help you?
Please feel free to let us know if you have any other question.
If you find any post in the thread is helpful, you could kindly accept it as answer.
Best Regards,
Amelia
Hi @SarveshPandey-7139,
How are things going on?
Could you please share us the detailed error message?
Any workaround or alternate way to extract create view command.
You can script the view by right-click the view-> Script View as->CREATE To.
You also can get all views in the database using the following query:
USE <Databasename>
Go
SELECT S.definition
FROM sys.sql_modules S
INNER JOIN sys.Objects O
ON S.Object_id = O.Object_id
WHERE O.type = 'v'
Please refer to this article which might help.
Best Regards,
Amelia
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Try running - sp_helptext <view name> and also see suggestions given here -
Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav
11 people are following this question.
Year and Month aggregation in same Pivot table in SQL Server
SQL Server Query for Searching by word in a string with word breakers
How to show first row group by part id and compliance type based on priorities of Document type?
Query to list all the databases that have a specific user
T-sql query to find the biggest table in a database with a clustered index