Latest Posts

If you are accessing SQL Server Reporting Services in Report Manager and wondering where the Report Builder button is, this could be due to one of the following:

image

1) You are using the Express version of SQL Server.
Report Builder feature is not included in the express version of SQL Server.

2) You do not have Report Builder role assigned to the logged in user accessing SQL Server Reports:

image

To learn on how to do this, you can view a similar problem where required to change the Role setting. Jump to step number 3:

Edit Role Assignment Report Manager

This tutorial helps you to get Adventure Works database added to your SQL Server 2012. First thing we need to do is to download the sample database from Microsoft’s website:

http://msftdbprodsamples.codeplex.com/releases/view/55330

On the website, you will see a link to AdventureWroks2012 Data File:

image

After you have download it, follow these steps:

1. Copy/Move the Data File to the SQL Server DATA directory.

The directory structure for a SQL Server 2008 R2 named instance that includes the Database Engine, named “MyInstance”, and installed to the default directories would be as follow:

C:\Program Files\Microsoft SQL Server\MSSQL10_50.MyInstance\

Note: I am using SQL Server 2012 Express and I have changed my default directory for DATA

 

2. Open SQL Server Management Studio (SSMS) and Right click on the Database folder then click on Attach:

image

3. A window will open to add your MDF file. Click on Add button:

image

4. Since you copied Adventure Work Data File (.MDF) to the default DATA directory, it will appear under the DATA directory. Select AdventureWorks2012_Data.mdf and click OK:

image

5. A log file could be automatically added for you. Since this is the first time we are adding this Data File, there is no Log file. Therefore, select the Log entry and click on Remove to delete it. Then click on OK to proceed.

image

6. You have now successfully added Adventure Works to your Database and you can see it listed under your Databases folder in your Object Explorer:

image

7. You can also see that SQL Server added a log file for your new .mdf file which you just added:

image

Tagged with:
 

There are two issues that you will find out when you finish the installation of SQL Server 2012 or SQL Server 2008 R2:

  1. When you try to access Reporting Services using your IE browser, it will constantly prompt you to enter username and password.
  2. After the successful entry of login details in IE, you will get the following error message:
User ‘Domain\User’ does not have required permissions. Verify that sufficient permissions have been granted and Windows User Account Control (UAC) restrictions have been addressed.

image_thumb65

To resolve the first issue, please read the following article:

SSRS Prompt username and password

Here is the steps that you need to do to resolve the second issue:

1. From Start > All Programs > Internet Explorer, Right Click and choose Run as administrator

image

2, Enter the Reporting Services URL: http://localhost/Reports_SQLExpress

3. Running as administrator will allow you to have access to Site Settings. Click on it:

image

4. You will see the General Site Settings page:

image

5. Click on Security from the left side menu and choose New Role Assignment:

image

6. Add the username or Group that you want to grant permission to and select the appropriate role:

image

7. Now go to Home page and click on Folder Settings. Add the username or Group that you want to grant permission to the main Home page:

image

8. All done now. You can normally open IE and it will work without an AUC error. You can also create Folders within the Home page and restrict access to specific users.

Before we begin the installation process, it is important that you choose the correct version of SQL Server Express. To learn more about which version to download, read the following article and download the right SQL Express version:

SQL Express 2012 Versions

After downloading the correct version, make sure that you have the right hardware and software requirements.

Environment Check

  • Supported OS: Server 2008 R2 SP1, Server 2008 SP2, Windows 7 SP1, and Vista SP2.
  • Processor:
  • Minimum for x64 installations: AMD Opteron, AMD Athlon 64, Intel Xeon with Intel EM64T support, Intel Pentium IV with EM64T support. Processor Speed: 1.4 GHz
  • Minimum for x86 installations: Pentium III compatible or higher. Processor Speed: 1.0 GHz
  • Memory: Minimum: 512 MB

If you do not have the minimum requirement, you will be prompted with a message box similar to this:

(I was trying to install SQL Server 2012 Express on Windows 7 which did not have Service Pack 1 installed.)

image_thumb38_thumb

You can also perform System Configuration Check using a tool provided by the SQL Server 2012 Express application installation. Run the executable file after you have downloaded. Installation files begin to be extracted to a temporary folder, then the below window will appear. From the Planning menu on the left, choose System Configuration Checker:

image_thumb37_thumb

 

1. If you pass the minimum requirements, then you can proceed with the software installation. From the Installation menu on the left side, choose New SQL Server stand-alone installation or add features to an existing installation:

image

2. Setup will perform a quick system check. You can see below that one of the conditions failed and asks for a system reboot. This is because I have installed Window 7 Service Pack 1 (using Window Update) but did not restart my computer:

image

3. If you also required to do a reboot, then you have to start over the installation process from the beginning. In this step you have to accept the License Terms to continue:

image

4. Another quick check is done and this time the system passed all:

image

5. We can select the features that we want to install. Note that in this example, I have downloaded SQL Server 2012 Express with Advanced Services. This includes the Reporting Services:

image

6. Name the instance of your new SQL Server Express. I am also changing the Instance root directory:

image

7. You can define separate account for each service. I am leaving everything as the default:

image

8. You can also specify your Database Engine Collation. I am leaving as the default:

image

9. Choose the authentication type. It is recommended to choose Mixed mode for better security. You can also change this at a later time. Read this article to learn how to: Change SQL Server Authentication mode

If you choose mixed mode, then you have to enter a password for the SQL Server system administrator (sa) account:

image

10. If you ticked in the feature’s section to install Reporting Services, then here it will ask you whether to have the default configuration or do installation only and do Reporting Services configuration manually later. For this exercise, I am leaving as the default – to do both installation and configuration. Read the following article if you want to learn how to do configuration manually:
Installing and Configuring Reporting Services

image

11. The system will now continue with installation:

image

12. Finally, the last screen shows the installation process is completed successfully:

image

13. It may ask you to restart your computer:

image

14. We can see now that SQL Server 2012 Express with other tools installed under All Programs:

image

15. We can run the SQL Server Management Studio (SSMS) and see that we have already two databases installed. These are related to the Reporting Services.

image

16. We can also verify that the Reporting Services is running by typing the URL: http://localhost/Reports_SQLExpress

image

 

All done. Note that Reporting Services when access by IE9, will prompt you to enter username and password. To learn how to resolve this issue, please read the article:

SSRS Prompt for username and password

Reporting Services may also give you some User Access Control authorization error (UAC). To learn how to resolve this issue, read the following article:

SQL Server Reporting Services User Access Control (UAC)

After the successful installation of SQL Sever Reporting Services 2012 or 2008 R2 (read this article for an installation tutorial: SQL Server 2012 Express Installation Tutorial), you will get constantly prompted with Windows Security dialog box to enter login details. This is related to IE9 which ships with Windows 7 operating systems.

image

It is easy to fix this issue by following these steps:

1. Open Internet Explorer (IE9) and from the tools menu, choose Internet Options:

image

2. From the Security Tab, choose Local intranet and click on Sites:

image_thumb[15]

3. Click on Advanced button:

image_thumb[16]

4. Type in localhost in Add this website text field and click on Add button (Un-tick the box Require server verification (https:) for all sites in this zone):

image

 

All done. If you open your IE again and type in Reporting Services URL, you will no longer be prompted to enter login details.

However, you may see a UAC (User Access Control) authorization error message. To learn how to resolve this issue, read this article:

SQL Server 2012 UAC authorization error

SQL Server 2012 Express

On March 15, 2012, in MS SQL Server, Technical Knowledge, by Soheib
3

“SQL Server Express is a free edition of SQL Server ideal for developing and powering desktop, web and small server applications. Download SQL Server 2012 Express RTM, which includes SQL Server Express LocalDB, a new lightweight deployment option for Express…”   Microsoft

 

The express version of SQL Server is really a product that many developers can benefit from specially that it is reasonably powerful for a free version. Nevertheless, it has some limitations:

  • Maximum database size 10GB
  • Maximum usage of Ram 1GB
  • Single physical CPU
  • No SQL Server Agent (job scheduler)
  • Profiler tool is not included

SQL Server Express comes in different versions depending on your needs. One of the latest add-on is LocalDB which is yet a lighter version of Express. Here are the differences between each version as Microsoft describe:

LocalDB (MSI installer)

New to the Express family, LocalDB is a lightweight version of Express that has all its programmability features, yet runs in user mode and has a fast, zero-configuration installation and short list of pre-requisites. Use this if you need a simple way to create and work with databases from code. It can be bundled with Visual Studio, other Database Development tools or embedded with an application that needs local databases.


Express (containing only the database engine)

The core Express database server. Use this if you need to accept remote connections or administer remotely.


Express with Tools (with LocalDB, includes the database engine and SQL Server Management Studio Express)

This package contains everything needed to install and configure SQL Server as a database server. Choose either LocalDB or Express depending on your needs above.


SQL Server Management Studio Express (Tools only)

This does not contain the database, but only the tools to manage SQL Server instances, including LocalDB, SQL Express, SQL Azure, etc. Use this if you already have the database and only need the management tools.


Express with Advanced Services (contains the database engine, Express Tools, Reporting Services, and Full Text Search)

This package contains all the components of SQL Express. This is a larger download than “with Tools,” as it also includes both Full Text Search and Reporting Services.

 

Download

You can download SQL Server 2012 Express from the following link: http://www.microsoft.com/betaexperience/pd/SQLEXPCTAV2/enus/default.aspx

 

Installation Tutorial

You can view a step-by-step installation guide for SQL Server 2012 Express from the following link:

SQL Server 2012 Express Installation Tutorial

Tagged with:
 

SQL Virtual Restore

On March 14, 2012, in MS SQL Server, Technical Knowledge, by Soheib
0

“Rapidly mount live, fully functional database direct from backup”

 

There are couple of ways to do a restore from a backup file in SQL Server; for instance, using SQL Server Management Studio restore wizard or manually writing your own script in T-SQL. However, these methods are not necessarily the best way to do a restore depending on the scenario you are working with; that is, if you have relatively large database backup file with not much time to do a restore. The above methods occupy large amount of space and take very long time to get a successful restored database.

I have a real work situation where I need to restore a backup database file which has a very large size 167GB and I have to do it in less than an hour. Here where this tool from RedGate (http://www.red-gate.com) comes handy. The product is called SQL Virtual Restore which as the name suggests it virtually restores the database using the backup file itself to mount as live database with fully functional access without the need to do a physical restore. You can try the product for 14days:
http://www.red-gate.com/products/dba/sql-virtual-restore/

The screenshot below shows the actual size of the backup file on the physical drive H:\

image

 

To do the restore traditionally, the physical space that is required after the restore is 245GB. Unfortunately, I do not have that much space on my hard drive, so actually the physical restore will fail:

 

image

 

So, the only way forward for me was to use SQL Virtual Restore product by RedGate and it actually worked perfectly because it did not need extra space. It used the backup file itself to mount the live database to. Here is how I did it from the beginning to the end:

Environment Check
You would need the following ready before you begin the installation process:

  • Windows Operating System (I am using Window 7 64bit)
  • SQL Server (I am using SQL Server 2008 R2)

How to install SQL Virtual Restore 2.3?

1. Download the product from RedGate website:
http://www.red-gate.com/products/dba/sql-virtual-restore/download

2. Unzip the compressed file: HyperBacComponents.zip

3. There are three executable files to choose from. For the SQL Virtual Restore, we only need HyperBac_Installer. Choose the correct version for your OS. In my case: HyperBac_Installer_x64.exe

image

 

4. Double click on the file HyperBac_Installer_x64.exe and follow the instructions on the screen. i have provided all the screenshots:

image

image

image

image

image

 

5. Activate the product if you have purchased it or click Exit for a 14dyas trial.

6. To open the program, go to Start > All Programs > HyperBac > SQL Virtual Restore Wizard

 

image

 

7. The wizard will start to guide you through 5 steps. Choose the SQL instance where you want the restore appears. I am choosing on my local instance:

image

 

8. Click on the Add Files button to browse through Window’s directory in order to select the backup file which you want to have it restored:

image

 

9. Keep the default selections or change according to your need. I am specifying a different directory for the database virtual files to be stored in:

image

 

10. Summary result is displayed before the final restore. You can also view the T-SQL code by clicking on View Scripts button. Click on Restore button to start the process:

image

 

11. You can see now that it has started restoring:

image

 

12. In less than an hour the restore completed successfully:

image

 

13. You can see from the completed result that we have saved 30% space. Nevertheless, I would say that I saved 245GB of space. Because if I would have done this by a physical restore, I would still have the backup file plus an additional restored database size 245GB; whereas, the virtual restore used 171GB in total including 168GB original backup file plus 3GB additional virtual database files.

Finally, we can see the restored database in SQL Management Studio:

image

During the installation process of SQL Server, user is prompted to choose the Authentication mode which is one of two:

  • Window Authentication mode
  • SQL Server and Window Authentication mode

It is recommended to use the second option – mixed mode. However, assuming that you have chosen Window Authentication mode and later on you decided to change to mix mode. This can be done and the easiest way to do is by following these few steps:

1. Open SQL Server Management Studio (SSMS) and login using Window Authentication:

image

2. Once logged in, create a new Login user or enter a password for the user sa. To do this, go to:
Security folder > Logins > sa  and double click on the selected sa user. Enter the password and click OK:

image

3. Now that we have a SQL server user, we can change the Authentication mode to mix mode. Right click on SQL Server icon and choose Properties:

image

4. From the left side menu, choose Security page and under Server authentication choose SQL Server and window Authentication mode. Click OK to finish:

image

5. A message box will appear that says you must restart SQL Server before changes take effect. To do this go to Run and type in services.msc then Click OK:

image

6. Windows Services dialog box will appear. Search for SQL Server under the list of names. Then select it and click on the re-start button.

image

7. Go back to your SSMS and create a new Database Engine connection. Under Authentication, choose, SQL Server Authentication and type sa under Login followed by the password in the password box. Then click on connect:

image

 

8. Finally, we can see that we are connected using the user sa:

image

There is no a particular setting to enable or disable this feature in VMware Player. However, once you have installed VMware Tools, this feature will be available automatically. And to installed it, open your VMware Player and from the top menu choose Virtual Machine > Select Install VMware Tools:

image

 

The installation wizard screen will appear and you can proceed with installation until you finish. Once successfully installed, the clipboard feature will work:

image

Tagged with:
 

If this is your first time creating an SSRS report, then this is the right article for you. Below is a step-by-step guide that will help you to create, deploy and view your first report using SQL Server Reporting Services 2008:

Environment Check

Assuming the following are installed and already configured on your machine:

  • Installed SQL Server 2008 R2
  • Installed AdventureWork Sample Databases
    (You can visit Microsoft website to download and install it:
    http://msftdbprodsamples.codeplex.com/releases/view/55926
    We are using it in this case as a sample database. However, you can write any SQL statement on one of your pre-installed Databases)
  • Installed SQL Server 2008 Reporting Services
    (If you have not done this, visit this post: SSRS 2008 Installation Guide)
  • Both SQL Server and Reporting Services are installed on the same machine (localhost)

Now we can start the guide walk-through:

1. Open SQL Server Business Intelligence Development Studio (BIDS) by going to:
Start > All Programs > Microsoft 2008 R2 > BIDS

2. From the menu, choose File > New > Projects

image

3. Choose the right template: Report Server Project and type in name of the Project:

image

4. If this is your first time creating a report, then we do need to setup the path where some of the reports are stored while deploying. (We only need to do this once) So, right click on the project name from your Solution Explorer window (on the right side) and choose Properties.

image

5. I would normally leave the settings as default EXCEPT you need to add the value for parameter TargetServerURL which is blank:

image

6. Normally, the Report Server URL is: http://localhost/ReportServer
You can check this by going to: Start > All Programs > SQL Server 2008 R2 > Configuration Tools > Reporting Services Configuration Manager. Then, from left menu choose Web Sever URL and under Report Server Web Service URL, you will find the address which is setup. You can always replace the long ugly machine name with localhost:

image

7. Type in the Server URL and click OK:

image

8. Now, we begin to add Reports to our project. To do this, right click on Reports folder and choose Add > New Item:

image

9. Type in the name of your report: ContactList.rdl and click Add

image

10. Report Wizard will start. Although, you can create report manually without wizards, for the purpose of this first exercise we continue with the wizard. Click Next:

image

11. Every report need a DataSource to know which database to connect to. As this is the first time, we have to create this. Click on Edit:

image

12. Type in Server Name: localhost. I have setup the SQL Server to accept Window Authentication. Otherwise, enter SQL Server Authentication:

image

13. Choose the database that you want to work with and click OK to finish:

image

14. Now that we have created the connection string, click on Next to continue (note that you also tick the box Make this a shared data source to use for future reports):

image

15. In the next step, it will ask to to type in the Query String. There are two ways of doing this, either use Query Builder or write in your own code. I prefer the later, so I have opened SSMS and wrote my select statement which return the result that I have to use in my report. I will also run it to make sure the syntax is connect. Copy the code to the clipboard:

image

16. Page the code in the Query String and click Next:

 1: SELECT
 2:     Title,
 3:     FirstName,
 4:     LastName,
 5:     EmailAddress,
 6:     Phone
 7: FROM Person.Contact
 8: WHERE Title IS NOT NULL

image

17. Depending on the report choose the type. This is a simple basic report so we are going to use Tabular. Click Next:

image

18. In this step, the wizard allows you to do Grouping but for the purpose of this exercise, we will have a simple report that return lost of all names. Also, we have already specified the columns that we want in our SELECT query; therefore, we want to select all the available fields and click the Details button to move them to the Details section:

image

19. We can see all fields are in the Details section. Click on Finish:

image

20. You can type in or change the name of the report and click Finish to end:

image

21. We can see the report is now created. To view the report click on Preview tab:

image

22. The preview Tab will run and render the report to see the outcome result:

image

23. So, now that we have created the report and preview it, we can need to Deploy it to the Report Server so that it can be viewed and accessed by end-users. To do this, right click on the report file (ContactList.rdl) and choose Deploy:

image

24. Remember that we have to setup the Target Report Server URL correctly before deploying. If all is done correctly, we will see the successful message in the Output result dialog box. This is a confirmation that the report has successfully built, deployed and ready to be viewed:

image

25. To view the report which has just been deployed, open IE browser and type in: http://localhost/Reports

This is the address where all Reports are deployed and can be accessed by end-user. We can also see that reports are in a Folder structure similar to Window Files. Click on MyFirstReport folder:

image

26. And finally to view the report, click on ContactList:

image

27. Here is the report displayed on your web-browser:

image

28. Finally, a very useful feature of SSRS reports is the ability to export them into PDF, Excel, or Word:

image