|
|
Browse by Tags
All Tags » Databases & SQL
-
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 ...
-
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 ...
-
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 ...
-
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 ...
-
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
-
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 ...
-
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 ...
-
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 ...
-
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
|
|
|