Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 Attached vs Detached Database

Author  Topic 

Mourad
Starting Member

6 Posts

Posted - 2007-11-11 : 04:31:54
Hello all,
I'm using SQL 2005 Express edition. I'm currently connecting to the database file directrly (from ASP.NET) and that db file is not attached to the server.
My question is this:
What is the difference ? Will the performance improve if the db is attached and I connect to it throught the server ? I'm really not sure what the difference is.
Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-11 : 04:59:10
quote:
I'm currently connecting to the database file directrly from ASP.NET)

What do you mean ? You can't and don't access to the database file (mdf, ldf) directly. You access to the database via the SQL Server which means the database file (mdf / ldf) is attached to the SQL Server.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Mourad
Starting Member

6 Posts

Posted - 2007-11-11 : 05:08:24
Sure you can. This is my connection string:
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\garments_Data.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient"

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-11 : 05:12:56
then you will not be able to access to remote database only local database file


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Mourad
Starting Member

6 Posts

Posted - 2007-11-11 : 05:15:38
That's not the issue. The webserver and SQL server are on the same machine.
My question was: what's the difference ?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-11 : 20:08:41
You can access db by file name in express, but db is online in fact. You can check that in ssms express.
Go to Top of Page
   

- Advertisement -