Tag Archives: Databases

How To Flush PRINT Buffer in T-SQL, Or Output Messages In Real Time

When debugging SQL scripts, oftentimes the developer or DBA would want to see what is happening as the script executes. While it is possible to set up breakpoints in SSMS and step-into/-over code, sometimes all that one wants is to … Read More »»»

Posted in MSSQL | Tagged , , , , , , , , , , | Leave a comment

Find a String Value in the Whole Database: Searching for Text in Tables and Columns

Once in a while you may come across a problem when you are not familiar with the database structure you are dealing with. You may have to deal with the front end only and values that are only presented to … Read More »»»

Posted in MSSQL | Tagged , , , , , , , , , , , , , | Leave a comment

How to Calculate the Number of Seconds Since Last Epoch (1/1/1970) in T-SQL

In certain situations, you may need to calculate the number of seconds that have passed since the start of the epoch. In computer world, the start of the epoch most often refers to the Unix epoch, also known as Unix … Read More »»»

Posted in Quick Tips | Tagged , , , , , , , , , , | Leave a comment

Avoiding Deadlock Transaction Errors by Using ROWLOCK Hint in T-SQL

When updating a single row data in a table, it may take a nasty while if the table is big and you have a condition in a WHERE clause on a column that is not indexed. In this case SQL … Read More »»»

Posted in MSSQL | Tagged , , , , , , , , , , , , | 1 Comment

How to Use NOLOCK and ISOLATION LEVEL to Optimize T-SQL Query Performace

In this article, we will discuss how a NOLOCK hint can help improve performance of queries. Suppose you have a table: CREATE TABLE Users ( UserId INT PRIMARY KEY IDENTITY(1, 1) NOT NULL, FirstName NVARCHAR(50) NOT NULL, LastName NVARCHAR(50) NOT … Read More »»»

Posted in MSSQL | Tagged , , , , , , , , , , , , | 1 Comment

Saving Bulk Modified or Deleted SQL Database Data for Recovery

Sometimes you need to modify or remove data in bulk in a SQL database. Whatever the reason is, it is always a good practice to store such changes so that if something goes wrong you would be able to restore … Read More »»»

Posted in MSSQL | Tagged , , , , , , , , , | Leave a comment

How to Insert Multiple Rows at Once in T-SQL

Sometimes you want a statement that will insert multiple rows in a table all at once. It’s easy to do with MySQL, but here comes T-SQL – how do I do this? There are a number of ways to do … Read More »»»

Posted in MSSQL | Tagged , , , , , | Leave a comment

How to Deserialize Objects That Are Stored in a Database as XML

You can serialize objects and store them in a database using the .NET framework. How do you get them back, then? – It is a rather straight-forward code. I’m going to utilize the same example classes I used in the … Read More »»»

Posted in C# | Tagged , , , , , , , , , | Leave a comment

How to Persist (Store) Objects in a Database Using Serialization in .NET

Once in a while, you need to persists your objects, that is store them for later use, be it for use across multiple applications or a single application. .NET provides a serialization mechanism for achieving this. So, let’s start off … Read More »»»

Posted in C# | Tagged , , , , , , , , , , | 1 Comment

“Error while storing the user information” When Creating a User in MySQL Administrator

When trying to create a new user or change permissions in MySQL Administrator, you may get the following error: ‘Error while storing the user information. The user might have been deleted. Please refresh the user list.’ The solution to this … Read More »»»

Posted in MySQL | Tagged , , , , , | 2 Comments