Wednesday, October 16, 2013

SSIS:Logging

Refer the Source Video: SSIS:Logging

Right click in Package - Logging

Sql Task

Containers: Flexibility to choose a task
                  ( allows task wise track error messages.)

Logs     Details(Event wise error messages: On Error, OnPostExecute,OnPreExecute)

Provider Type:
SSIS log  Provider for windows
SSIS log  Provider for Text files (.txt)
SSIS log  Provider for XML files (.xml)
SSIS log  Provider for SQL Server
SSIS log  Provider for SQL Server Profiler (.trc) {Only for 32bit, change in right clicking on Project Explorer,,)

Mostly used:Windows & SQL Server one

Windows see in Windows Event Viewer:
Select * from SYSSSISLog 

Tuesday, October 15, 2013

SSIS:Deployment using Project Deployment Model

Refer Source Video:SSIS 2012 Deployment using Project Deployment Model Video

--------------------------------
Prior:How to create a Catalog?
----------------------------------
Project Deployment Model  is new in 2012:
Folder file names: Package,Project.params,SSIS Project Deployment Model,SSIS Type Integration Services project file
----
Method1:Right click on project-choose Deploy
Server:Database Engine Server Name ( where SSISDB Catalog is their).
                        Path:SSISDB\Test

Copy the commandline parameter to Notepad.
The project is deployed to Database Engine(--verify)
Microsoft SQL Server Management Studio:
  Integration Services Catalogs-SSISDB-Test-Projects-SSIS Project Deploment Model-Packages-Package.dtsx
  SQL Server Agent
--
After running it the Bin\Deployment \ folder is created with file SSIS Project Deploment Model.
-----
Method2: Right click on Project Explorer->Build
Prior to choosing "Build" remove the Bin & Object folder

It will create Bin\Development , creates SSIS Project Deploment Model (Integration Services Deployment File) [Instead of running this , move to another Server & Run from their]
just double click the file it will run the wizard.( Same as Method 1 wizard)

Method3: Running from Commandline (---Notepad)
cd %ProgramFiles%\Microsoft SQL Server\..\Binn
isdeploymentwizard.exe  whatever copied for commandline

--Project deployment method whole Project is deployed not package wise.If any one modifying a package , make sure that latest one is compiled.

Monday, October 14, 2013

SSIS:Deploying Package

Refer the source Video:Deploying Package

SQL Server 2008 :Deploy package in 2 ways File system,MSDB.
Right click->Package Configuration->(check) Enable package configuration ->
Configuration type:XML configuration file 
( )Specify configuration settings directly
   Configuration file name: create a file 

( ) Configuration location stored in environment variable

Specify what values we want to read from the configuration file.Map the "Server Name" Value & then "Table Name" Value.

For creating Deployment Utility:Choose Solution->Right click->Properties->"Deployment Utility"  CreateDeploymentUtility:True

When from Menu->Build , it creates in the Path , mentioned in "Full Path"
..\bin\Deployment folder all files are their. .dtsx files, .SSISDeploymentManfest, .dtxConfig 

File system:
-----------------
i.Double click on .SSISDeploymentManfest , it will start the package installation wizard.(check)-File System Deployment  - SQL Server deployment 
   ( stores in MSDB database , burden on Sql Server)
just shows the   .dtxConfig file parameters.
ii.Create a job: SQL Server Agent - job - New Job  type:SQL Server Integration Services Package
Package Source: Choose "File System"

After Finishing steps , right click on job ->Start the job.
-------
MSDB:
---------
i.Double click on .SSISDeploymentManfest , it will start the package installation wizard.
(check)-File System Deployment  - SQL Server deployment 
   ( stores in MSDB database , burden on Sql Server)
just shows the   .dtxConfig file parameters.
ii.Create a job: SQL Server Agent - job - New Job  type:SQL Server Integration Services Package
Package Source: Choose "SQL Server"

Check on MSDB database that the job is created.After Finishing steps , right click on job ->Start the job.


-------

Thursday, October 10, 2013

SSIS:Package Configuration

Refer Source Video: SSIS : Package Configuration
Package Configuration
1.)XML Configuration
a.) Direct
b.) Indirect ( Using Environmental Variables)
2.)Environment Variables
3.)SQL Server Configuration
4.)Parent Child Configuration
5.)Registry Entry
------
what is the basic need for package configuration.:SSIS package go through development env. , it has to go through testing phase,uat & then to production.That mean port SSIS to the Production.Go To go to BIDS & change the connection.Microsoft allows to do in more easier way.The "connection string" , variable values," script tasks "to point to right database -

1.Right click on Package workspace Area - Choose "Variable" -  2.SQL query analyzer:

Select * from Production..TransactionHistory where ProductID=799 and TransactionDate<>'2007-09-01 00:00:00:000'

3.The Package when runs just shows Count of Orders for a "Product" for a particular "date".

Environment Variables:Generally not used. 
-------------------------------
My Computer->Properties->system->Advances->Environmental Variables

a.Create an "Environmental Variable" : ProductId  Value:799
b.Close the open session of "BIDS" , reopen the .sln (solution) In the "Package" window, right click anywhere choose "Package Configuration" , choose check box "Enable package configurations".

It opens a wizard , add a new package configuration.
Configuration type:Environment Variable
Load all Environment Variables: choose :"ProductId" , then Map it to,
"ProductId" Filter
Package
Variables
...
ProductId_Filter
 - properties

Now the value shows "799" , now after running the package it will take the Environment Variable value.At the runtime it does not take the "Package Level Variable" value but the "Environment Variable" value.

Registry Entry: Not at all used.
-------------------
1.start-run-regedit-
HKEY_CURRENT_USER- add a key-say "SSIS",right click on it,New,String Value-call "Value"
Value Data - '2007-09-01 00:00:00 000'
right click anywhere choose "Package Configuration" , 
It opens a wizard , add a new package configuration.
Configuration type:Registry Entry
Registry Entry:SSIS

It should map to the DateTransaction_Filter - Value
If you change any value in Environment variable, need to reload the Environment variable again.
--------------------
Through Environment variable : Dynamically changing variable values at run time.
----------------------
XML Configuration:That is generally used.
--------------------------
a.)Direct b.)Indirect
a.)Direct :right click anywhere choose "Package Configuration" 
Configuration type:XML configuration file
-Specify configuration settings directly
Configuration file name:c:\temp\ abc.dtsconfig
       Connection Manager-Database Connection
Map:ConnectionString of  Database(not variable)

This shows the abc.dtsconfig file.Open it to see its XML file defining the connection.
In this file change the Catalog: name which is the Database Name , then running
the SQL will show records found from that database.
Right Click on Databaseconnection: can see the Database name whats in the XML
file abc.dtsconfig
b.)Indirect:Copy the path of the abc.dtsconfig  from Configuration file name:c:\temp\ abc.dtsconfig
Create an environment variable:ConfigPath and it will have info. where this abc.dtsconfig
file is which is holding connection information to database.

As the New Env. Variable is added, need to restart the package.

right click anywhere choose "Package Configuration"  - when tried to edit it gave error,

so removed that and created another and 

Configuration location is stored in environment variable:ConfigPath
--------------------------
3.)SQL Server Configuration

Remove the "Environment Variabale" , "Registry Entry" Configuration from "Package Configuration" .

Only remaining the Configuration type:XML configuration file (b.)Indirect , which has
the connection information in an Environment Variable that points to the path
"abc.dtsconfig".

right click anywhere choose "Package Configuration" 
Configuration type:SQL Server
New ->Database->specify "Server name" "DataBase":

You will see a New Table.In the next window.

CREATE TABLE [dbo].[SSIS Configuration]
(
ConfigurationFilter   NVARCHAR[255] NOT NULL,
ConfigurationValue   NVARCHAR[255]  NULL,
PackagePath     NVARCHAR[255] NOT NULL,
ConfigurationValueType NVARCHAR[255] NOT NULL
)

Remove the gap between the tablename

CREATE TABLE [dbo].[SSISConfiguration]
(
ConfigurationFilter   NVARCHAR[255] NOT NULL,
ConfigurationValue   NVARCHAR[255]  NULL,
PackagePath     NVARCHAR[255] NOT NULL,
ConfigurationValueType NVARCHAR[255] NOT NULL
)

This will create a table and this one holds all values that is specified in the Environment
variables. So for moving the configuration details from "Dev" to "Test" or "Production"

The script generation sql of this table and the Environment Variable details to be given
to the person who is moving it.

Configuration filter:VariableDemo { in the screen : Configuration type:SQL Server }

Map: ProductID,TransactionDate { Now as the Environment Variable value deleted , it 
        takes the variable values).
--------------------------
Briefnote:In the "Package Configuration" , specifying "connection" and Mapping "Variables" package level, to take value or it takes from environment variable.
The connection parameter details file path can be in a environment variable.
In 'SQL Server Type" : SSISConfiguration table holds all variable values.
--------------------------
Query analyzer: Select * from SSISConfiguration

Configuration filter:VariableDemo  thats defined above uniquely tells this package filter
and PackagePath holding the variable values name.
--------------------------
SSIS Package i.e dtsx file open in notepad , you will see its a XML file.
--------------------------
UPDATE  SSISConfiguration SET  ConfigurationValue= WHERE  PackagePath=
AND ConfigurationFilter=
--------------------------
ConnectionManager:
DatabaseConnection
DEV.TestDB -> the new value in the table "SSISConfiguration" and runs the package.
--------------------------
For Migration:Actually the values in Environment Variables.

Choose DB:rightclick->Task->Generate Script
Choose Table 'SSISConfiguration" , 
Table/View:Option choose "Script Data" -> True
Then choose Script to Query Window.

It will show Create statement for  SSISConfiguration table and even the Insert statement
for the variables.The Deployment person will run in that environment say Production.

---
Guideline:Just only the 'Environment Variable" where things need to change only.

So the  3.)SQL Server Configuration XML configuration file (b.)Indirect , which has
the connection information in an Environment Variable that points to the path
"abc.dtsconfig".
----

Monday, October 7, 2013

SSRS:Deployment - fixing Rsaccess denied

------------------------------------------------------------------------------------------------------------------------


Refer the Source Video:Deploying SSRS reports 2008,R2 and 2012


------------------------------------------------------------------------------------------------------------------------


Summary:

1. In the "Reporting Services Configuration Manager" 

"Report Manager Url" <- using the url the user can see the report.

"Web Service Url" <- location where report is deployed.

(copy this "Web Service Url"  and in the report design solution explorer , properties,

, in the Target Url , paste it  & deploy the report)


2.For "fixing Rsaccess" , in the IE  options , in 
i.advanced tab "Windows authentication" selected, 
ii.in "local intranet" security see the "Automatic log using current user & password" is checked.



------------------------------------------------------------------------------------------------------------------------

SolutionExplorer:Shared Data Sources(...rds):Shared DataSets:Reports(...rds)

Report Server Url - Webservice report url - allow to deply to that location

Report Manager Url - allow to use the report

1.Program->SQL Server Management Studio-
Analysis Services
Configuration Tools
-Reporting Services Configuration Manager
-SQL Server Configuration Manager
-SQL Server Error & Usuage Reporting
SQL Server Installation Center
Data Quality Services

-Reporting Services Configuration Manager
scr1:Server Name: Report Server Instance:SQL2012
scr2:-Service Account -Web Service URL -Database -Report Manager URL
-Email Settings -Execution Account -Encryption Keys -Scal-out Deployment
Current Report Server: SQL Server Instance,InstanceID,..Server Database Name:ReportServer$SQL2012,....
2.Check first the "Report Manager URL" , gives the error message
User ... does not have required permissions.Verify that sufficient permissions have been
granted and Windows Account Control(UAC) restrictions has been addressed.

[UAC thinks this user is not part of "Administrator Group". Even for users when they enter windows userid, password or active directory userid,password , ..]
a)Certain options to set in IE brower settings:Tools->Internet Options-Advanced chk:(checked) Enable Integrated Windows Authentication : Security tab:local intranet:sites:advance:localhostname appears
Security:CustomLevel:chk:Checked:Automatic logon with current username & password, close IE Start Program:IE:Run as administrator:Open the Report Manager URL

b)-Reporting Services Configuration Manager-Web Service URL (copy the Webservice Report URL)
Go to BIDS(Microsoft Visual Studio)(where we deploy our report):Open the report-Project(right click) -Properties:TargetServerURL:paste the Webservice Report URL :Right Click on Project:Choose Deploy
IE Start Program:IE:Run as administrator:Open the Report Manager URL , refresh it would show the report.

------------------------------------------------------------------------------------------------------------------------

Refer the Source Video:Report Deployment

------------------------------------------------------------------------------------------------------------------------

Summary:

1.In the "project" properties , Target Url is  the "Report manager url" , get that from configuration tool and paste it. Then deploy it.

2.In the report manager after deploying the report, when one click on "Data Source",

generally a  "domain\administrator" specified and the , check the "windows credential" to be used.

The user when try to run the report it uses the "administrator" account , that has access to the
report server.


------------------------------------------------------------------------------------------------------------------------

HR Reports (Project)
-Shared Data Sources
   -dsetAdventureWorks
-Reports

1."DataSource" & "Report" need to be deployed to the Server.
2.If you right click on "Shared Data Sources" & right click "Deploy" , it won't work as the Project "HR Reports" ( to point to the Server in Question).
a.Right Click on "HR Reports" , choose properties
Configuration Properties
Deployment
OverwriteDataSources:False{ if the shared DataSource,connection parameter changed,difficult}
TargetDataSourceFolder : Data Sources
TargetReportFolder: HR Reports
TargetServerURL:
(http://Servername/reportServer) - //localhost:8081/reportServer)
note1:{ instead of localhost if there is ServerName then will be used in TargetServerURL)
note2:In a Server,multiple Services are running , port80 generally WebService,so in configuration
setting 8081 as Report Server.
b.Highlight the  Project "HR Reports" , "Deploy" - it builds the project.One can indivially choose
"DataSources" and Reports to deploy too.
c.To verify: Goto Report Server:http://localhost:8081/Reports/Pages/Folder.aspx
See on the screen : Data Source      HR Reports
i.Click on "Data Source" -
in Connectstring - if test server mentioned change to point to right one, Catalog (<- Database)
Name:
Description:
Data Source Type:
Connection string: Data Source=..;Initial Catalog=AdventureWorks
Connect using:
-Credential supplied by the user running the report
    Display the following text to prompt user for a user name & password
    Use as windows credentials when connecting to the data source
-Credentials stored securely in the report server
  User name:    Password:
   -Use as Windows credentials when connecting to the data source
   -Impersonate the authenticated user after a connection has been made to the data source
-Windows integrated security
-Credentials are not required {Unsecure}
notes1:
{-Windows integrated security
Administor can run.Windows Integrated but another user  wonot be able to}
notes2:
{-Credentials stored securely in the report server
User name: domain\administrator Password:
-Use as Windows credentials when connecting to the data source
Any user having windows credential will go via. domain\administrator
 }
Apply Move Generate Model Delete

------------------------------------------------------------------------------------------------------------------------

Refer the Source Video:Reporting Services - Configuration

------------------------------------------------------------------------------------------------------------------------

Summary:

1. In the configuration tool , "service account" , better to specify a active directory account.

2.WebService url , Report manager url

note:
2005  the port 80 runs the iis web servive.
2008  there is not iis (port used is 8081), it has it's own web service as this has clustering mechanism which is when
one server down another runs the report. 
3.Database: create the report database where report will reside.

4.Email account: domain\someaccount -> reports are emailed

5.Execution account: use an "active directory" account when jobs run it uses it.

6.scale-out Deployment: add a server
   

------------------------------------------------------------------------------------------------------------------------

start-programs

Report Server Mode: Native
But for share point to be change.

Service Account:
Use built-in account:Local System
Use another account:
For one active directory account to cater to all servicces.

2005:
2008:clustering[Fault torlance - one goes down other can start,end](not use IIS )

Web Service URL:8081
   80 - Web Service running
   21- FTP
   25-Mail
   SSL Certificate

Database:For Share Point , change

Email Setting:
     Use SMTP

Execution Account:
     For schduling (active directory)

Encryption Keys:
   sensitive information (
     Backup the key

Scale-out Deployment;
   Clustering

------------------------------------------------------------------------------------------------------------------------

SSRS:(SSRS) report with drill down functionality.


------------------------------------------------------------------------------------------------------------------------


Refer the Source url:(SSRS) report with drill down functionality

------------------------------------------------------------------------------------------------------------------------

Summary:

Create the report using "Report Wizard" , in the process it will show an option for "Enable Drilldown", after choosing it the report will have drilldown feature.

------------------------------------------------------------------------------------------------------------------------


1.Programs->BIDS->Visual Studio 2008->
File-New Project->Report Server Project Wizard (Name:)
Shows Report wizard
-Shared data source - new datasource(name,connection string "Edit" button- )
[Make Shared DataSource]
Query Builder:choose Table-columns (shows Sql query)
Tabular Matrix (choose layout)
Group-
In the Table Layout choose below options
-Include subtotals -Enable drilldowns
Formatting -

Show the Report Server name


------------------------------------------------------------------------------------------------------------------------

SSRS:Creating SSRS Subreports

------------------------------------------------------------------------------------------------------------------------


Refer the Source Video: Creating SSRS Subreports

------------------------------------------------------------------------------------------------------------------------

Summary:

Create one report. Then to that report drag "Sub Report" control , right click and in the 
properties specify which report you want to show. Here choose "Parameter" section and 
pick the "parameter" , say the parameter of first report "@region" and the sub report also
need to filter data based on that.

------------------------------------------------------------------------------------------------------------------------


Main report – Sub Report:( allow to pass parameters)

1.DataSet:change sql :where countryregioncode=@CRC , also choose Parameter.,but no value their.Then under Parameter- see CRC then check in DataSet , the Parameter value , it will show now @CRC.
2.Solution Explorer->Report->New Item->Report

Report Data
----------------
Built-in Fields ,Parameters,Images,Data Sources,Data Sets

Data Source:create a new connection string.Edit button
Data source:Microsoft SQL Server (SqlClient) Server name:
-Use Windows Authentication – Use SQL Server Authentication
Connect to database

After creating the conection – go to DataSet ,in “Options” specify the Data Source.
Click on Query Designer from the above screen window, choose Table, here the
sql shows like Select TOP 10 ….

In the Datasets , choose parameters and in WHERE clause introduce the parameters
CountryREgionCode=@CRC

3.Design of Report- View Toolbox – Drag a Table – From DataSet which shows the
Fields , Just drag & drop as Table fields.

4.Call another Report.From the same View-Toolbox , just drag the “SubReport”
control to the Report Design View.Right click on sub report and choose 'Sub Report
Properties”, From the dropdown choose which report to use as subreport.
Choose “Paramer” ,choose @CRC, so from main report the parameter is passed to

the subreport.

Thursday, October 3, 2013

SSRS:Creating a Report with Parameters


------------------------------------------------------------------------------------------------------------------------


Refer the Source Video:Creating a Report with Parameters


------------------------------------------------------------------------------------------------------------------------

Summary:

1. "DataSet" :  Select .... From ... Where ...
      
      Where condn. -> tells the "Parameter"

     After the "Where" condn. is specified , it creates a "Parameter"

2. To create a "Dropdown List"

    i."Dataset" - build the query to show the values.
    ii. "Parameter" - specify the above dataset.

------------------------------------------------------------------------------------------------------------------------


DataSets: choose query
1)Select...Where TerritoryID=@TerritoryID
It adds.
Report
Parameters
TerritoryID
2)Need a Dropdown & select
DataSet-Add DataSet
Query:Select Distinct TerritoryID ..
Go to Parameters: Avalaible value:specify it

------------------------------------------------------------------------------------------------------------------------


Refer the Source Video: Creating a SSRS Report with cascading parameters

------------------------------------------------------------------------------------------------------------------------

Summary:

Requirement: Based on "Customer" ,  the "Territory" drop down shows values.

1. "DataSet" : sql query for "Territory" add "Where" having the  @Customer parameter.

2. "DataSet": sql of main dataset, add both "Where' having @Customer , @ Territory

------------------------------------------------------------------------------------------------------------------------

CustomerId - then populate the Territory Id
DataSet: Query:Distinct CustomerID

Choose the DataSet:TerritoryId
Query:change sql having Where CustomerId=@CustomerID

Then it creates a paramerter:There choose and choose "Available Values"
2nd dropdown is greyed out.
Note: If you do want dropdown you specify in parameter no drop down,it shows just textbox.

------------------------------------------------------------------------------------------------------------------------


Wednesday, October 2, 2013

Reporting Services

Refer the Source Video: 

A server based reporting.
Report are developed 
-in Report Builder  -in Visual Studio -in SQL Server Data Tools(SSDT) -by hand-writing XML

Report Services report 
-..stored in a SQL Server Database Engine - a .rdl file - embedded into .NET applns. 
- integrated with SharePoint

Report Delivery
- to email,mobile devices, & browers -via SSRS web service -on a schedule
 -.when the data changes

SSRS 2012: - Standard version 
-free version in Express Edition (SQLServerExpresswithAdvancedServices)

Architecture of  SQL Server 2012:Reporting Services
-SSRS  can be from small to Big organization -3rd Part companies - provide more look,feel etc..

There  3 components: 
-client ( one requesting the report) - report server ( who you request to)    .SSRS
-data (SQL Server , Oracle, DB2 etc.)
(If you have OLE DB or ODBC provider to get data, even 3rd party ,so any source can get data)

Client -> SSRS (Server) -> Report A ( 3 different sources[sql server relational,Dashboard,Oracle)
.pdf,excel format
Traditional client -server -client request (via a url) of the report server
http://myreportserver.learnitfirst.com/ReportA.rdl

-Server receives that
Report Server make request to Data Source ( still its client-server)
 - client is the report server - server (Data Source)

Report author/administrator can specify how to authenticate to the data source 
windows authentication, sql server authentication.

All client request to report server are made via URL
-users working with applications links to report
-SSRS has the own web server( do not need to install IIS web server to it)
note:nice change in 2008 that with reporting server the web server is installed

Report Server - does more than just connecting to the data source & creating report
- manages secure access to the reports,can schedule delivery, can render report in multiple way etc.