Showing posts with label writing. Show all posts
Showing posts with label writing. Show all posts

Friday, March 23, 2012

issues writing a deployment script

In this post, i asked if there were any tutorials available on using the RS command-line utility. I have since found some that steered me in the right direction.

This guy demonstrates how to render a report by passing a scripty-VB file with extension .rss into the utility :

http://www.sqljunkies.com/Article/B197B9E7-EF3D-4D70-9B5E-47B74E57EF38.scuk

And this guy explains some of the underlying principles behind this marvel of modern software engineering :

http://odetocode.com/Blogs/scott/archive/2005/01/30/975.aspx

What I'm trying to do is build a script that deploys my whole suite of reports to the report server. I've built a test class that mirrors the functionality of my RSS script, because error handling in the RS utility distills every error message to this beauty :
error BC30456: 'Main' is not a member of '_ScriptClass'.

When I run my VB class, I'm consistently getting "http state 401 : Access Denied" when I make an rs call. For instance my create statement

rs.CreateReport(report, serverPath,
True, definition, Nothing)

and K. Scott Allen's simple

rs.GetSystemPermissions()

Both return 401. I'm assuming there are a dozen layers of security I have yet to uncover in my quest. My question : why do I have permissions to do this through my browser but not in code? And then, which specific hoops must i jump through in order to give myself access to do this?

I've discovered i can dodge this problem by running the command prompt window as a user who has Administrator privileges on the server. This is what my shortcut looks like :

%windir%\system32\runas.exe /profile /user:DOMAIN\AdminUser /savecred %windir%\system32\cmd.exe

Of course the preferred way to accomplish this would be to give myself access without giving myself Admin privileges. Any thoughts?

|||What is the command line you are using to execute rs.exe?|||rs -i DeployAllFinancialReports.rss -s http://ServerName/ReportServer

Friday, March 9, 2012

Issue with OLE DB Command while writing to DB2 database

Hi,

I have created a package which uses the OLE DB Command as the target where I write the sql command to insert data into the table. The issue which I am facing is, while at the OLE DB COmmand , the package fails. I notices that it is not able to get the input columns which are mapped to the target columns.

The same package works fine when the target is on Oracle database or a SQL Server database.

For DB2, i have tried using the Microsoft OLE DB Driver for Db2, as the IBM DB2 Driver doesnt work for insert properly.

Any suggestion regarding this would be really helpful.

Thanks,

Manish

Some thoughts on this:

1. It is better to use the OLE DB Destination to insert data into a table instead of the OLE DB Command with an insert statement. You should give that a try.

2. Are you using the Microsoft OLE DB provider for DB2 from our SQL Server 2005 Feature Pack? That's the provider that's been tested with SSIS.

3. I don't understand what you mean by not able to get input columns. What are the error messages when the package fails?

|||

Yes, I am using the Microsoft DB2 drivers only. Using the OLE DB Destination, it worls only for insert. But, I wanted to simulate a scenario, where we do, both insert and update to the target table. So, we used OLE DB Command, and wrote the insert/update query.

The same works fine on Oracle and SQL Server target database. But on DB2, it doesnt work, as in the OLE DB command, we need to map the input columns to the parameters value. The drivers are not able to fetch the input data, and everytime, it insert NULL as it is not able to get the input values.

Let me know if you need any more information on the same.

Wednesday, March 7, 2012

Issue with Dynamic SQL stored procedure and SSIS OLE DB Data Reader

We are writing SSIS packages to pull data from MSO’s through a stored procedure and drop the output into the pipeline to store it on our local database.

Here is an example of a very simple data flow task that executes the following query in step 1

EXEC GetCustomerData @.SELECT = 'OrganizationID', @.FROM = 'Organization',@.WHERE = 'StateOrProvinceCode = ''WA'''

This command is stored in a variable called SQLOrgCommand.

When I open the task and click on Columns I do not see any columns returned

This allows me to conclude that the metadata needed from the GetCustomerData is not understood by SSIS because the SP uses dynamic sql.

While profiling we realized that it executed the following SQL:

SET FMTONLY ON

to get the metadata. However when we ran the sp with FMTONLY ON we recieved the following errors

Msg 536, Level 16, State 5, Procedure sp_GetData, Line 100

Invalid length parameter passed to the SUBSTRING function.

Msg 536, Level 16, State 2, Procedure sp_GetData, Line 101

Invalid length parameter passed to the RIGHT function.

Msg 536, Level 16, State 5, Procedure sp_GetData, Line 116

Invalid length parameter passed to the SUBSTRING function.

Msg 536, Level 16, State 2, Procedure sp_GetData, Line 117

Invalid length parameter passed to the RIGHT function.

Msg 536, Level 16, State 5, Procedure sp_GetData, Line 187

Invalid length parameter passed to the SUBSTRING function.

The same stored procedure executed without FMTONLY OFF generates the proper output.

Is this a known bug in SQL Server? If so is there a patch that we can install.

Can you post an example of the stored proc you're using? I created a dynamic sql sproc and it seems to work just fine.

Monday, February 20, 2012

Issue doing Integrated services programming using Microsoft.SqlServer.ManagedDTS.dll

Hi,

I am writing an installer code in C# to deploy the SSIS package.

I want to use Microsoft.SqlServer.ManagedDTS.dll for it.

It is mentioned in few articles available online that Microsoft.SqlServer.ManagedDTS.dll ships with SQL Server 2005.

I searched on our database server but could not get it.

Anyone having idea on this please help.

HV

Don't try and install SSIS by hand, it is not a good idea It is not supposed to be a redistributable component. There are a lot more assemblies that just that one for SSIS.

Since SSIS requires a full SQL Server license, why not use the regular SQL setup to do this for you. You can choose which servers you want.

If you have installed SSIS on your server then it will certainly be in the GAC, but it may not be on the file system outside of this, unless you installed the tools, in which case it is - C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies

|||Another question to ask: Is SSIS installed on this SQL Server box? A lot of SQL 2005 servers will be set up by their DBAs to not have any unnecessary components installed, and SSIS sometimes falls into this category.|||

Hi,

Thank you Darren.

SSIS is installed on the machine.

I checked the following folder :- C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies

but dll is not available.

Which tool installation delivers Microsoft.SqlServer.ManagedDts.dll?

Please let me know.

HV

|||

Hi,

Thank you Mathew.

SSIS is installed on the machine.

I checked the following folder :- C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies

but it's not available.

HV

|||

Hi,

I picked the Microsoft.SQLServer.ManagedDTS.dll from following folder:

C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.ManagedDTS\9.0.242.0__89845dcd8080cc91>

Similarly picked Microsoft.SqlServer.DTSRuntimeWrap.dll also.

I added it as reference in my .NET application.

When I execute the program I get below error:

Retrieving the COM class factory for component with CLSID {E44847F1-FD8C-4251-B5DA-B04BB22E236E} failed due to the following error: 80040154.

Any Clue?

How to get the RunningPackages information back to a client PC?

HV

|||

If you want running packages information, why not just use the MS tools?

Do you have SSIS tools installed on the local machine that hosts the program? The error indicates that Microsoft.SqlServer.DTSRuntimeWrap is not installed on the local PC?

|||

No SSIS is not installed on the machine which hosts program.

But that is my requirement , I want to deploy SSIS package remotely.

I have installed Microsoft.SQLServer.DTSRuntimeWrap.dll in GAC.

Let me know if there is a way out to use it on a machine where SSIS is not installed.

HV

|||

SSIS is not installed you say, and you get an error that says in cannot find a COM component. Do you think there may be a connection?

I refer you to my original post, apart from saying that a manual install was a silly idea, I also pointed out "There are a lot more assemblies that just that one for SSIS."

As a start point that DLL is just a wrapper to the COM library that does the work, the name hints at that, and the error proves that it is trying to use a COM DLL that is not there, a COM DLL with a ProgID of {E44847F1-FD8C-4251-B5DA-B04BB22E236E} perhaps. As I said before there are lots of DLLs involved in SSIS not just one, so use a proper install.

What you are asking for a not a supported scenario, you may be violating your license agreements if not careful, and at any rate will be a very complicated task to try and reverse engineer the requirements, and very slow if you cannot track a missing COM DLL down yourself.

If you think this is wrong, post feedback to MS (http://connect.microsoft.com) telling them why you think you should have some redistribuatable support, but in the mean-time you will need to run one of the MS installs to get this to work.

Why do you not want to use a MS install?