SQL 2005 Express - AttachDBFileName

  • Came across something I had never seen before today. Vendor was installing their system and turns out when their app connects to the local SQL 2005 Express install the connection string specifies "AttachDBFileName" which attaches the DB at connection time. Of course the DB is not visible in the database list nor is it accessible via "normal" administrative tools.

    Now this is not a HUGE deal for us as we are simply going to move the thing to a "grown up" version of SQL 2K5 anyways, but I am curious....... why would you do this anyways? You have a local install of SQL Server which has to be running. Why not jut attach the DB the normal way and interact with it as you would with any other SQL Server.

    I just do not see any benefit of doing it this way.

    Input/Thoughts?

  • for desktop application it is a direct way to use database file name in the connection string , and disconnected when application closed.

    you need not to write script for attach or use SSMS to attach

    only for simplicity (for non DBA) 🙂

  • Understood, but talk about trying to reinvent the wheel!

    Any administration of the DB must be done by a means other than normal SQL Server processes, which likely means the developer of the app in question needs to code it into the app. Why make the app do database backups/maintenance when your already installed SQL instance can do it with ease.

    And another thing................ as a DBA, if I come across an SQL install and when I connect to it I see no user databases, I am likely to disable the services at a minimum and likely uninstall SQL having identified it as a rogue instance.

    Granted, this is the DBA thought process, but I see NO advantage to utilizing a database in this manner.

    Paul

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply