Introduction SQL Server 2016 is yet to be released, but you can download the CTP versions. The mostly anticipated and marveled feature is Always Encrypted. Let me discuss few bits of this feature before getting into the technical side of it. I got to know this right after reading an article about Microsoft had applied … Continue reading SQL Server 2016 Always Encrypted
Recently I’ve been working on a project which requires plenty of stored procedures and custom logging. For error handling I don’t want to repeat my logging TSQL statements for each and every SP I write. I created a code snippet and let the IDE code for me. Follow these simple steps to create code snippets … Continue reading How to create code snippets in SQL Server Management Studio (SSMS)
Yesterday my SharePoint environment didn’t respond I checked the DB server and got to know few SharePoint databases were in suspect mode. Now I want to make the databases up and running as usual in order to get my work done. This is a SQL Server thing. There could be several reasons for a database … Continue reading Recovering a SQL Server database from Suspect Mode
Sometimes you might get the above error message from SQL Server when you try to change the user mode from MULTI to SINGLE. You have to explicitly kill the connection in order to solve the problem. First you need the dbid of your database. Run the following command. 1: SELECT name, database_id 2: FROM sys.databases … Continue reading The database is in single-user mode, and a user is currently connected to it.
Hierarchy data type is introduced in SQL Server 2008. It is a CLR data type. This post gives a simple step by step guide to implement HierarchyID data type Hierarchical navigation or simply the navigation between nodes could happen in 2 ways. Depth First Breadth First Having said that, we’ll start the tutorial. Create a … Continue reading Hierarchy in TSQL – step by step guide
This article describes about the inheritance in the relational database and how we can handle that in the Entity Framework. First let me discuss about the database inheritance. I searched the Internet and found there are databases which support inheritance natively. PostgreSQL has this feature, something similar to this. INHERITS FROM (tablename[, othertable...]) Then … Continue reading Inheritance in relational database
JOIN is one of the common task we perform against databases. This post explains it using TSQL. INNER JOIN In a simple JOIN condition we normally do not specify the word INNER, so when we write just JOIN it means an INNER JOIN. INNER JOIN returns only the matching the rows of the tables. The … Continue reading Let’s JOIN
When you design tables you need a column to be updated automatically with a sequence number, ultimately which you may use as a Primary key of the table. (Some we use other columns as primary key) But in case if you haven’t included a sequence column how you can include one. Take a look, Create … Continue reading Sequence Column and IDENTITY