Tuesday, August 30, 2011

Using the script task in Management Studio

Today I was taking a back of a database and for the past two days this has become my regular activity. So I thought there should be some kind of recording option (like recording a macro in excel) so that I can just use the recorded action whenever I need to do the same task again and again.

So I tried to investigate and found this script button. So I thought I would investigate this. The following are the steps I followed to backup a database in the Management Studio.


  • Right click the database that needs to be backed up.

  • Click on Task -- Backup

  • Choose the Backup options like how you choose normally.

  • Before clicking Ok click on the Script option at the top and choose the option that you want from the 4 options available as shown below.





This has generated a nice script as shown below.

BACKUP
DATABASE [TEST] TO

DISK

= N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\TEST20110830.bak' WITH FORMAT, INIT, MEDIANAME = N'TEST', NAME = N'TEST-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO


This script can be used to do the same task again and again and also may be you can schedule this to be processed at a certain time every day.



Tuesday, August 23, 2011

Windows Firewall Settings on Windows 7

Today I had to access the Windows Firewall to check for blocking of a port. I am used to the command wscui.cpl from the Start -- Run screen of the Windows XP operating system. So I did the same thing on my Windows 7 screen. I was surprised to get the security centre where the Windows Firewall was not visible as shown below.



Luckily I saw the Control Panel Home link at the top and clicked on the link. Then I noticed the Windows Firewall as being a separate entity in the control Paenl and accessed this from there.

Friday, August 05, 2011

24 HOP -- September 7-8 2011

The registration for the much awaited 24 hours of PASS is now open. Here is an excerpt from the site.

Two Days of Free SQL Server Training!

Don't miss the best 24 hours of free, online SQL Server training in the industry with 24 Hours of PASS: Summit Preview September 7 and 8.

Join us for an exceptional lineup of SQL Server and BI experts, who will be presenting a sneak peek of their PASS Summit 2011 session topics in 24 live webcasts delivered directly to your computer.

Register here to attend these sessions.

Thursday, August 04, 2011

Powershell for SQL Server : An Introduction -- Free webinar

A free webinar is being organised by Idera on Powershell for SQL Server.

Here is an excerpt from the site.

In this session, Microsoft MVP Aaron Nelson will discuss what PowerShell is and demonstrate how and why DBAs should use it. Aaron will step you through the basics of Windows PowerShell and provide you with some commonly used first scripts to help you get started. Register for the webcast today!

The date and time of this webinar is below:

Wednesday, August 10, 2011
2:00 PM - 3:00 PM CST

Wednesday, August 03, 2011

What the password policy of sql server?

Yesterday I had a question in my mind as to what could be the sql server password policy. So I started hunting in the Help menu of the SSMS window. Here is how I found that.

  • Click on Help from Sql Server Management Studio.

  • Choose contents

  • Then choose Security considerations for SQL Server

  • Then choose the Password Policy as shown in the screenshot below.








INSERT EXEC failed because the stored procedure altered the schema of the target table.

This morning I was trying to call a stored procedure and insert the results in a temp table using the following code  -- create table #...