Posts

Showing posts from 2012

How to format amount do not display numbers after decimal point? e.g. if the value in the database 139000.82 what function to use (other than FormatCurrency)to display amount in the SSRS 2008 R2 report such as $139,000?

Image
Please follow the below steps to achieve the answer.



Next




Set the expressions as like below.

="Post Code:" + Fields!Post_CODE.Value +  VbCrLf  + "Area:" + Fields!AREA.Value + VbCrlf + "Count of Admission Number:" + cstr(Count(Fields!ADMISSION_NO.Value, "DataSet1")) + VbCrlf + "Estimated VALUE:" + cstr(Format(Sum(Fields!ESTIMATED_VALUE.Value, "DataSet1"),"C0")) +  VbCrLf  + "Averege of Each Employee VALUE:" + cstr(Format(Sum(Fields!ESTIMATED_VALUE.Value, "DataSet1")/Count(Fields!ADMISSION_NO.Value, "DataSet1"),"C0"))

That’s it.

How to drill through from parent report to child report in SSRS 2008 R2?

Image
Right click the textbox and set the steps as shown below.




Click action->Go to Report->Give Report Name->select any parameters to pass from parent report to child report.


That’s it.

How to set exception based on some amount value in % total field or Highlight anything >10% by another colour in SSRS 2008R2?

Image
Right click the total textbox and set as like below.



Next go to backgroundcolor property of that textbox.



Set Expression as like below.



=iif( iif(iif(isnothing(Sum(Fields!Amount.Value,"Year")),0,Sum(Fields!AMOUNT.Value)/Sum(Fields!AMOUNT.Value,"Year"))=0,nothing,Sum(Fields!AMOUNT.Value)/Sum(Fields!AMOUNT.Value,"Year"))>0.1 ,"Green","White")
Thats it.

How to set Tooltip for Spark line chart in SSRS 2008R2 and how to format the amount in zero decimals?

Image
Right click spark line chart and Go to ‘Series Property’ of Spark line and set tool tip as per below screenshot.





Set Tooltip as per the following image.





=Format(Sum(Fields!Amount.Value),"C0")
CO denotes zero decimlas value.
That's it.


How to show values of parameters chosen in the dropdown list on Textbox in the SSRS 2008 R2 report?

Image
Drag and drop text box and go to properties--> do the steps as below.




Select the parameter from parameters category of Expression Tab and select the appropriate value ’Parameters!employeer_post_code.Value’ I got this by using join Join (Parameters!employeer_post_code.Value, ", ") Finally click OK.
That’s’ it.

How do i format the currency field as £ UK pounds sterling for the entire SSRS 2008 R2 report?

Image
Set as language properties under report properties. It should be set to English UK (en-GB) as shown below.

o/p:



Query to find who has access to a report folder or a particular report in SSRS2008 R2?

SELECT distinct(C.Path),             U.UserName FROM Catalog C INNERJOIN             PolicyUserRole PUR ON             C.PolicyID = PUR.PolicyID INNERJOIN             Users U ON             PUR.UserID = U.UserID SELECT distinct(C.Path),             U.UserName FROM Catalog C INNERJOIN             PolicyUserRole PUR ON             C.PolicyID = PUR.PolicyID INNERJOIN             Users U ON             PUR.UserID = U.UserID wherePath

How to find when Microsoft going to end the support for any SQL server versions?

Image
Please look into the below website http://support.microsoft.com/lifecycle/search/?sort=PN&alpha=SQL Here you can search any Microsoft Products lifecycle as like below.

[Execute SQL Task] Error in SSIS Merge statement

[Execute SQL Task] Error: Executing the query "EXEC PC_Procedure_name1 EXEC PC_Procedure_name2..." failed with the following error: "The MERGE statement attempted to UPDATE or DELETE the same row more than once. This happens when a target row matches more than one source row. A MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to ensure a target row matches at most one source row, or use the GROUP BY clause to group the source rows.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Resolution:
One of the options is presence of duplicates, before running the merge statement, please try to check the duplicates by running below query by combining more than 1 columns. Scripts for finding duplicates by combining n number of columns SELECT q.KEY_FIELD, COUNT(*) FROM ( SELECT --(column1 ,column2,coulmn3) C…

[OLE DB Destination] Error in SSIS:

[OLE DB Destination [9]] Error: There was an error with input column SYSTEM_DATE_TIME (130) on input "OLE DB Destination Input" (22). The column status returned was: "The Value could not be converted because of a potential loss of data." Resolution: Check any invalid date value in source csv file, if yes then, change it to 01\01\1753.(Or try to change the  Invalid date value to valid date value).
That’s all.

[SSIS.Pipeline] Error :

[SSIS.Pipeline] Warning: The output column "Columnname" (127) on output "Flat File Source Output" (2)  and component "Flat File Source" (1) is not subsequently used in the Data Flow task. Removing this  unused output column can increase Data Flow task performance. Resolution: Check the all columns in source table match with columns in destination table, if not uncheck extra column  From the 'Available External Columns' in the Flat file Source Editor by right clicking the Flat file Source.

Database MAIL( sp_send_dbmail) Error in SQL2008 R2:

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2012-08-31T18:10:23). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Unable to relay). 
While sending mail from SQL job through sp_send_dbmail procedure in SQL2008R2, i am getting above error.2 identical emails are send (with same distribution list and same body), with one minute of difference.
Resolution:
One of the email id in the recipients causing the above issue. So I have resolved that issue by changing the wrong mail id in the recipients list to correct mail id.
Eg .(if SMTP server related to your office smtp server. Then sp_send_dbmail will not send mail to another office server mail id in the recipients list.)

SSIS2008R2 Error: 0xC0209303 at Package:

When i trying to load data from MS access (MDB) to SQL ,i am getting the below error.
Error: 0xC0209303 at Package, Connection manager "mdbfilename": SSIS Error Code DTS_E_OLEDB_NOPROVIDER_64BIT_ERROR.  The requested OLE DB provider Microsoft.Jet.OLEDB.4.0 is not registered -- perhaps no 64-bit provider is available.  Error code: 0x00000000. An OLE DB record is available.  Source: "Microsoft OLE DB Service Components"  Hresult: 0x80040154  Description: "Class not registered". Error: 0xC020801C at Data Flow Task mdbfilename, OLE DB Source [1]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager " mdbfilename " failed with error code 0xC0209303.  There may be error messages posted before this with more information on why the AcquireConnection method call failed. Error: 0xC0047017 at Data Flow Task mdbfilename, SSIS.Pipeline: component "OLE DB Source" (1) failed vali…

How to find the SQLlogins have proper password except blank,samelogin name as password And ‘password’ as password?

--To find the blank password set for any sql logins. --PWDCOMPARE Hashes a password and compares the hash to the    hash of an existing password.   PWDCOMPARE can be used to search for blank SQL Server login passwords or common weak passwords.
SELECT name FROMsys.sql_logins WHEREPWDCOMPARE('', password_hash)= 1 ;
--To find the password set as like the same name of sql login name    for any sql logins.
SELECT name FROMsys.sql_logins WHEREPWDCOMPARE(name, password_hash)= 1 ;
--To find the password set as like 'password' for sql logins

SSRS Configuration step by step(SQL SERVER REPORTING SERVICES)

Image
Step1.Click Start->All Programs->Microsoft SQL Server->Configuration Tools->Reporting Service Configuration Manager.

Reporting service configuartion dialog box opens(Below Figure )




Step2.Specify the Server Name and report server instance.Click Connect buttton.

Reporting Service Configuaration Manager window opens to show the status of  current report server instance.




Step3.Select Service account tab from the left pane of RSCM window to open the service account page.



You can get an option choose service account by choosing the radio button in the above figuure and Click Apply Button.

Step4.Select the Web Service URl tab from the left pane of RSCM window to open the Web Service URL Page as shown in the below figure.



Configure URL to access the report server and also you can specify more than one URL to access the same Report Server.
Then Click Apply Button.

Step5.Select Database tab from the left pane of RSCM window to open the Database page as shown in the below figure.



Ab…

Three different ways to find blocking in SQL

SP_WHO2 It shows blocking by the presence of blkby column value. Sysprocesses select * from master..sysprocesses where blocked >0 Activity Monitor Open Activity Monitor at any time by pressing CTRL+ALT A.

Difference between 3 types of Restoring modes.

S.No With Recovery With Norecovery Standby\Readonly 1 Leave the database in online mode. Leave the database in restoring mode. Leave the database in  readonly mode. 2 No further restore is possible. Further restore is possible. Further restore is possible. 3 User can able to access Users can’t. Users can able to read the  databases. 4 Rollback the uncommitted transactions Does not rollback the uncommitted transactions It undoes uncommitted transactions , but saves the undo actions in a  standby file so that recovery effects  can be reverted.

Difference between database roles and server roles

S.No Server Roles Database Roles 1 It is defined at the server level. It is defined at the database level. 2 It exists outside of user databases. It exists in each database. 3 There are fixed server roles only. User defined database roles available. 4 Bulkadmin,dbcreator,diskadmin, processadmin,securityadmin, serveradmin,setupadmin and sysadmin(8) Db_accesadmin,db_backupoperator, db_datareader,db_datawriter, db_ddladmin,db_denydatareader, db_denydatawriter,db_owner and db_securityadmin(9)