Showing posts with label ssis. Show all posts
Showing posts with label ssis. Show all posts

Sunday, March 11, 2012

Add services to SSIS IServiceProvider model?

Is there any mechanism for being able to add custom services into the SSIS service provider model so that they can be used by components at design and runtime? i.e. if I can currently access service implementations such as the IDtsConnectionService from the Initialize method of a custom component (or in a UI type editor), is there a way to add a service of my own?

Thanks

Interesting - we've never thought about this. What kind of services do you plan to add there? Note that the services are for design time only, they are no available at runtime.|||

Thankyou for the response - actually design-time only services would still be useful in this case - I'm writing custom components against a JD Edwards Oracle database, but I'm having to interpret the data dictionary schema for business users to assist them in writing their queries (it has to be available offline).

I currently have metadata available to the components so that they can present meaningful field information to users before it is mapped onto the underlying schema, but it would be extremely useful if my components could utilise a service that wrapped this metadata functionality for them.

Add role to Analysis Services Database

Does anyone know if there is a way to use a SSIS task to add a role to SSAS cube? At the moment I use Management Studio, Right Click "Roles" under the cube and go through New Role wizard, but I'd like to be able to include this in a SSIS package instead.

Thanks

Richard

You can do it through the Script task, employing the AMO (Analysis Management Objects) library. I recommend creating the role in SSMS first but instead of submitting the change to the system, clicking the Script button at the top of the New Role dialog box to view the XMLA\ASSL script it creates. The script can be a guide for your AMO development (as AMO is just a wrapper for the XMLA\ASSL languages).

Good luck,

Bryan

|||

Following along with what Bryan had mentioned you could script a role using Management Studio to use as a template then use and expression variable and an Analysis Services Execute DDL Task in SSIS to accomplish this as an ongoing solution. The Analysis Services Execute DDL Task will allow you to customize and execute the role creation/modification command and avoid having to use the script task.

Hope that helps!

|||

Thanks! Wow. Cool. Kind of got it to work but don't know quite how!

In SSMS scripting the role worked nicely and was able to run it in a query window and it did exactly what was needed.

I'm pretty useless at VB.NET so trying the Script Task in SSIS, I hit design script, added AMO as a reference and pasted the SSMS script where it says "Add your code here" inside of Public Sub Main(). Of course it doesn't work that simply. But is there a really simple answer to what I need or am I going to have to go off and learn some VB.NET ?

So then I tried Execute DDL task, and muddled my way around it. I save the original script as a .xmla file in the file system. Then in DDL task under DDL selected File Connection as SourceType and connected to this file. Executed task and it did what was needed.

I guess this is good enough as it works, but I wouldn't mind understanding better what I am doing!!

Thanks

Richard

|||

Here is a code sample from a past project where we created a role for each entry in a table. (Just sharing that last part so you understand the database query in the code.)

Code Snippet

' Microsoft SQL Server Integration Services Script Task

' Write scripts using Microsoft Visual Basic

' The ScriptMain class is the entry point of the Script Task.

Imports System

Imports System.Data

Imports System.Data.SqlClient

Imports System.Math

Imports Microsoft.SqlServer.Dts.Runtime

Imports Microsoft.AnalysisServices

Public Class ScriptMain

Public Sub Main()

Dim server As New Microsoft.AnalysisServices.Server

Try

' CONNECT TO THE SQL SERVER ANALYSIS SERVICES (SSAS) SERVER

server.Connect("localhost")

' THE SSAS DATABASE TO CONNECT TO

Dim database As New Microsoft.AnalysisServices.Database

database = server.Databases.FindByName(Dts.Variables("AnalysisServicesDatabaseName").Value.ToString)

' GET A LIST OF ROLES TO CREATE

' Connection String comes from the 'METADATA' Connection Manager

Dim myConnection As New SqlConnection(Dts.Connections.Item(0).ConnectionString.ToString())

Dim myCommand As SqlCommand = New SqlCommand("SELECT ID FROM dbo.Roles (NOLOCK) WHERE ID > 0", myConnection)

myConnection.Open()

' FILL THE DATAREADER

Dim dr As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)

' LOOP THROUGH THE DATAREADER AND BUILD A ROLE

If (dr.HasRows) Then

While (dr.Read())

CreateRole("Role for ID ", dr("ID").ToString, database)

End While

End If

' CLOSE THE DATAREADER

dr.Close()

' CLOSE THE SQL SERVER DB CONNECTION

myConnection.Close()

Dts.TaskResult = Dts.Results.Success

Catch ex As Exception

Dts.Events.FireError(1, ex.TargetSite.ToString, ex.Message, "", 0)

Finally

' DISCONNECT THE SSAS SERVER

server.Disconnect()

End Try

Dts.TaskResult = Dts.Results.Success

End Sub

Private Sub CreateRole(ByVal rolePrefix As String, ByVal dsNumber As String, ByVal asDatabase As Database)

Try

' WILL CREATE A ROLE IN THE ASSIGNED DB WITH THE NAME AND KEY VALUE

Dim newRole As Role

' CREATE THE NEW ROLES NAME

newRole = asDatabase.Roles.Add(rolePrefix + " " + dsNumber)

newRole.Description = "Role for " + rolePrefix + " " + dsNumber

newRole.Update()

Catch ex As Exception

Throw New Exception(ex.Message.ToString())

End Try

End Sub

End Class

Thursday, March 8, 2012

Add Reference to Excel in Scripting tool in SSIS 2005

How can I add a reference to the Microsoft excel 2003 in the script tool in SSIS 2005? I need to automate Excel for formatting.

Thank you.

Dan

Adding refereneces to external assembleis is documented in Books Online -

Referencing Other Assemblies in Scripting Solutions

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

For Office applications like Excel that are COM, you will need to download the PIAs if you have not already.You will need to reference the PIA.

Download - http://www.microsoft.com/downloads/details.aspx?FamilyID=3C9A983A-AC14-4125-8BA0-D36D67E0F4AD&displaylang=en

General page of on PIAs if you are not familar already - http://msdn2.microsoft.com/en-us/library/aax7sdch.aspx

Monday, February 13, 2012

Adapters in SSIS?

Are there adapters available to connect to SSIS for

1. Siebel

2. IBM MQ

Please let me know what are the alternatives if they don't exist.

I am still struggling to understand the core functionality difference between BizTalk and SSIS?

Thank you.

Not out of the box but I believe a company called Attunity build adapters for other systems so you might find them useful.

Core difference between SSIS and BizTalk? That's an incredibly open question. At a very very high level BizTalk is for interactive real-time integration typically on small data packets whereas SSIS is batch and works on much larger volumes of data.

You wouldn't want to move 1m rows about with BizTalk and similarly you wouldn't want to integrate your eCommerce app with your supply-chain app using SSIS.

Hope that helps.

-Jamie

|||Hi Jamie, thank you for your response. So does that mean, integrating applications goes with BizTalk and moving bulk data goes with SSIS? Please explain a little bit further if you can. I am trying to really understand how and why SSIS is different from BizTalk
|||

Yeah, that is another way of stating what I said.

By sheer coincidence I've just come across this useful post explaining the difference between SSIS and BizTalk http://blogs.msdn.com/william_zentmayer/archive/2005/10/17/481992.aspx

Perhaps googling would help: http://www.google.co.uk/search?hl=en&q=biztalk+ssis&meta=

-Jamie