Posts tagged ‘SQL Server 2008’

September 10, 2011

Editing SSRS 2008 Projects in Visual Studio 2010

Microsoft has been releasing updates to Visual Studio at an ever faster pace. Unfortunately, one technology was left behind. The ability to edit SQL Server Reporting Services (SSRS) projects inside Visual Studio is actually provided by Business Intelligence Studio, which ships only when SQL Server rolls out an update. As a result, up until recently, one had to have a copy of Visual Studio 2008 (or rather the Business Intelligence portion of it that is installed by SQL Server 2008) to edit SSRS 2008 projects. It’s even worse for people who are still using SSRS 2005 (they have to have Visual Studio 2005 if they didn’t want to upgrade their projects). For those of you willing to move to SSRS 2008 and who would like to use a single editor (with the corresponding TFS integration), you now have the option to install Denali CTP 3 (or a more current version, depending on when you find this post) to get the update to Visual Studio 2010 that finally lets you edit SSRS project types. Don’t worry, you don’t have to install the entire CTP product, just the business intelligence portion of it.

The steps (as of 9/1/2011) are:

1) Make sure you’ve updated to Visual Studio 2010 Service Pack 1

2) Download the appropriate version of Denali CTP 3 (I ran the 1033\SQL Server Denali CTP 3 Install.html and followed the links to the version I wanted — x86 or x64). When you launch the installer you can choose the “Express” option and it will still let you install Business Intelligence Studio.

When you install Denali, only install Business Intelligence Studio as illustrated by the screeshot below (unless you want to play with all of it).

Denali Installer Options

Denali Installer Options

Warning: If after following the steps above Visual Studio 2010 warns you that you do not have the complete Service Pack 1 installed, you may have to re-apply Visual Studio 2010 Service Pack 1. Subsequently, the installer may prompt you for the MSI containing the latest Silverlight SDK. This page will help you deal with that error. This happened to me on one of my development machines, but not the other. Read this article for more: Visual studio 2010 sp1 error: silverlight_sdk.msi unavailable. This is one of the dangers of installing CTP products but a small price to pay for the convenience of editing SSRS 2008 projects inside Visual Studio 2010.

 

Advertisement
January 25, 2011

Re-index All Tables in your SQL Database: Short & Dirty Script

I am not advocating that you use this in a production system, but if you’re looking to re-index all tables in your database (say on development or test), here is a short script for it:

exec sp_msforeachtable 'dbcc dbreindex(''?'', '''', 80)'

Note, the last parameter controls the fill factor, set it to 0 to re-use the last known fill factor or read more about it in Books Online. With sp_msforeachtable you’re looping through all tables in the database and executing the provided script. As you can see above you use a question mark (?) to substitute the table name. This is a decent alternative to manual looping through INFORMATION_SCHEMA.TABLES which is another way to get a list of all tables in your database.

If you were just looking to obtain a dbcc script you can run this command and it will generate the equivalent script that is run by the first command I showed:

select 
	'dbcc dbreindex(''' + TABLE_NAME + ''', '''', 80)' 
from 
	INFORMATION_SCHEMA.TABLES 
where 
	TABLE_TYPE = 'BASE TABLE'