Wednesday, 27 March 2013

SQL Server : Finding DB objects


@name varchar(120),
@type varchar(5)
as
begin
declare @Sql varchar(500)
set @Sql = 'select * from sysobjects where name like ''%' + @name +'%'' and type = '''+@type+''' order by name'
print @sql
Exec (@sql)

No comments:

Post a Comment