Home » Sql

Simply executing DROP [YourDatabaseName] won’t work if previous connection are already made. You need to alter the database to set it to single user and rollback every other connection. Once dropped, you can create back your database. When creating the database, the default value is to set to multi_user so you do not have to worry about setting...
Filed in: Sql
When importing an existing project that you have not setup you may have when executing a SqlConnection this kind of error : flag is not supported. Error Message: The user instance login flag is not supported on this version of SQL Server. This can occur when the previous developer had in his connection string a reference to “User Instance“....
Filed in: Sql
Sometime, Xml can be stored in column of a table. I personally try to avoid, especially when it has XSD (Xml Schema Definition) that will be validate in the database side instead of the code side. Even more when I’ll need to get specific data into it later on in a query. Still, sometime, you have no choice because the system has been built this...
Filed in: Sql
Some time it can be useful to dump all data of a table in the format of SQL insert statement. This can be done easily with Microsoft SQL Management Studio. The first step is to right click on the database and select the option Task>Generate Script. This will popup a wizard window. Microsoft Sql Management Studio Generate scripts The last step is to...
Filed in: Sql
A connection string is a string with key value pair in it that indicate where to get the connection to the server for persistence. In Entity Framework something change from the standard and it’s the location of the CSDL, SSDL and MSL file. Here is an example of connection string that connect to a file database named “qwe”. <add...
Connection Pooling is handled by the Connection Manager to reuse available connection instead of creating a new one. This is performance wise because the system won’t create and kill connection every time a database is require. This is also very true for web application that not only a same user may call multiple time the database per page but...
Filed in: Ado.Net, Sql
Sometime logic are stored in a stored procedure and is still required to call it instead of using the normal entity framework way to update, delete or save. Fortunately, the entity framework let you change the basic behavior of the auto generated sql for those operations by Sql Stored Procedure call. An other scenario is that you may want to simply...
AdventureWorks is a free database used . You can find it for free at CodePlex.com. The installation is well documented on MSDN website but can cause you some problems in few steps that I will try to smooth for you. First of all, before anything, be sure that you have the latest version of SQL Server. At this moment the lastest version is SQL Server...
Filed in: Sql
Entityframework set lazing loading to false as a default mechanism for loading its entity data. In other words, this mean that the default value is set to eager loading or explicit loading. This behavior can be modified by the developer if a need is required by changing the Lazy Loading Enable of the conceptual model’s property or by code by changing...
Since few months I have notice that some people near of me still do their join between table in the Where clause. It works even if it has its limitations but the biggest problem come for the maintenance. Later, a big query become hard to modify because the criterion to refine the upcoming data are mixed up with joining where clauses. To solve...
Filed in: Linq, Sql
wordpress themplates