Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

windows system directory

Status
Not open for further replies.

Saama5

Programmer
Jan 6, 2002
52
0
0
US
Is there any default function thru which I can see windows system directory?
Actually I know that to execute system stored procedure it should be present either in MSsql folder or in windows system folder.
While I run sql scripts from dos prompt I tell the path to copy system stored procedure into windows system folder. But sometimes windows system folder is not in C drive it could be on any drive.
Can anybody highlight on this problem?
 
System stored procedures are stored in the master database. It isn't necessary to know the Windows directory to execute SPs. Nor is it necessary to copy the procedures to a file.

Perhaps, I've missed the point of your question. Can provide more explanation? Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Oh Sorry! I mean to say it is user defined extended stored procedure which I have to copy in system folder. When I declare add extended stored procedure thru sql script, I have to give path for dll.
 
Hi McDonald,
This may not be the correct way of doing it. But you can try it. This is for extracting the default SQL directory for SQL Server...not Windows default Directory..

If we believe that wherever the data and log files are stored for MASTER database in SQL Server as DEFAULT PATH for databases, then you can use this.

SYSDATABASES has filenames, database names etc..

--gives the database name,data filename for all databases
select name,filename from sysdatabases

--database name, filepath for master database
select name,filename from sysdatabases where name='master'
--gives the path of SQL DATA directory
--you can do some other manipulations if required
select replace(filename,'MASTER.MDF','') from sysdatabases where name='master'

But I am not sure whether is correct to extract the DEFAULT PATH from sysdatabases.

Need to look more in BOL...

Hope this helps.

Sreenivas
avnsr@hotmail.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top