SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS structure for Documentation


SSIS structure for Documentation

Author
Message
svantchev
svantchev
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 42
Well, I created a simple package by going via SSMS and doing Export Data, then just saving the dtsx package. It is simple select statement with one column only from one table to export to already existing (but empty) excel file.
It creates the Program.cs output file, but it is empty... the cmd screen says when I try to run this

c:\SSIS>csharp-dessist.exe --ssis_filename=c:\ssis\pckg2008.dtsx --output_folder
=c:\ssis

SYNTAX ERROR:
Method '--ssis_filename=c:\ssis\pckg2008.dtsx' is not recognized.

I've attached a zip file with my examples.. I tried few other packages, but to the same avail.
Attachments
csharp-dessist.vshost.zip (6 views, 1,011.00 KB)
ted 84432
ted 84432
SSC Rookie
SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)

Group: General Forum Members
Points: 29 Visits: 21
Thanks for the quick feedback. I have noticed that most of the problems are with the command line user interface; I've replaced it with a little WinForms thingy:

https://code.google.com/p/csharp-dessist/

The latest package is here, could you try again and let me know if the simple UI helps avoid some of your errors?

https://code.google.com/p/csharp-dessist/downloads/detail?name=csharp-dessist_2.0.zip
svantchev
svantchev
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 42
Not sure if it is related to the command line anymore, but this is what I get

Calling ParseSsisPackage with the parameters:
System.String ssis_filename = C:\ssis\pckg2.dtsx
System.String output_folder = C:\ssis\
csharp_dessist.SqlCompatibilityType SqlMode = System.Reflection.Missing
Boolean UseSqlSMO = System.Reflection.Missing

6/27/2013 2:34:36 PM STDOUT Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at csharp_dessist.Program.WriteProgram(IEnumerable`1 variables, IEnumerable`1 functions, String filename, String appname)
at csharp_dessist.Program.ProduceSsisDotNetPackage(String projectname, SsisObject o, String output_folder)
at csharp_dessist.Program.ParseSsisPackage(String ssis_filename, String output_folder, SqlCompatibilityType SqlMode, Boolean UseSqlSMO)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at CommandWrapLib.ExecuteMethod(MethodInfo mi, Object[] parameters, Form f)



Should the dtsx package be of specific version? I tried 2012 and 2008 packages... one package selects one table (as built by the sql server) and one package does a simple statement for one column for one table.

Should have I built the packages using visual studio and not rely on the SQL server built one? How did you test it on your end?
ted 84432
ted 84432
SSC Rookie
SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)

Group: General Forum Members
Points: 29 Visits: 21
Hi Svantchev,

Now that I'm working using your sample code as a test, I can indeed confirm that you've produced an SSIS package that has some constructs for which I haven't yet written support (SSIS.Pipeline.3, etc). I'm working on a new version of the program that decompiles those objects and will let you know when I make some progress!
svantchev
svantchev
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 42
Sorry for the late reply, I've been busy trying to get this thing working.

Do you think that might be because I am using SSMS 2012? I can use another version if need be.
I'll try another very simple package that copies from one sql table to another table w/o the user of SSIS.Pipeline.3

Can you upload a dtsx file that works for you?

Ultimately, here is my issue... I am trying to create a solution that would take any number of sql statements and export them as separate sheets/tables to Excel/Access via SSIS API (building a package on the fly) or SSIS package (where the package already exists with params being passed to it via .net code).

I have a solution that works like a charm using the old DTS API. I was able to work it out by saving the DTS package as VB Script (the old SQL Server allowed us to save it like that). Then I took the VB script and turned it into .Net code... easy breezy... then comes SSIS and I no longer can do such a gimmick, thus having to learn the API from the scratch, which is insane. So, I figure, there has to be a way to decompile the dtsx into C#/VB code and see the step by step I need to take to get to a solution.

That being the context of why I am trying to use your solution as a guide, let me know if you think of any other way that I could try to get to a solution. That would be very very helpful. I've been beating my head against this wall for 3 weeks now Smile. In fact, I was able to export one table to Excel tab, but the code fails when it tries to export 2 tables. Ugh...

Thanks
Stefan
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search