Monday, July 17, 2017

What is a Single Page Application?

It is exactly what it says. Single Page Applications (SPAs) are web applications with a single web page that uses AJAX for its dynamic interactions. As page refresh is on the client side the SPAs can have downside of performance degradation if they are not properly designed and SEO optimized.

There are many JavaScript frameworks to write SPAs. There are lots of JavaScript frameworks that you can use to build SPAs. Lots of them are Open Source. Here are some:

WinJS
Angular
React
Ember
Aurelia
Dojo
Vue.js
Cycle.js
Backbone
Dojo


I hear a lot about Angular and Aurelia, perhaps more people are using them.
Intel XDK had both Angular and Backbone templates, but they are not supporting them anymore.

AngularJS is in Version 2.

I have a large number of posts on Intel XDK here.

Sunday, July 16, 2017

How do you restore a database from its backup?

A backup of Northwind database was obtained from the Codeplex site and was saved to one of the folders on a Dell computer with Windows 10 OS. The computer also has SQL Server Management Studio (v 17.1). You should be able to restore using the SQL Server Management Studio installed when you installed the SQL Server 2012 Database engine.

Follow these steps to restore the Northwind database to an instance of SQL Server 2012 (x86) installed on the same computer.

Step 1. Start SQL Server Management Studio v17.1 (Run as administrator)

The SSMS is version 17.1 and Hodentek9\PCATT is a SQL Server 2012 Express

Step 2. Right click the Databases node highlighted in the PCATT isntnace as shown.




RestoreDB_01

Step 3: Click Restore Database...

Restore Database window is displayed as shown.


RestoreDB_02

Step 4: The Default Source is Database and it is greyed out as shown. Chnage it to Device. The Restore Database gets changed as shown.


RestoreDB_03

Step 5: Click the ellipsis button along 'Device' in the above image.

Select backup devices window shows on top of Restore Database window as shown.


RestoreDB_04

Step 6: Click Add button in Select backup devices window.
Locate Backup File window gets displayed as shown.


RestoreDB_05

Usually the 'backup files with extension .bak' are found in the following directory in the case of x32 bit SQL Server.
C:\Program Files (x86)\Microsoft SQL Server\MSSQL11.PCATT\MSSQL\Backup

However, for this exercise it is stored in a different location.

Step 7: Now browse to that location and highlight the Northwind.bak (A backup file which came from a Microsoft site) as shown.


RestoreDB_06

Step 8: Click OK. The file path is entered in the Select backup devices window as shown.


RestoreDB_07.png

Step 9: Click OK
You are returned to the Restore Database - Northwind as shown.


RestoreDB_08.png

Step 10: Click OK in the above.

Microsoft SQL Server Managment Studio message reports that the database
'Northwind' restored successfully.


RestoreDB_09.png

Step 11: Click OK to the message. Verify that Northwind database is in the SQL Server 2012 instance Hodentek9\PCATT


RestoreDB_10.png


Bye




Thursday, July 13, 2017

What is Dynamic Data Masking?

The title is quite revealing, is it not?

Dynamic Data Masking which is available in SQL Server 2016 allows you provide another level of security to your data, by masking data that you do not want unauthorized (by policies) users to peek into. Data in the database itself is unchanged. SQL Server 2016 has other security features besides dynamic data masking.

This is a nice feature that you should implement if are dealing with sensitive information (Credit card numbers, Social Security Numbers, etc).

Here is an image of credit card numbers being masked



Credit card masking imaged source: http://www.gsapps.com/images/masking2.gif

Read here about masking using JavaScript:

https://stackoverflow.com/questions/25367230/masking-a-social-security-number-input

Do you need special permission to create a table with a dynamic data mask?

No, you do not. Of course you need standard permissions like Create table, Alter on schema permissions.

The Alter Any Mask permission and Alter permission on  a Table are needed, though.

Read more about Dynamic Data Masking here:
https://docs.microsoft.com/en-us/sql/relational-databases/security/dynamic-data-masking

Wednesday, July 12, 2017

How to handle this Power Shell error, "Set-Location: a Positional parameter..."?

Power Shell does not like white spaces. While it may like or .  I got stumped for while as I started getting this exception.



The trick to do this changing directory is to use double quotes around words with white spaces as shown here.


I have Power Shell 5.0 on my Windows 10 Pro OS.

What is Microsoft Graph?

Microsoft SQL Server is for accessing data and Microsoft Graph is to access the myriad of things that are not really part of the database. The things that spring to the mind are things like, emails; your devices; the teams you work with; calendars; files; messages, peoples etc..

Also read this post on Graph databases:
http://hodentek.blogspot.com/2013/12/what-is-neo4j.html

A quick look at this image shows how Microsoft Graph is positioned.



Well, what is it Microsoft Graph good for?

Believe me, you indeed have a great deal of use for it. Allow me to quote Microsoft:

'Looks at your next meeting and helps you prepare for it by providing profile information for attendees, including their job titles and who they work with, as well as information on the latest documents and projects they're working on (pro-active, do diligence).

Scans your calendar, and suggests the best times for the next team meeting.

Fetches the latest sales projection chart from an Excel file in your OneDrive and lets you update the forecast in real time, all from your phone.

Subscribes to changes in your calendar, sends you an alert when you’re spending too much time in meetings, and provides recommendations for the ones you could miss or delegate based on how relevant the attendees are to you.

Helps you sort out personal and work information on your phone; for example, by categorizing pictures that should go to your personal OneDrive and business receipts that should go to your OneDrive for Business.
'
Behind Microsoft Graph is the Microsoft Graph API; a RESTful web api that enables you to access Microsoft Cloud serivce resources.

Come back to this blog again for more on Microsoft Graph.

Thursday, July 6, 2017

Can you install SQL Server Express (x86) on Windows 10 (x64 bit)?

The short answer is YES.

A x32 bit SQL Server Express Advanced and a x64 bit SQL Server 2016 SP1 are both installed on a Dell Inspiron laptop.

Here are the responses to the command:

SELECT @@version in a query launched by both of these versions:

(No column name)
Microsoft SQL Server 2012 - 11.0.2100.60 (Intel X86)   Feb 10 2012 19:13:17   Copyright (c) Microsoft Corporation  Express Edition on Windows NT 6.2 (Build 9200: ) (WOW64)

(No column name)
Microsoft SQL Server 2016 (SP1-GDR) (KB3210089) - 13.0.4202.2 (X64)   Dec 13 2016 05:22:44   Copyright (c) Microsoft Corporation  Developer Edition (64-bit) on Windows 10 Pro 6.3 (Build 15063: )

They can co-exist as shown: