selectstarfromyogi

sql server DBA ,sql server 2008 , 2012 , 2014 ,sql

Menu
Search
Skip to content
  • Home
  • About

database name

Get the Database name with the object name in SQL Server

EXEC sp_msforeachdb
‘if exists(select 1 from [?].sys.objects where name=”usp_mystoredprocedure”)
print “?”‘

October 6, 2022yogigollapudi database name, object name, stored procedure Leave a comment

T-SQL to find out the database with the object name – SQL server

EXECUTE master.sys.sp_MSforeachdb ‘USE [?];select “?” as databasename; select * from sys.objects where name like “startup” ‘

August 27, 2015yogigollapudi database name, object name Leave a comment

Categories

  • DEVOps (1)
  • Errors (9)
  • FUN (1)
  • Performance Tuning (11)
  • powershell (12)
  • T-SQL (43)
  • Uncategorized (154)

Blog Stats

  • 39,566 hits
Follow selectstarfromyogi on WordPress.com
Blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • selectstarfromyogi
    • Already have a WordPress.com account? Log in now.
    • selectstarfromyogi
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
Design a site like this with WordPress.com
Get started