Tag Archives: sql

Exemple of SQL Server Cursor

Scenario

In my T-SQL code I always use set based operations.  I have been told these types of operations are what SQL Server is designed to process and it should be quicker than serial processing.  I know cursors exist but I am not sure how to use them.  Can you provide some cursor examples?  Continue reading Exemple of SQL Server Cursor

#Sql Server interview question: What is a ROLLUP Clause?

The ROLLUP clause is used to do aggregate operations on multiple levels in hierarchy. Continue reading #Sql Server interview question: What is a ROLLUP Clause?

#SqlServer interview question: What is ROW_NUMBER()?

ROW_NUMBER() returns a column as an expression that contains the row’s number within the result set. This is only a number used in the context of the result set; if the result changes, the ROW_NUMBER() will change.

Thanks for reading this article,

Next steps :

  1. Share this with your colleagues because Sharing  is Learning
  2. Comment below if you need any assistance

Powered by CodeReview – Let’s make it Better!

#SqlServer interview question: What is Change Data Capture (CDC) in SQL Server 2008?

Another innovative feature in SQL Server 2008 is Change Data Capture (abbreviated as CDC). The concept is similar to Change Tracking but with a major difference.

CDC tracks every field in your table(s) – not just the primary key fields. Change Data Capture (CDC) records INSERTs, UPDATEs, and DELETEs applied to SQL Server tables and makes a record available of what changed, where, and when. Continue reading #SqlServer interview question: What is Change Data Capture (CDC) in SQL Server 2008?

SQL Server Management Studio scripting on TSQL commands

Scenario

With SQL Server Management Studio you have the ability to do just about everything you can do using T-SQL commands.  One problem with using the GUI is that it is difficult to remember everything you clicked on to reproduce the behavior a second time.  Another issue is that most of what you do through the GUI is done immediately which may not always be the best scenario.  How can I capture what SQL Server is doing so I can reproduce the behavior or run the commands at a later time.

Solution

A nice addition to SQL Server Management Studio is the ability to script out most of the commands and operations that you can do through the GUI.  Let’s take a look at doing a database backup as an example.  Continue reading SQL Server Management Studio scripting on TSQL commands