Welcome to Bilal Haidar [MVP, MCT] Official Blog Sign in | Join | Help

Browse by Tags

All Tags » Databases & SQL   (RSS)

SQL Server Express and Read-Only Databases

Several times, when I attach an existing database to SQL Server Express 2005, I get my database attached as read-only. So no way to add any object to it or update it! The solution is to run this line: Alter database <dbname> set read_write As example
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

StatementCompleted Event in SqlCommand

A new Event in ADO.NET 2.0 has been addeed to the SqlCommand object called the *StatementCompleted* event. Usually, if you are executing a set of UPDATE statements on your database as a batch using ExecuteNoneQuery() method, you get the number of affected
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

Handling NULL Columns when updating

Another tip from the great book by David Sceppa is how to handle null column values: Suppose you have a column in your table in the Database, and that column can have NULL values, the column is named ColA. Now you wanted to updated a record by checking

Cannot start transaction while in firehose mode

Have you ever seen this error before? It happened with me today while I opened a table on SQL Server 2000 and tried to update a cell. Cannot start transaction while in firehose mode I researched this over the web and found out this KB article: PRB: SQL
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

Red-Gate SQL Query Intellisense Tool (Free Download)

A nice tool by Red-Gate to provide a missing feature from the SQL Server Query Analyzer, which is Intellisense. Check out Scott Guthrie's post about this great tool: Red-Gate SQL Query Intellisense Tool (Free Download) You can download this tool for free
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

Difference between NULL and DBNull

I have always misunderstood the difference between NULL and DBNULL until recently while I was working on ASP.NET web application, and was talking to a Webservice and I found an exception coming from one of the web methods inside the Webservice which is

Dynamic Sql Query with Output Parameters

I had a previous post on how to use Dynamic Sql Queries. Today I had the need to create a Stored Procedure that returns an Output Parameter, where the value of the output parameter is set inside the Dynamic Query. So here is a sample Stored Procedure
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

CountryList SQL Script

I am working on a Custom DotNetNuke module. I wanted to have a DropDownList of all the countries in the world. I had to google a little bit to find all the countries available, which I beleive are 222 countries. I wanted to share with you the SQL Script

Identity Columns in MS SQL Server

When working with Identity Columns in MS SQL Server, and specially when testing your database and inserting some junk data for the sake of testing, you ask yourself, how would I reset my Identity Columns to their original values after I finish testing
Posted by BilalHaidar [MVP] | 0 Comments
Filed under: