RSS Feed

Confirming Objects Modified


November 15, 2011 by Mike Hillwig

I work in a hosting environment, and frequently our clients will ask us to promote a stored procedure (or some other schema object) through the DEV, TEST, Production environments. We have one client that is really big on seeing some type of evidence that we did what we say we did.

I wrote this little nugget that generates enough confirmation for the client’s relationship manager to demonstrate that we did indeed move their code. And it seems to make the client happy.
[SQL]set nocount on

DECLARE @num_objects INT
DECLARE @object_type VARCHAR(3)

SELECT @dbname = ‘userdatabasename’ — Use the database where the objects were moved
SELECT @num_objects = 1 — Use the number of objects moved.
SELECT @object_type = ‘P’ — Use P for procedures, F for functions, U for tables, V for views, etc.


select @@servername

SELECT @sql = ‘select top ‘ + cast(@num_objects as varchar) + 
‘ left(name,30) as object, object_id, modify_date from ‘ + @dbname +
‘.sys.objects where type = ”’ + @object_type + ”’

order by modify_date desc'

EXEC (@sql)


  1. Khamar says:

    Hi,I agree this is not something fancy, but, I’ll also quote mylesf I’m going to explain a non often used SQL that came in hand recently . The thing is, that this can help you with let’s say complex menu table (that for example contains n-level menu). Then you avoid the need to pull the menu with more than 1 query.And one more thing This article was intended for beginner to intermediate level of knowledge a simple example And thanks for opinions!

  2. By Paul Riddle May 31, 2012 – 6:06 amHi, I am enquiring about sheet music for one of your pieces. A student of mine is wishing to perform ‘Big City’, is there any possibility of purchasing band charts for ‘Big City’?Cheers,Paul Riddle

  3. Pauta na corrupção e na justiça (ou injustiça)que atualmente assola o país, graças ao PT e ao FHC (que já está na hora de ir embora da vida pública, para todo sempre).

  4. I'm a fan of bags of playground sand or premixed concrete in the trunk, myself. And if I were up the the Great White North and had an over-torqued RWD roadster (but wait– you've got a button for the torque), I'd look into snow cleats. Cheap, and easier to put on than chains. But I live down here in the SW Plains, and drive a little FWD car, so I don't screw with it.

  5. que lugar mas hermoso y pintoresco ya que esta nuestra madre,, mirandonos, ademas podemos disfrutar de naturaleza,bebidas tipica de chile el mote con huesillo , mas de alguna vez,, subio hasta la punta del cerro y disgusto este refresco bien heladito,,,chauuuuuuuuu.

  6. Christophe;Très jolie fable, mais tu oublies de préciser qu’il fait monter une multinationale car les petites entreprises sont, peut-être, encore plus contrôlées que les petites fourmis et ne sont pas mieux lotis.

  7. My wife and i were quite peaceful when Edward managed to finish up his investigation from your ideas he came across from your very own web pages. It is now and again perplexing just to possibly be offering thoughts which often most people could have been making money from. So we keep in mind we’ve got the writer to appreciate for this. Most of the illustrations you’ve made, the straightforward website menu, the friendships you help foster – it is most powerful, and it’s really facilitating our son in addition to our family believe that this situation is brilliant, which is certainly extremely vital. Many thanks for all the pieces!

  8. erjilopterin says:

    As soon as I observed this website I went on reddit to share some of the love with them.

  9. I would like to thnkx for the efforts you have put in writing this blog. I am hoping the same high-grade blog post from you in the upcoming as well. In fact your creative writing abilities has inspired me to get my own blog now. Really the blogging is spreading its wings quickly. Your write up is a good example of it.

  10. you are actually a just right webmaster. The site loading velocity is amazing. It kind of feels that you are doing any unique trick. Furthermore, The contents are masterpiece. you’ve done a magnificent job on this subject!

Leave a Reply

Your email address will not be published. Required fields are marked *