SSMS 2012 - Show/Hide Results Pane

In SQL Server Management Studio,developers can view or hide query results pane by using shortcut key CTRL + R in SSMS 2008.

But in SSMS 2012,after installing SQL Server 2012,shortcut key CTRL + R was not working to view/hide results pane.

Below images will show how to view/hide results pane :











Below images will show how to assign shortcut key CTRL + R to view/hide results pane:

In SSMS,Goto Tools -> Options... - > Keyboard



do the settings as shown,click Assign and Ok



Close & re-open SSMS to test working of Show/Hide Results Pane using shortcutkey CTRL + R

SQL Server Integration Services - ForceExecutionResult

By right-clicking on any tasks in SSIS,We can find under the property - ForceExecutionResult



In the below example ,I am using Execute SQL Task and creating a table.

I have set the ForceExecutionResult to Failure,which actually shows the task as failed but the table will be created in the database.








ForceExecutionResult

A value that specifies the forced result of running the package or container. The values are None, Success, Failure, and Completion. The default value for this property is None.


Reference - http://msdn.microsoft.com/en-us/library/ms137728.aspx










SQL Server - [T-SQL Handling single quotes within a string]

Two ways to handle single quotes within a string to avoid below error:

Msg 105, Level 15, State 1, Line 1
Unclosed quotation mark after the character string 'single quotes'

EXAMPLE :

--adding 2 single quotes if you need 1 single quotes in the resultset



DECLARE @string NVARCHAR(500) = 'single quotes'''
SELECT @string StringwithSinglequotes


--addind CHAR(39)

DECLARE @string1 NVARCHAR(500) = 'single quotes'+ CHAR(39)
SELECT @string1 StringwithSinglequotes









SQL Server 2012 - File Table

To enable Filestream while installing SQL Server 2012



To enable after installing & creating database :
Goto - > SQL Server Configuration Manager - > SQL Server Services -> double-click on SQL Server



To set Filestream directory name & access level ,while creating new database




SQL Server - Database Mail

This post is about sending mail through SQL Server [Database Mail  feature in SSMS]







select the option to create profile & account for sending mail.




SSIS - Capture Filenames while looping through multiple files inside folder

In this post,I am going to show an example on how to capture filenames while looping through multiple files inside folder.

In this example,I am going to capture filenames of files located in a folder.
This will be useful to keep a track on list of files already got processed.





Step 1: ForEachLoop Container with DataFlow Task



   Create variable inside ForEach Loop Container to hold filenames while looping through files inside folder.   





SSRS - Report Deployment

After creating the report,I tried to deploy the report,I am going to share about the same in this post.

I have SSRS 2008 R2 installed on Windows 7.

Create a sample report,once its running fine,start deploying it by following below steps


In SSRS,under Solution Explorer,right-click on report project -> Build



Again,under Solution Explorer,right-click on report project -> Properties ->
Under Deployment -> TargetServerURL -> we need to metion the target URL.

For that All Programs -> Microsoft SQL Server 2008 R2 -> Configuration Tools - > Reporting Services Configuration Manager.



Once you connect to Reporting Services Configuration Manager , under Web Service URL ,you will find an URL .