Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
295 views
in Technique[技术] by (71.8m points)

confusion about SQL Server Express and localdb

I need to deploy a WCF service with a database on client machines. I am confused about SQL Server Express. I need to verify all of the following.

When attaching database files in the App_Data folder, do I still need to install SQL Server Express engine (Windows service) on client machines?

There is a flavor called SQL Server Express LocalDb. That one does not need an engine (Windows service)? But I think it need a prerequisite installation of LocalDb.

Localdb is introduced with SQL Server 2012. There is NO localdb for SQL Server 2008. Correct? I could not find 2008 version on MS site.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Do I still need to install SQL Server Express engine (A win Service) on client machines?

Yes, they need it installed for your application to query the database. Can't really get around it.

There is a flavor called SQL Express localDb. That one does not need an engine (win service)? but I think it need a perquisite installation of localdb.

Yes, you'd still need to install LocalDB on the client machine. It's pretty hassle-free to do, but I think it's overkill unless you really need the full features of a SQL Server instance for your webservice.

Instead of LocalDB I'd strongly recommend using SQL Server Compact Edition - it performs the role you're thinking of (your WCF Service can simply connect directly to the database file on your client machines without installing SQL Server, and is lightweight), but doesn't need to be installed (it's simply included as a DLL with your WCF application):

Unlike other editions of Microsoft SQL Server, SQL CE runs in-process with the application which is hosting it.

In Microsoft's own words on the differences between LocalDB and SQLCE:

LocalDB and SQL Server Compact?

Small and simple database, lightweight installation, connecting to a database file -- this will sound familiar to any developer using SQL Server Compact. The similarities are not accidental, as our goal for LocalDB was to be as easy to use as SQL Server Compact (while being as powerful and compatible with full SQL Server as SQL Express).

There are significant differences between LocalDB and SQL Server Compact:

Execution mode: SQL Server Compact is an in-proc DLL, while LocalDB runs as a separate process.

SQL Server CE is kind of like an updated version of MS Access, the file goes with the application which can "just connect" to the database file without involving any database server installation, and its syntax/features are very close to SQL Server standard.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...