Tuesday, August 31, 2010

SSRS  Reporting
=SSRS!D21Fields!period1.Value,2)
=Credentials!A25+Credentials!B14first(Fields!period1.Value)-last(Fields!period1.Value),2)
=D14Fields!MANDT.Value="","null",Fields!MANDT.Value)
=First(Fields!MANDT.Value, "ds_GetColPos1")
=B16+SSRS!C14KI_B_001d.rdl
=iif(Fields!MANDT.Value="","null",Fields!MANDT.Value)
=countrows("ds_Getreportcontent_pos1")<>0
=(Fields!ppwb_quote.Value*100)/100
=Mid(First(Fields!Sum_H.Value, "ds_GetColPos1"),2)
=Credentials!A25+Helper!B28

Monday, August 30, 2010

@echo off

@echo Please wait while the process executes ....

SET USER=sa
SET PASSWD=Passwor
SET DB_SERVER=Jegan
SET DB_NAME=Mas_DB

SET ERR_LOG=LoadDatabase.log
SET TEMP_ERR_LOG=tmpError.log

DATE /T >> %ERR_LOG%
TIME /T >> %ERR_LOG%
cd Scripts

sqlcmd -S %DB_SERVER% -U %USER% -P %PASSWD% -i Killprocesses.sql >> %ERR_LOG%
sqlcmd -S %DB_SERVER% -U %USER% -P %PASSWD% -i DBDrop.sql >> %ERR_LOG%
sqlcmd -S %DB_SERVER% -U %USER% -P %PASSWD% -i RestoreDB.sql >> %ERR_LOG%

cd ..

@echo Running file in Database for Tables >> %ERR_LOG%
cd Tables
::For %%i in (bd_disclaimer.sql) do call :executeFile "%%i"
cd ..


@echo Running file in Database for Metadata >> %ERR_LOG%
cd Metadata
::For %%i in (.sql) do call :executeFile "%%i"
cd..


@echo Running file in Database for Procedures >> %ERR_LOG%
cd Procedures

::Reports
For %%i in (usp_SP1.sql) do call :executeFile "%%i"
For %%i in (usp_SP2.sql) do call :executeFile "%%i"


::Master Package
For %%i in (Usp_SP3.sql) do call :executeFile "%%i"



cd ..





@echo Process Completed >> %ERR_LOG%
DATE /T >> %ERR_LOG%
TIME /T >> %ERR_LOG%
@echo Process completed . Please refer %ERR_LOG% for any possible errors.
pause

goto :eof

:executeFile

@echo Processing %1 file >> ..\%ERR_LOG%

IF DEFINED USER (
IF "%USER%" EQU "$DBLoginUser$" (
sqlcmd -S %DB_SERVER% -d %DB_NAME% -E -i %1 -o %TEMP_ERR_LOG%

) ELSE (

sqlcmd -S %DB_SERVER% -d %DB_NAME% -U %USER% -P %PASSWD% -i %1 -o %TEMP_ERR_LOG%
)
) ELSE (
sqlcmd -S %DB_SERVER% -d %DB_NAME% -E -i %1 -o %TEMP_ERR_LOG%


)

TYPE %TEMP_ERR_LOG% >> ..\%ERR_LOG%
DEL %TEMP_ERR_LOG%
goto :eof

:eof