How to get the query running under a process in SQL Server

SQL Server Queries, Running under a process

Some time it requires to know what actually the SQL Server is executing under a process. So that we can know where exactly the procedure/query is stuck right now. Which helps us to know whether we can kill the running process or not. By making use of the inputbuffer it gives only the procedure (with parameteres) currently executed by the process, in the case of a procedure. Below query gives you the excat query executed by SQL Server.


ASP.Net - Uploading Multiple Files Like Gmail / Orkut

C#/Asp.Net - Uploading multiple files like Gmail/Orkut

There are several ways of supporting multiple file upload in asp.net based on the requirements. Below are few ways that we can do coding to support multiple file uploads in asp.net:

1. If we fix number of files to be uploaded, we can place that many FileUpload control while designing the page.

2. But if we dont know how many files user will select like Gmail/Orkut, we can achieve this with JavaScript by creating controls on fly on the page and iterating through the HttpFileCollection class in asp.net/c#.

So lets see the complete code. Screenshots of the code:


T-SQL Check if String contains unicode character(s)

T-SQL - Checking for Unicode characters

Here is a code in T-SQL which will check if a string contains UNICODE characters:

Lets create a table variable:


declare @temp table (Name varchar(100), Address1 nvarchar(200))


Now we will insert two records, one of which contains ascii and one non-ascii character.



T-SQL Password Encryption / Decryption Using Password Phrase

T-SQL - Password Encryption/Decryption

Here is a sample code which will show how to encrypt/decrypt password using password phrase in T-SQL:

We will hard code password phrase and and original password then we will encrypt the password and store it in a variable.

Declare variables:


@passPhrase NVARCHAR(50),
@encryptedPass VARBINARY(MAX),
@decryptedPass NVARCHAR(50);




Posts By Month