Wednesday, March 9, 2016

Hands-on Learning Event in Honolulu 1 : Introduction to Structured Query Language

The above course will be offered again (April 14-May 17, 2016) as a non-credit course by the Pacific Center for Advanced Technology Training.


Course summary:

Databases, organized repositories of information, have become indispensable and in fact even more relevant despite the emergence of Big Data in today's world.

In this introductory course you will learn about relational databases and the basics of Structured Query Language (SQL) including sorting; grouping result sets; using DDL, DML, DCL, and TCL. All SQL statements will initially be written for one table. Most practical, modern and relational databases will include a large number of tables and SQL queries have to access information from several tables. This course will then introduce you to querying more than one table. With this skill you will be able to query two or more tables in a database. This is a hands-on course which will take you from installing SQL Server 2012; learning the ins and outs of SQL Server Management Studio and of course a full dose of SQL.

During each meeting the students will be assessed for their knowledge, competency and proficiency in SQL.

New this session:
SQL Azure Database: SQL Server in Microsoft Cloud
Windows PowerShell for SQL Server

My sincere thanks and best wishes to the January batch of students.

Thursday, March 3, 2016

Easy way to backup a SQL Server Database

You may need to backup a SQL Server database. What tool would you use? Of course you can use the SQL Server Management Studio, a great tool, agreed. But there is an easier tool which comes with your Windows 10 Installation. The Windows PowerShell, another great program from Microsoft.

This Swaytorial (Swaytorial 3) shows you how to do it in  1-2-3 steps. Enjoy! Just use the navigation guides at the bottom right.


CC

Thursday, February 11, 2016

Attaching AdventureWorks2012 database to a SQL Server Instance


Sample database files are great if you are interested in learning the basics of SQL Servers and SQL Querying.

After installing the SQL Server the first thing you may have to do is bring in some data. Microsoft has provided lots of samples and AdventureWorks is one such database of a hypothetical company and it is bigger than the Northwind database of a hypothetical company.

Here is a Swaytorial that helps you to bring in data to your server. Enjoy!



Tuesday, February 9, 2016

A tutorial on creating script using SQL Server Management Studio

Creating script is an important skill that you should learn. As there are so many versions of SQL Server not to mention those on Microsoft Azure Cloud platform, you should know for which version you are writing the script. You can change this in Tools | Options and look for scripting node.

This presentation is created using Microsoft's latest presentation program SWAY. This is my first shot at SWAY. The presentation may not be smooth. Would you kindly comment? Thanks




Thursday, February 4, 2016

Problem with SQL Server 2014 Report Builder 3 and the fix

This problem surfaced while installing SQL Server 2104 Report Builder on a Windows 10 (x64) Pro machine which has a SQL Server 2014 (x64) Developer Edition installed and a properly configured Report Server.

The Report Builder software was downloaded from this Microsoft Site:
https://www.microsoft.com/en-us/download/details.aspx?id=42301


ReportBuilder_01

Double clicking the downloaded MSI file above started the installation. The program looks for a target report server and it was provided as shown:


ReportBuilder_02

The Report Server and the Report Manager both do not have any problem. However this ends up with an unsuccesful installation with this message:


ReportBuilder_03

The work around for this is to not provide a target report server and ccontinue with the installation. The installation succeeds this time. After a little while an gets added to the All Icons group as shown.


ReportBuilder_04

Wednesday, January 27, 2016

Find everything about objects and columns in SQL Server 2012

In SQL Server 2012, sys.columns is a view you can find in the node System Views in the msdb database.

The various columns in sys.views are shown in this next image. You can find everything about the Columns in this view.



If you know the ObjectID of the Column of a table in the database, you can find its name from this query, the intellisense gives you an idea of this selection.

SysColumnName.png

A typical query and its output are as shown for finding the column name from ObjectID.

SysColumnName_02.png

If you know the Column_Name then you can find Column_ID, the intellisense gives you an idea of this selection.

SysColumnID.png

A typical query and its output are as shown for finding Column ID from Column Name.

SysColumnID_02.png

Starting from table name you can get the columns from these queries:

You can also get the ObjectID of the table from this query:

Use Northwind
go
Select *
From sys.tables
where tables.name='Employees'

go

The above query returns one value=245575913
Using the above you can get a whole lot of information for the columns from this query:

Select *
from sys.columns
where Columns.object_id=245575913












Tuesday, January 26, 2016

Finding Collation used by the SQL Server objects

Collation is locale specific and you choose while installing the SQL Server. Sorting depends on this as well as case sensitiveness.


Collation.jpg


You can also search to find what kind of collation is supported on your server using the following query for the whole database (this example is for the master database)
Select name, COLLATION_NAME from sys.databases where name=N'master';
Response: SQL_Latin1_General_CP1_CI_AS master
If you have a column that is of varchar data type (something textual) you use this query for the column,
SELECT name, collation_name FROM sys.columns WHERE name = N'optname';
Response: optname SQL_Latin1_General_CP1_CI_AS

Note that there is a column called optname in the master database
You can find all the collations that are supported using this query:


CollationsSQLServer2012.jpg

When Identity Security Becomes a Wall — Not a Shield

After a breach that forced a reset of my digital identity, I hit a roadblock I never anticipated: multi-factor authentication (2FA) locked m...