开发者

What should i know about switching from sqlite to SQL Server

Currently i have no way to test my co开发者_如何转开发de with SQL Server. I know nothing about it and have been using SQLite. What should i know while switching? My app is programmed in C# .NET


To get you started, here are some important things when switching to a enterprise grade networked DB -- from a global-lock embedded in-process db:

  • You need to know about connections failing when doing networked programming, and how to handle such exceptions elegantly.

  • You need to know about connection pooling.

  • you need to know about transactions, since there is no global lock in a enterprise grade enterprise system.

  • You need to know about isolation levels which depend on the type of guarantees a database can give you.

  • You need to learn about SQL extensions -- such as those made by the T-SQL language. These extensions allow you to program complex logic easily.


Why do you say there is "no way" to test your code? If you don't have a server available, you can still use the SQL Server Express Edition free of charge for testing.

http://www.microsoft.com/express/sql/default.aspx

This is assuming your database file isn't larger than 4GB (edit: corrected from 1GB).

SQL Server supports a larger subset of SQL-92 than SQLlite, along with its own language extensions that make up T-SQL, but otherwise I think you'll find it a relatively painless transition.


Go to the Erland Sommarskog's site and read everything.

Another vote for SQL Express as well.


Some of they key differences you might encounter depending on which aspect of sqlite you have been suing.

  • SQL Server columns are normally strongly typed. You can not put text data into numeric columns as with Sqlite.
  • SQL Server has support for stored procedures.
  • SQL Server allows you grant permissions to individual objects that allow you to block certain types of access to data or routines by user identity. Sqlite has no concept of permissions.


One logic difference is in tsql primary keys do not auto increase by default. (i may report other difference here)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜