Skip to main content

Simulate Table Lock situation using a Select statement - SQL Server 2005

Today I wanted simulate a table lock situation in my database using a select statement. It was bit hard for me to do it. I was searching it in web, but couldn't find useful thing. May be I didn't do it in right way. ;)

Anyway I could do it. This is how I did it.

You can write your SQL statement with (TABLOCKX) at the end of SQL statement.

ex: Select * From table_name (TABLOCKX)

I assume you all know how to do the rest of it.

Comments

Popular posts from this blog

Common Design Principles

There are number of common design principles that, like design patterns, best practice over the years to build maintainable software. I'm up to describe some widely used design principles though out the post. Following common principle are extracted by the same book that I mentioned before ( Professional ASP.Net Design Patterns - Scott Millet ). Principles are as follows: Keep It Simple Stupid (KISS) One common issue in software programming is over-complicating a solution. So main concern of this principle is keep the code simple but not simplistic. Eventually this will avoid unnecessary complexities. Don't Repeat yourself (DRY) Main concern of this principle is to avoid the repetition. In other words this is all about abstracting out the common functionalities into a single place. Ex: If there is a price calculation method in a system. It should lay in a single place there. Tell Don't Ask The Tell, Don’t Ask principle is closely aligned with encapsulation and the assignin...

Step by step guide to fix Angular app refresh issue in IIS

If you deploy your Angular app in IIS, routing will be handled from the client. So when you refresh a page it will give you 404 error. To get ride of the above-mentioned situation we have to follow the steps as follows: Before deploying anything on IIS, you have to install the URL Rewriting module on the IIS server. Please refer the link. After the installation, you should be seeing the following icon. If you are above to deploy an Angular app when is developed with ASP.Net Core. That deployment steps are explained in my previous blog post . That blog spot explains one issue I came across when I was deploying Angular 7 App with ASP.Net Core in IIS. So now we are done with IIS side installation next, we have to check the deployment files. You have to make sure that web.config file. web.config should contain the followings: <?xml version=”1.0" encoding=”UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> ...

How to configure SQL Server Session State with Custom Database

There are two steps got to follow to enable the SQL Server Session state to work 1. Configuring the database to support the SQL Server Session state. 2. Configuring your application to use SQL Server Session state. 1. Configuring the database to support the SQL Server Session state. .Net framework has a tool aspnet_regsql which you can use to add the table and stored procedure to support SQL Server Session state. You can find this tool in the following folder. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ aspnet_regsql.exe You can run this exe from window command prompt or you can directly run from SDK Command prompt. Executing the following command enables SQL Server Session state for a database server named local and store it in a custom database called CustomSessionDB. aspnet_regsql -C "Data Source=local;User Id=sa; Password=Sql2005" -ssadd -sstype c -d CustomSessionDB Executing this command creates a new database named CustomSessionDB that contains bot...