Solved

Refresh multiple views

Posted on 2008-10-14
3
254 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

707 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