Bilal Haidar [MVP, MCT] Official Blog

Microsoft MVP ASP/ASP.NET, MCP, MCTS, MCPD, MCT
Welcome to Bilal Haidar [MVP, MCT] Official Blog Sign in | Join | Help
in Search

Browse by Tags

All Tags » Databases & SQL
  • 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 would be: Alter database Northwind set read_write This will make sure your database is ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on May 25, 2007
  • 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 rows in the whole batch action. What if you wanted to know what each UPDATE method has ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on January 23, 2007
  • 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 if ColA is NULL in the WHERE clause to allow updating: UPDATE ..... WHERE ColA = ? The ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on December 8, 2006
  • 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 Enterprise Manager Returns ''Cannot Start Transaction While in ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on June 5, 2006
  • 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 at: Red-Gate HTH, Regards
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on May 22, 2006
  • 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 using the SqlCommand.ExecuteScalar() method. What happens when the ExecuteScalar() method is ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on March 4, 2006
  • 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 that shows how to do s:CREATE PROCEDURE GetNotificationIdByCustomerId ( @CustomerId ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on February 15, 2006
  • 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 I created. You can download this script from the Files Area. When you run this script using ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on February 10, 2006
  • 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 with the junk data? dbcc checkident (Table1, reseed, 1) Hope that helps. Regards
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on August 30, 2005
Powered by Community Server (Personal Edition), by Telligent Systems