SQL Server 2012: overview of SQL Server 2012

sqlserver2012features

Microsoft’s RDBMS product for desktops and enterprise is the SQL Server and SQL Server 2012 is the version released to the market in 2012. The SQL Server 2012 evolved from the 2005 version. The SQL server code started out to be jointly owned by Microsoft and two other companies named Ashton Tate and Sybase. It was released as the desktop product on PS/2 with OS/2 environment back in 1989. By the time several upgrades were released to arrive at the sql server version 2005, Microsoft has own version of the code contributed by Ashton Tate by this time. The 2012 version evolved through 2008, 2008 R2 versions to become the SQL Server 2012.

The SQL Server 2012 grew into the SQL Server 2014 version and the latest product from Microsoft stable is the community technology preview 2016 that has just been released recently. The sql server 2012 adds two major trends to the feature list that was available with the previous 2008 R2 version.

  1. One is to make the existing RDBMS product easier to administer and to simplify development work.
  2. Equipping the products to help in ever larger data handling and analysis is the other set of goals. The SQL Server 2012 adds many such important features to the existing repertoire.

With the SQL Server 2012, Microsoft decided to support only ODBC (open database connectivity). Even the interconnectivity between MS document types supported through OLE was to be dropped. The general release of the SQL Server 2012 came in Mar, 2012 followed by release of Service pack 1 in Nov 2012 and the pack2, in Nov, 2014. The added features include a PowerView. When creating business intelligence reports, you can mash up various data sets in SQL Server 2012 through this feature. Operationally, the AlwaysOn feature adds handling of database failures easier. Multiple copies created by the system in SQL Server 2012 helps make disaster recover quite straightforward. There is even a stripped down version which is not as resources hungry as the full version of the SQL Server 2012 but can let you carry out the most important operations. Programming features enhanced in the SQL Server 2012 include a ColumnStore indexes feature. These are read-only indexes that help optimizing processing queries on large data warehouses. Testing of the SQL Server 2012 procedures and queries can be played out (tried out) on a non-production server without risking crashes affecting your production operations. Operationally, an audit trail is a very important tool for systematic management of the database operations but a security safeguard against malicious activities, if any.

By this point in the development of the SQL Server product, SQL Server 2012 has evolved into an enterprise level DBMS with the ability to handle large volume of enterprise level data, supported by the administrative, program development and security features required for efficient operations. The next upgrade to SQL Server 2012 came in 2014.

If you have any questions, please contact us at SQL Server Tutorial 2012; we are always happy to help!

 

SQL Video Tutorial: How to use UPDATE Sql statement

 

UPDATE statement is one of common DML (data manipulation language) statements. Other DML statements include:

  1. SELECT
  2. INSERT
  3. DELETE

UPDATE query is used to update or modify data in a Table or a View in a database. Using this statement, you can update a single field, multiple fields, single record or multiple records. Need to use WHERE clause to limit affected rows. Without the WHERE clause, you will update all the rows in a table! Ooops! UPDATE query can also use a sub-select aka sub query.

Syntax for UPDATE query

Basic syntax for UPDATE query is:

UPDATE Table or View
SET Column1=value, Column2=value
WHERE Condition(s)

Common wisdom to use Upper Caps for SQL Keywords
More info here:
http://msdn.microsoft.com/en-us/library/ms177523.aspx

For our UPDATE queries today, we will use Northwind (link) database in SQL Server 2012. We will do the following:

  1. Update Customers table, single and multiple fields
  2. Update Customers table, multiple rows
  3. Update Orders table, multiple rows
  4. Update one table with information from another table. Orders table with info from Customers table

Update SQL script is as follows.

You can also download the complete SQL script here:

http://sqlserver2012tutorial.com/free-videos/SQL_Tutorial_SQL_UPDATE_Statement_Final.sql
/*------------------------------------------------------------------------------------------------------------

SQL Tutorial I – SQL UPDATE Statement

These example utilizie SQL Server sample database NORTHWIND 
Also we are using SQL Server 2012

Just fyi:

Lines in green starting with -- are comments
Words in blue and purple (I guess are SQL Keywords)

------------------------------------------------------------------------------------------------------------*/

--Get the data

SELECT *
FROM CUSTOMERS

SELECT COMPANYNAME, CITY, COUNTRY, REGION
FROM CUSTOMERS
WHERE COUNTRY='USA'

--Update single column, set country to America instead of USA

UPDATE Customers
SET COUNTRY='AMERICA'
WHERE Country='USA'

--(13 row(s) affected)

SELECT COMPANYNAME, CITY, COUNTRY, REGION
FROM CUSTOMERS
WHERE COUNTRY='AMERICA'

-- 13 ROWS

--Multiple columns, country and regions fields

--UPDATE CUSTOMERS

UPDATE Customers
SET COUNTRY='AMERICA', REGION='US'
WHERE Country='AMERICA'

-- (13 row(s) affected)

 

Download SQL Video Tutorial here (Right Click – Save As):

http://sqlserver2012tutorial.com/free-videos/Youtube-sql-tutorials-by-kash-1-sql-update.wmv

or from our YouTube channel:

https://www.youtube.com/watch?v=mmMzWYzG8kI

 

 

Follow us on: