SQL Server Object Search

by jfisch 3. December 2009 09:47

I had a request today for some code to search a SQL Server for an object throughout all of the database.  I thought I'd post the code I came up with just for future purposes and in case anyone is looking for something of the like:

DECLARE @ObjectName sysname, @SQL nvarchar(max)

SELECT @ObjectName = 'ImportBugs', @SQL = ''

) - 10)

PRINT @SQL

 

EXEC sp_executesql @SQL, N'@ObjectName sysname', @ObjectName = @ObjectName

Enjoy!

Jeff

Tags: , , , ,

T-SQL

Comments

2/22/2012 3:41:00 AM #

Rosenda Alu

I need to express my appreciation to the author for helping me out of this issue. As a result of examining through the world-wide-web and also finding proposals which were not effective, I used to be considering playing was above. Being alive minus the ways of the down sides you've got.

Rosenda Alu United States

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen