Recently I tried to install SQL Server 2012 in Windows Server 2012 box. Unfortunately, it was not easy to do that for me because setup generated few errors. And then it displayed that .NET Framework 3.5 SP1 Feature was not able to activate. There were few reasons to occur that problem. Windows Server 2012 was not activated. Windows Server 2012 ...
Recently I tried to install SQL Server 2012 in Windows Server 2012 box. Unfortunately, it was not easy to do that for me because setup generated few errors. And then it displayed that .NET Framework 3.5 SP1 Feature was not able to activate. There were few reasons to occur that problem. Windows Server 2012 was not activated. Windows Server 2012 ...
Recently I tried to install SQL Server 2012 in Windows Server 2012 box. Unfortunately it was not easy to do that for me because setup generated few errors. And then I it displayed that .NET Framework 3.5 SP1 Feature was not able to activate. There were few reasons to occur that problem. Windows Server 2012 was not activated. Windows Server ...
USE AdventureWorks2012 GO --Defining CTE WITH Empl AS(SELECT * FROM HumanResources.Employee) --Using CTE SELECT Empl.* FROM Empl GO Moreover, you can use several CTEs in one statement. USE AdventureWorks2012 GO --Defining CTE WITH Empl AS ( SELECT * FROM HumanResources.Employee ), Pers AS ( SELECT * FROM Person.Person ) --Using CTE SELECT Empl.*, Pers.* FROM Empl INNER JOIN Pers ON ...
USE AdventureWorks2012 GO --Defining CTE WITH Empl AS(SELECT * FROM HumanResources.Employee) --Using CTE SELECT Empl.* FROM Empl GO Moreover, you can use several CTEs in one statement. USE AdventureWorks2012 GO --Defining CTE WITH Empl AS ( SELECT * FROM HumanResources.Employee ), Pers AS ( SELECT * FROM Person.Person ) --Using CTE SELECT Empl.*, Pers.* FROM Empl INNER JOIN Pers ON ...
In Queries, we need to rank and number records. SQL Server gives you a few functions to rank your records. RANK Rank we can use to rank data in a normal way. In this ranking, if we have two 1 next to one will have rank 3. Name Marks Rank John 75 1 Mark 75 1 Steve 64 3 Gates ...
In Queries, we need to rank and number records. SQL Server gives you a few functions to rank your records. RANK Rank we can use to rank data in a normal way. In this ranking, if we have two 1 next to one will have rank 3. Name Marks Rank John 75 1 Mark 75 1 Steve 64 3 Gates ...
In Stored procedures and in our SQL Statement sometimes we need to use same query again and again. In that case you can use CTE. USE AdventureWorks2012 GO --Defining CTE WITH Empl AS ( SELECT * FROM HumanResources.Employee ) --Using CTE SELECT Empl.* FROM Empl GO And you can use several CTE’s in one statement. USE AdventureWorks2012 GO --Defining CTE ...
In Queries we need to rank and number records. SQL Server gives you few functions to rank your records. RANK Rank we can use to rank data in normal way. In this ranking if we have two 1 next one will have rank 3. Name Marks Rank John 75 1 Mark 75 1 Steve 64 3 Gates 54 4 USE ...
In this example, I create a temp table on AdventureWorks2012 Database, and first I load all the data in HumanResources.Employee to the temporary table. Then I delete data using HumanResources.Employee. This command will delete all the records in Tmp which has Gender = ‘M’ in HumanResources.Employee table. USE [AdventureWorks2012] GO --Inserting data from HumanResources.Employee and Person.Person to non existing table ...
In this example, I create a temp table on AdventureWorks2012 Database, and first I load all the data in HumanResources.Employee to the temporary table. Then I delete data using HumanResources.Employee. This command will delete all the records in Tmp which has Gender = ‘M’ in HumanResources.Employee table. USE [AdventureWorks2012] GO --Inserting data from HumanResources.Employee and Person.Person to non existing table ...
If you want to synchronize data from another table only for once, you can use this way. When you are going to update from another table don’t forget to give a condition. USE [AdventureWorks2012] GO -- Inserting data from HumanResources.Employee and Person.Person -- temporary table SELECT * INTO Tmp FROM [HumanResources].[Employee] GO --Retrieving data SELECT * FROM Tmp --Update Using ...
If you want to synchronize data from another table only for once, you can use this way. When you are going to update from another table don’t forget to give a condition. USE [AdventureWorks2012] GO -- Inserting data from HumanResources.Employee and Person.Person -- temporary table SELECT * INTO Tmp FROM [HumanResources].[Employee] GO --Retrieving data SELECT * FROM Tmp --Update Using ...
My previous blog post was about using the INSERT command in different ways. You can use SELECT INTO to add data from an existing table to a new table. In this statement, SQL Server will create a table for you. You just want to write the query and add INTO clause to the statement. Rest will be done by SQL ...
My previous blog post was about using the INSERT command in different ways. You can use SELECT INTO to add data from an existing table to a new table. In this statement, SQL Server will create a table for you. You just want to write the query and add INTO clause to the statement. Rest will be done by SQL ...
Today I wanted to paste a few statements on Live Writer which were coded on SQL Server Management Studio 2012. But when I paste the code into Live Writer I got disappointed about the look. Codes were awesome on SMSS 2012 with colours. Then I wanted to find a way to insert those code with Visual Studio formatting. I found ...
Today I wanted to paste a few statements on Live Writer which were coded on SQL Server Management Studio 2012. But when I paste the code into Live Writer I got disappointed about the look. Codes were awesome on SMSS 2012 with colours. Then I wanted to find a way to insert those code with Visual Studio formatting. I found ...
I’m still a beginner in SQL Server. I will blog about many basic things in SQL Server. Inserting is very important Data Manipulation Statement. So let’s see how to use INSERT Statement in different ways. USE tempdb GO --Creating Table CREATE TABLE tmpTable( [id] int NOT NULL, [name] varchar(100) NULL, [address] varchar(1000) NULL ) GO --Inserting Data INSERT INTO tmpTable([id],[name],[address]) ...
I’m still a beginner in SQL Server. I will blog about many basic things in SQL Server. Inserting is very important Data Manipulation Statement. So let’s see how to use INSERT Statement in different ways. USE tempdb GO --Creating Table CREATE TABLE tmpTable( [id] int NOT NULL, [name] varchar(100) NULL, [address] varchar(1000) NULL ) GO --Inserting Data INSERT INTO tmpTable([id],[name],[address]) ...
In this example I create a temp table on AdventureWorks2012 Database, and first I load all the data in HumanResources.Employee to the temp table. Then I delete data using HumanResources.Employee. This command will delete all the records in Tmp which has Gender = ‘M’ in HumanResources.Employee table. USE [AdventureWorks2012] GO --Inserting data from HumanResources.Employee and Person.Person to non existing table ...