On Feb 7, 12:18 pm, "David Portas"
<REMOVE_BEFORE_REPLYING_dpor...@acm.org> wrote:
> <chayan...@gmail.com> wrote in message
>
[quoted text clipped - 24 lines]
> --
> David Portas
Dear David,
Thanks for your reply. The system tables you have mentioned will help
me to determine the physical files associated with a database. But i
need to do the reverse task. I need to determine the logical database
name from a physical file name. Can you help me with this?
Also, is there any way to directly backup .mdf files without knowing
the database name?
Thanks
Iftekhar
Ben Nevarez - 07 Feb 2008 07:28 GMT
Hi Iftekhar,
As David mentioned, a backup of the files of an online database is not a
valid backup.
Use the T-SQL BACKUP command instead.
Hope this helps,
Ben Nevarez
> On Feb 7, 12:18 pm, "David Portas"
> <REMOVE_BEFORE_REPLYING_dpor...@acm.org> wrote:
[quoted text clipped - 39 lines]
> Thanks
> Iftekhar
Uri Dimant - 07 Feb 2008 07:50 GMT
Hi
> I need to determine the logical database
> name from a physical file name. Can you help me with this?
It can be a problem. I have seen ( only one time) when the person rename the
physical file name and it was not associated with the name of database
> On Feb 7, 12:18 pm, "David Portas"
> <REMOVE_BEFORE_REPLYING_dpor...@acm.org> wrote:
[quoted text clipped - 40 lines]
> Thanks
> Iftekhar
David Portas - 07 Feb 2008 19:30 GMT
> Dear David,
>
[quoted text clipped - 5 lines]
> Also, is there any way to directly backup .mdf files without knowing
> the database name?
That doesn't make much sense to me. You should be backing up DATABASES not
FILES. Why would you want to backup a file without knowing what database it
belonged to?
Find the database name here:
SELECT
DB_NAME(database_id) database_name,
physical_name
FROM master.sys.master_files;
Now use BACKUP to backup the database. Don't attempt to backup the file. If
you don't understand the difference then please study the topics on Backup
and Restore in Books Online.

Signature
David Portas
chayancse@gmail.com - 17 Mar 2008 07:12 GMT
On Feb 8, 1:30 am, "David Portas"
<REMOVE_BEFORE_REPLYING_dpor...@acm.org> wrote:
> <chayan...@gmail.com> wrote in message
>
[quoted text clipped - 27 lines]
> --
> David Portas
Thanks David. My task has been done. It's really unusual to backup
files instead of database. But I am developing a file backup system.
That will backup all normal files. If any of them are database files,
still they must be backed up.
Anyway, it's your post that actually helped me. So thanks a lot.
Thanks
Iftekhar