Simple Object and String Search within Objects

  • Comments posted to this topic are about the item Simple Object and String Search within Objects

    Thanks & Regards, Kartik M Kumar..

  • This is fantastic. Thank You

    I often search for things, but change the DB manually.

    I often search for column names as well, so took the liberty in adding the below in your coding format to search for column names as well.

    Set @Command = ''

    Set @command = N'Insert into ##t001 Select ''[?]'' DataBaseName, o.name+'' - ''+c.name Object_name,''Column'' ObjectType, ''''

    from [?].sys.objects o Join [?].sys.columns c On c.object_id = o.object_id where c.name like ''%'+@SearchText+'%'''

    Execute sp_MSforeachdb @command, N'?'

  • Nice script. I will have a use for this. Thanks.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply