Categories
SQL Tutorials

Change Default Database in SQL Server Management Studio

Change your login name and database name and Execute following SP:

Exec sp_defaultdb @loginame='imsatasia\Rahul', @defdb='DBName'

OR

  • Go to “Object Explorer > Security > Logins”
  • Right click your Login and click on “Properties”
  • Under General Section, you can change Default Database value in drop down called “Default Database”

Set Default Database Name in SQL Server

Categories
SQL

Format Phone Number – SQL Server Function

SELECT dbo.CMN_FmtPhone('1234567891011')
Output: (123) 456-7891 Ext: 011

SELECT dbo.CMN_FmtPhone('1234567820')
Output: (123) 456-7820

CREATE FUNCTION CMN_FmtPhone
(
	@PhoneNumber varchar(15)
)
RETURNS varchar (15)
AS
BEGIN
	Declare @returnValue as Varchar(15)

	SELECT @returnValue =  
			CASE 
			WHEN LEN(LTRIM(RTRIM(@PhoneNumber))) = 10 
				THEN '(' + SUBSTRING(@PhoneNumber, 1, 3) + ')' 
						+ ' ' + SUBSTRING(@PhoneNumber, 4, 3) 
						+ '-' + SUBSTRING(@PhoneNumber, 7, 4) 
			WHEN LEN(LTRIM(RTRIM(@PhoneNumber))) > 10 
				THEN '(' + SUBSTRING(@PhoneNumber, 1, 3) + ')' 
						+ ' ' + SUBSTRING(@PhoneNumber, 4, 3) + '-' 
						+ SUBSTRING(@PhoneNumber, 7, 4) 
						+ ' Ext: ' + SUBSTRING(@PhoneNumber, 11, 5) 
			END

	RETURN @returnValue;

END
Categories
Featured Mac OS Tutorials

Download Bootcamp 4 – drivers for Windows 8 Consumer Preview

Here is how you can download and install Macbook Pro Drivers on Windows 8 Consumer Preview or Windows 7:

  • Download Bootcamp 4.0 Drivers, here’s a link on some Apple CDN for the .pkg file containing the drivers:
    http://swcdn.apple.com/content/downloads/54/00/041-0694/sq2RLp7XVNQzRG8qdpsq9sj4 pHsgXkgPYg/BootCampESD.pkg
  • Open this file with 7Zip in Windows:
    http://www.7-zip.org/download.html
  • Open “BootCampESD.pkg” in 7Zip then navigate and extract:
    “BootCampESD.pkg\Payload\Payload~\.\Library\Application Support\BootCamp\WindowsSupport.dmg\0.Apple_ISO
  • Rename the file from 0.Apple_ISO to BootCamp4.iso
  • Extract the iso (“BootCamp4.iso”) with 7Zip to a folder.
  • From the Windows start menu, search for “cmd”, and right-click to run as administrator.
    Navigate to the extracted folder, for example:
    C:
    cd “WindowsSupport\Drivers\Apple”
  • From the prompt in that folder, run “msiexec /i BootCamp64.msi”
Categories
Infographic

iPhone 5 – Are you getting one?

iPhone 5 infographic

Categories
Infographic

Visual History of NASA’s Space Shuttle Program

The Space Shuttle


The Astronauts

Source: NASA, Boeing
Credit: Christina Baird, Adam Cole, Nelson Hsu, Allison Lenz and Andrew Prince / NPR

Categories
Infographic

A World Without Facebook

Categories
Infographic

Sitting is Killing You – The Truth about Sitting Down

Categories
Featured Infographic

The Health Benefits of Coffee vs Tea


By Policy Expert
Categories
Featured iPhone Tutorials

How to Enable Multi-Touch Gestures in iOS 4.3.1

Follow the instructions to enable multi-touch gestures for iPhon 3GS, iPhone 4, iPod Touch and iPad:

We will be editing 3 plist files in this tutorial. To edit and find .plist files use following application for Windows machine or Mac:

Categories
Infographic

Education in For-Profit Education by CampusProgress

Education in For-Profit Education by CampusProgress