Solved

View - cannot see the source code??

Posted on 2013-06-03
3
279 Views
Last Modified: 2013-06-05
Hi I have a wierd problem in that I opened up my DB this morning and went into Design view of one of my Views.  I can see the tables, fields etc but no code for the SELECT query.  None of my other queries have this problem. I've tried moving the boundaries about to see if it's just obscured but to no avail on this specific View.  Unfortunately I don't have the code saved anywhere else and need to get to the code asap.  Please advise how I can view the code again for my View.  I'm using SQL Server 2012 (Express).
0
Comment
Question by:Lorna70
  • 2
3 Comments
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 39215695
Open a new query window
Press Ctrl + T to put the window in text mode
sp_helptext youviewnamehere
Copy the view text from the window below
Press Ctrl + D to put the window back into table mode
Save the view somewhere in your filesystem.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 250 total points
ID: 39216063
Do your self a favor and ditch the Designer.  Instead open VIEWs, Stored Procedures, etc. in the query window, by simply right clicking the VIEW in Object Explorer and selecting "Script View as" | "Alter to"
0
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 39216066
I agree with acperkins.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server 2012 Database Restore 4 39
MS SQL: Return all results in a single row separated by commas 1 27
Download ms sql express. 2 28
SQL Syntax Grouping Sum question 7 27
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question