开发者

Auto detect DB instances

A client of mine has a software and has many instances of it (one per project). They all share the same SQL server. But there's one DB catalog for each instance. Is it possible, in T-SQL, to auto-detect the catalogs of a SQL server? Or maybe I开发者_如何学Python can send the catalog name in a parameter to the stored proc? I didn't figure out how to do this. It causes an error in the query.

SELECT * FROM @CatalogDotTableName

Do you have any clue?

Thanks!


How about

SELECT name
FROM sys.databases


Seek in registry: HKLM "SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜