Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Refresh multiple views

Posted on 2008-10-14
3
Medium Priority
?
257 Views
Last Modified: 2013-11-24
Hi, first time question here, so please be gentle.
I've detached and attached a CRM database but need to refresh the views. Can I do this in one go, or am I studk with doing each view individualy.

Many Thanks. Please don't hesistate if you need more info, which I presume you all will.

Mark
0
Comment
Question by:mark_uunix
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22717081
define "REFRESH VIEWS"

if you mean that the definition of the underlying tables, from which you had views doing "select *" then the command you want to issue is sp_refreshview and I can help you automate that.  But before we do that, do you mean that or do you want to refresh the data in views?

Because data isn't stored in views (unless it's indexed but we won't get into that).  A view is like a saved SQL statement.  It allows you to repeat large, possibly complex SQL statements as a simple select.

So if you had:
select * from Table1 t1 join table2 t2 on t1.id=t2.id

you could write this
create view vw_MyView
as
select * from Table1 t1 join table2 t2 on t1.id=t2.id
go

which would allow you to do this:

select * from vw_myView

This simplifying the SQL select statement.
0
 

Accepted Solution

by:
mark_uunix earned 0 total points
ID: 22738669
Many thanks Brandon for your reply, it was EXEC sp_refreshview command that I was looking at - at first, turns out, it was permissions issue anyway.

Mark
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22740586
How did you discover it was a permission issue and what kind of permission issue?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Let’s face it: one of the reasons your organization chose a SaaS solution (whether Microsoft Dynamics 365, Netsuite or SAP) is that it is subscription-based. The upkeep is done. Or so you think.
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

705 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