What is the native system stored procedure to issue a command against all databases?

Technology CommunityCategory: T-SQLWhat is the native system stored procedure to issue a command against all databases?
VietMX Staff asked 3 years ago
  • The sp\_MSforeachdb system stored procedure accepts the @Command parameter which can be issued against all databases.  The ‘?’ is used as a placeholder for the database name to issue the same command.
  • The alternative is to use a cursor to process specific commands against each database.