Solved

View - cannot see the source code??

Posted on 2013-06-03
3
280 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

726 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