Solved

Refresh multiple views

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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
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…

697 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