Here is another way of encrypting and decrypting the data using SYMMETRIC keys. This is more secure when compared to the encryptbypassphrase and decryptbytpassphrase methods. Here we can even select different encyption schmes like TRIPLE_DES, AES_128, AES_264 etc. Continue reading »
Data can be encrypted and stored in SQL server using different encryption algorightms and in different ways. Encryption is useful and highly recommended when information like SSN or credit card number is stored in database.
Here is a simple method of encrypting and storing text in a table. Continue reading »
Yesterday, I saw a post on asp.net forums about dynamic queries to handle where clause with a list of values. I’m not a fan of dynamic queries and would love to avoid it at any cost. So I started to see if there is a way around it. How about converting that list it to some temporary table or something and use it in JOIN. Finally came up with a table valued function which returns a table with values in the list as rows. We can use a INNER JOIN now instead of creating a dynamic “where coulumnname IN” query. Continue reading »
I wrote a small stored procedure to copy / promote stored procedures from one database to another on the same SQL Server. This is particularly useful when you have to promote stored procedures from TEST to production etc. Continue reading »
After joining asp.net, one of the common questions I usually come across in forums is, How to copy a table within same database or to a different database. This can be done in many different ways. I’ll list few ways that I know of. All scenarios are explained with an example. Continue reading »



