Wednesday, May 14, 2014

Fetch row count of all the tables in single query from a database

USE <DataBaseName>
GO
SELECT '[' + SCHEMA_NAME(t.schema_id) + '].[' + t.name + ']' AS fulltable_name
, SCHEMA_NAME(t.schema_id) AS schema_name
, t.name AS table_name, 
i.rows
FROM sys.tables AS t INNER JOIN
sys.sysindexes AS i ON t.object_id = i.id AND i.indid < 2 
--and SCHEMA_NAME(t.schema_id) = 'dbo'

Tuesday, May 13, 2014

The acquire connection method call failed error

Sometimes the actual error lies somewhere and the error message directs us to look at something else. We end up wasting time in this process as the error message diverted us. This is kind of error in this category.

"The AcquireConnection method call to the connection manager failed with error code 0xC0202009"

If DelayValidation is not set to true, SSIS engine uses the design time values of a task until it actually runs a task. Since we are dynamically setting the connection manager, instead of using the dynamically set value (Which it uses anayway while running the task), it tried to validate the task with the design time values set for the connection manager. Unfortunately, the service account with which the job is running doesn't have access to the server and database set during the design time for the connection manager. So, the validation of the task failed causing the job to fail.


Set the "DelayValidation" property to true in your package. It will work fine.

Monday, May 5, 2014

Deploying SSAS Cube through Command Line Utility

We can deploy SSAS Cube through Command line utility. I have created a batch file which will auto build the project solution and execute the command through exe

----------------------------------Start---------------------------------------------
ECHO ON
ECHO Build started . . .

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe D:\SSAS\CubeProject\CubeProject.sln/build development /out ssasbuild.log


ECHO Build completed . . .
ECHO XMLA Script generation started

Microsoft.AnalysisServices.Deployment.exe D:\SSAS\CubeProject\CubeProject\bin\CubeProject.asdatabase /d /o:D:\SSAS\CubeProject\CubeProject\cube.xmla

ECHO XMLA Script generation complete . . .
ECHO OFF

PAUSE Completed

-----------------------------------End----------------------------------------------

Reference:  http://technet.microsoft.com/en-us/library/ms162758.aspx