20 April 2014

SQL Server Max Datetime

SQL Server Max Datetime

9999-12-31 23:59:59.997


Return SQL Server Min DateTime

Return SQL Server Min DateTime

Example
select cast('1753-1-1' as datetime)

or

select cast(-53690 as datetime)


Symmetric Key vs Asymmetric Key Cryptography in SQL Server

Symmetric Key vs Asymmetric Key Cryptography in SQL Server

Symmetric Key – In Symmetric cryptography system, the sender and the receiver of a message share a single, common key that is used to encrypt and decrypt the message. This is relatively easy to implement, and both the sender and the receiver can encrypt or decrypt the messages.

Asymmetric Key – Asymmetric cryptography, also known as Public-key cryptography, is a system in which the sender and the receiver of a message have a pair of cryptographic keys – a public key and a private key – to encrypt and decrypt the message. This is a relatively complex system where the sender can use his key to encrypt the message but he cannot decrypt it. The receiver, on the other hand, can use his key to decrypt the message but he cannot encrypt it. This intricacy has turned it into a resource-intensive process.

Examples in the below link
http://blog.sqlauthority.com/2009/04/28/sql-server-introduction-to-sql-server-encryption-and-symmetric-key-encryption-tutorial-with-script/

MSDN
http://technet.microsoft.com/en-us/library/ms188357.aspx

http://technet.microsoft.com/en-us/library/ms174430.aspx


COALESCE Ignore Parameter if it is null in SQL Server Queries or Stored Procedure

COALESCE Ignore Parameter if it is null in SQL Server Queries or Stored Procedure

Example :
SELECT Employee, City, DateHired
FROM Employees
WHERE Employee = COALESCE(@Employee, Employee)

If @Employee is null, it displays all the Employee details and if it is not null, it filters and displays the record.


Consistency level in Azure cosmos db

 Consistency level in Azure cosmos db Azure Cosmos DB offers five well-defined consistency levels to provide developers with the flexibility...