Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
Your profile
Tag cloud
.net asp.net asp.net mvc azure book bug business intelligence c# cloud computing database excel functions gemini google gotcha how to howto iis indexing interview jquery kanban linq madison measurement mvc nhibernate nunit performance programming rhino mocks security silverlight sql sql friday sql server sql server 2000 sql server 2005 sql server 2008 sql server 2008 r2 sqlserver structuremap t-sql tip trick unit testing vb.net vista visual studio 2010 windows 7
Authors
- SQLDenis (269)

- chrissie1 (200)

- onpnt (96)

- George Mastros (35)

- Alex Ullrich (24)

- tarwn (17)

- naomi (9)

- thatrickguy (8)

- damber (7)

- emtucifor (7)

- ca8msm (7)

- chopstik (6)

- More...
Main Categories
Search
Google Ads
Tags: trick
This was asked on twitter the other day and I emailed the person the solution to this. The solution uses dynamic management views and it is not perfect because of a couple of reasons.
1) The dynamic management views don't keep this information forever, restart the server and your data is gone
2) If your table name is in a comment it will be picked up by this query
3) If the table name is part of another object it will also be picked up, for example if you have a table name customer and a view name customers then it will return a row if customers was part of the query but y...
This will not work on SQL Server 2000 since the sp_refreshsqlmodule does not exists on that version!
A while back in the What is deferred name resolution and why do you need to care? blogpost I showed you that sp_depens is not reliable because you can create procedures that reference objects that have not been created yet.
You can use sp_refreshsqlmodule to help 'fix' that
let's take a look at how that works
First create this awesome stored procedur...
Take a look at this code
String or binary data would be truncated. How can I suppress that message?
This is a frequent enough question on various forums, i answered this one also today and decided to create a quick blog post about this.
Run this code
sp_refreshview or how to make sure that the view will have the underlying table changes
Got a question about this on our Microsoft SQL Server Programming Forum so you know it is time for a quick blog post.
Did you know that when you create a view and then later change the table the view is not updated?
let me show you what I mean.
Run the following block of code
:: Next >>


LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.