473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

SQL Files Query

dsv
Hey all,

My intention was this: Find the stored procedure that will give you:
· database name
· database file location
· log file location
· backup file location

With a little digging around it seems that this is not as simple a task
as I originally thought.
The obvious problems start to rear up when you look at sp_helpdb
'dbname' as although I only have one database file and log file per
database, this is by no means the limitation of sql server.

Then it gets a little stickier with the maintenance plans, I've no
prior experience querying the info from them and nosing around the
books online has left me a little more confused than I started on this
one.

So my question is this: any advice? Should I can this project and
collect the data by hand? Is there a stored procedure that I have
completely overlooked that is just the business? Is it in fact a lot
easier than I thought and I need only...?

Comments appreciated.

Thank you,
Don

Jul 23 '05 #1
2 1044
Don,

If you are going to need to collect the information more than a couple of
times, then I recommend writing a script or stored proc. Here are a few
hints and tricks to help you.

Using supported techniques is better than direct system table access.
Unfortunately, not every piece of data is available via supported methods.
Use the information schema views where available.
Call stored procedures and/or DBCC statements and insert the results into
temp tables. This has its limitations but can be a good source to get
supported data.
It's not bad to use a cursor in a system maintenance routine. Use them if
you need them.
When all else fails read the system tables directly.

Good luck,
Danny
<ds*@lutonsfc.ac.uk> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hey all,

My intention was this: Find the stored procedure that will give you:
· database name
· database file location
· log file location
· backup file location

With a little digging around it seems that this is not as simple a task
as I originally thought.
The obvious problems start to rear up when you look at sp_helpdb
'dbname' as although I only have one database file and log file per
database, this is by no means the limitation of sql server.

Then it gets a little stickier with the maintenance plans, I've no
prior experience querying the info from them and nosing around the
books online has left me a little more confused than I started on this
one.

So my question is this: any advice? Should I can this project and
collect the data by hand? Is there a stored procedure that I have
completely overlooked that is just the business? Is it in fact a lot
easier than I thought and I need only...?

Comments appreciated.

Thank you,
Don
Jul 23 '05 #2
Hey Danny,

Thank you for your pointers, should I succeed in my quest, I'll be sure
to post the code here.

Thanks again,
Don

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andrew James | last post by:
Gentlemen, I'm currently in the process of designing a language which will be used to specify sets of files on a WebDAV server, encoded in a URL. The aims of the language are to (in no particular...
5
by: Raj | last post by:
Hi all, Can anyone help me with a script which would delete files or move them to a different folder at some scheduled time..! Please.....!!! Thanks in advance...
0
by: Chris Powell | last post by:
I am using Excel/Access 2000 and have two large Excel files (25,000 rows each) that I wish to create linked tables in Access rather than importing into Access. The two source Excel files change...
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
5
by: JimmyKoolPantz | last post by:
Situation: I am writing a program that opens up a data file (file ext .dbf), imports the information into a dataset. The program also, searches through the dataset for key words ("company...
1
by: fatjoez | last post by:
Hey there. I've been trying to modify my file upload script so that it handles 10 files instead of one. i was thinking the most straightforward way would be to add a FOR LOOP? placed...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
6
by: Jankie | last post by:
Hi all ! I hope someone help me with problem that I assume common,yet googling didnt even mention it. In brief: User uploads multiple files at one go. It is one submission of multiple files,so I...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
2
by: dmorand | last post by:
I have a database table that contains some file names and there come times when I have to copy these files to another location to have them be re-processed by a windows service. Is there a query I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.