Could I get the default data path of a SQL Server if under following condition:
1) I have only known the SQL Server Name in my network.
2) I am using a workstation computer that connects to a SQL Server through network.
3) I can use store procedure.
The result I wanted is the default data path of a SQL Server like:
"[SQL Server Installed path]\MSSQL\Data", ie. most common case "C:\Program Files\Microsoft SQL Server\MSSQL\Data"
Does any method or store procedure could do the above case?I forget to state the following point:
1) I also need to handle the case if a SQL Server in network has multiple instances.
2) I use a SQL Server 2000.|||Hi,
One easy method is,
SELECT * FROM master..sysdatabases WHERE name LIKE '<database name>'
You can also find information @. http://support.microsoft.com/default.aspx?scid=kb;en-us;Q272705&SD=MSKB&
Thanks
Yogish
Originally posted by king
Could I get the default data path of a SQL Server if under following condition:
1) I have only known the SQL Server Name in my network.
2) I am using a workstation computer that connects to a SQL Server through network.
3) I can use store procedure.
The result I wanted is the default data path of a SQL Server like:
"[SQL Server Installed path]\MSSQL\Data", ie. most common case "C:\Program Files\Microsoft SQL Server\MSSQL\Data"
Does any method or store procedure could do the above case?|||by Alexander Chigrik
USE master
GO
DECLARE @.install_path NVARCHAR(260)
EXEC sp_MSgettools_path @.install_path OUTPUT
SELECT @.install_path
GO
... its an undocumented XP available.
No comments:
Post a Comment