Showing posts with label dts. Show all posts
Showing posts with label dts. Show all posts

Thursday, March 22, 2012

Create SQL table from Excel or DataTable?

Hello,

I am trying to create a new table in SQL Server based on an excel sheet someone uploads to my site (ie No DTS, and I don't know the field names). How can I easily do that?

Can I make a sql table based on a DataTable without going row-by-row? Cause then I could go excel to datatable to sql table.

Thanks a bunch,

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=373468&SiteID=1

same thing what you want see last answer

|||

Can someone do this in VB? I can convert a little C#, but don't understand the syntax enough to convert all that.

|||

http://www.kamalpatel.net/ConvertCSharp2VB.aspx

Sunday, March 11, 2012

Create PIE/BAR Charts using DTS?

Hi All,
I'm using DTS in Sql Server 2000 for the first time, and would like to create Ad-Hoc reports with Pie/Charts and graphs. Is this possible in SQL Server/DTS, or would I need something like Cyrstal Reports?
Thanks!
MattDTS (Data Transformation Services) is an Extraction, Loading and Transformation tool (ETL). It is not a reporting tool.

For creating reports with charts and such, you want to look at SQL Server Reporting Services (SSRS). It comes with SQL 2005, but under certain circumstances, it may require a separate license.

Be forewarned, SSRS comes with a fairly steep learning curve.

Regards,

hmscott|||I agree with the poster of the previous post. DTS is an ETL tool designed to provide a set of interfaces for the import, export and within reason, the manipulation of data relevant to either of these processes.

Although DTS does provide support to invoke .VBS scripts and to call stored procedures and possibly other database objects, this functionality should be restricted for use to enhance the processes for which DTS is designed, import and export.

To accomplish your goal, I would recommend using DTS to manage your ETL requirments and then invoking a specific API designed specifically to render your PIE Chart. This process would involve two steps, the first one being optional. First, a database transaction, encapsulated within a stored procedure, would be created to produce a report of the data that is to be used as input to the graphing function.

The graphing functionality can be provided by any language or application. The decision will come down to what development languages your team is comfortable with, or what reporting packages the company has available. Two such packages that are quite popular in reporting are Business Objects and Microsoft Reporting Services.

Another option of course, for the graphical rendering of the data, is to develop a simple graphing function in a high level language such as .NET and Java. Your process can then be developed in one of these languages to call a stored procedure, to process the result set, and then to pass the set to a custom written graphing routine.

Regards,

Wednesday, March 7, 2012

Create My Own Log (for functionality)

I'm calling stored procedures in a DTS package. The log file only shows that of DTS. In stored procedures I use "Print" to print out error messages the program encouters. I can see the errors when I execute a procedure in Query Analyzer, but they go nowhere when I run a DTS package.

How do I generate a myfunctionality.log with these lines?

Thanks,

LiliHi,

The best way to add Own Log functionality , is to create a log table and use insert statement to log message instead of print. The advantage will be that log will be available for future reference whereas filelog will be over written every time you run package.

best of luck

Sunday, February 19, 2012

create dymanic dts

i can writing dynamic dts package . but not working.

code is here :

Public goPackageOld As New Package
Public goPackage As Package2

Public Sub RunDTS()
Dim goPackage As Package2
goPackage = CType(goPackageOld, Package2)
goPackage.Name = "DTS3"
goPackage.Description = "DTS package description"
goPackage.WriteCompletionStatusToNTEventLog = False
goPackage.FailOnError = False
goPackage.PackagePriorityClass = CType(2, DTSPackagePriorityClass)
goPackage.MaxConcurrentSteps = 4
goPackage.LineageOptions = 0
goPackage.UseTransaction = True
goPackage.TransactionIsolationLevel = CType(4096, DTSIsolationLevel)
goPackage.AutoCommitTransaction = True
goPackage.RepositoryMetadataOptions = 0
goPackage.UseOLEDBServiceComponents = True
goPackage.LogToSQLServer = False
goPackage.LogServerFlags = 0
goPackage.FailPackageOnLogFailure = False
goPackage.ExplicitGlobalVariables = False
goPackage.PackageType = 0


Dim oConnProperty As OleDBProperty
'

' create package connection information

'

Dim oConnection As Connection2
'- a new connection defined below.

oConnection = CType(goPackage.Connections.New("DTSFlatFile"), Connection2)

oConnection.ConnectionProperties.Item("Data Source").Value = "C:\hede\50.txt"
oConnection.ConnectionProperties.Item("Mode").Value = 1
oConnection.ConnectionProperties.Item("Row Delimiter").Value = "||##"
oConnection.ConnectionProperties.Item("File Format").Value = 1
oConnection.ConnectionProperties.Item("Column Delimiter").Value = "|#$,"
oConnection.ConnectionProperties.Item("File Type").Value = 1
oConnection.ConnectionProperties.Item("Skip Rows").Value = 0
oConnection.ConnectionProperties.Item("First Row Column Name").Value() = True
oConnection.ConnectionProperties.Item("Max characters per delimited column").Value = 8000
oConnection.Name = "Connection 1"
oConnection.ID = 1
oConnection.Reusable = True
oConnection.ConnectImmediate = False
oConnection.DataSource = "C:\hede\50.txt"
oConnection.ConnectionTimeout = 60
oConnection.UseTrustedConnection = False
oConnection.UseDSL = False
goPackage.Connections.Add(CType(oConnection, Connection))


oConnection = CType(goPackage.Connections.New("SQLOLEDB"), Connection2)
oConnection.ConnectionProperties.Item("Integrated Security").Value = "SSPI"
oConnection.ConnectionProperties.Item("Persist Security Info").Value() = True
oConnection.ConnectionProperties.Item("Initial Catalog").Value = "**"
oConnection.ConnectionProperties.Item("Data Source").Value = "(local)"
oConnection.ConnectionProperties.Item("Application Name").Value = "DTS Import/Export Wizard"
oConnection.Name = "Connection 2"
oConnection.ID = 2
oConnection.Reusable = True
oConnection.ConnectImmediate = False
oConnection.DataSource = "(local)"
oConnection.UserID = "**"
oConnection.Password = "**"
oConnection.ConnectionTimeout = 60
oConnection.Catalog = "**"
oConnection.UseTrustedConnection = True
oConnection.UseDSL = False
goPackage.Connections.Add(CType(oConnection, Connection))
oConnection = Nothing

'

' create package steps information

'

Dim oStep As Step2
Dim oPrecConstraint As PrecedenceConstraint

oStep = CType(goPackage.Steps.New, Step2)
oStep.Name = "Copy Data from myTextFile to [(local)].[dbo].[111] Step"
oStep.Description = "Copy Data from myTextFile to [(local)].[dbo].[111] Step"
oStep.ExecutionStatus = CType(1, DTSStepExecStatus)
oStep.TaskName = "Copy Data from myTextFile to [(local)].[dbo].[111] Task"
oStep.CommitSuccess = False
oStep.RollbackFailure = False
oStep.ScriptLanguage = "VBScript"
oStep.AddGlobalVariables = True
oStep.RelativePriority = CType(3, DTSStepRelativePriority)
oStep.CloseConnection = False
oStep.ExecuteInMainThread = False
oStep.IsPackageDSORowset = False
oStep.JoinTransactionIfPresent = False
oStep.DisableStep = False
oStep.FailPackageOnError = False
goPackage.Steps.Add(oStep)
oStep = Nothing
goPackage.SaveToSQLServer("(local)", "**", "**", DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, "", "", "")
Try
goPackage.Execute()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub

not have error. try clause is running.but not correct result.

thx..

The Package.Execute method will only thow an exception if it cannot run the package at all, virtual impossible to get. It does not throw an exception if the package fails, as that is still a valid execution.

To capture details of any errors that happend within the package, use the package events provider.

HOW TO: Handle Data Transformation Services Package Events in Visual C# .NET
(http://support.microsoft.com/kb/319985/en-us)

|||

ok i done.

but it didnt have error.

created package in sql server.

but double click on package have error =

Error Source: Microsoft Data Transformation Services(DTS) Package
Error Description: Task 'Copy Data from C:\hede\hede.txt to [(local)].[dbo].[111] Task' was not found.

i want to here : can i do writing Transformation Task Name = Task

Create DTS with two databases

Hi,
I need to get some selected columns of two tables in TWO DATABASES , AND get those data to an excel file. Think the best way is to create a DTS. But dont know how to create it for this situation (having two databases) . Please help me to solve this problem.

ThanksNot sure if it is 2 databases on one server or two servers and need to be linked first but anyway create a view with all data you need in one databases and then use this view as a source for your data.

Good Luck.|||Hi,

Thanks a lot for your advice. Yes that method works fine.

Sudantha

create DTS programmly

is it possible to create DTS programmly and is there a real file for each
DTS in my SQL SERVER?
Regards,
OfirDTS has a COM API so you can create DTS packages programatically using
VB for example. If you open an existing package in the Designer you can
select Package / Save As to save it as VB code that you can then modify
yourself if you like. You can also save a package as a Striuctured
Storage file (.DTS)
David Portas
SQL Server MVP
--|||and how do i run this vb file?
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1117033002.025025.117300@.f14g2000cwb.googlegroups.com...
> DTS has a COM API so you can create DTS packages programatically using
> VB for example. If you open an existing package in the Designer you can
> select Package / Save As to save it as VB code that you can then modify
> yourself if you like. You can also save a package as a Striuctured
> Storage file (.DTS)
> --
> David Portas
> SQL Server MVP
> --
>|||You would first have to compile the file to an executable using
VisualBasic / VisualStudio - you said you wanted to do it
programmatically so I assumed you meant you wanted to create an
executable.
Maybe you were instead looking for a script to create DTS packages from
DOS / Windows / TSQL without compiling any code? I'm not sure that's
possible. Perhaps it's possible in VB script - I haven't tried that
myself.
What you can do is save the DTS file and then copy it to where you want
it and *execute* it from DOS using the DTSTRUN utility. Look up DTSRUN
in Books Online.
David Portas
SQL Server MVP
--|||Also checkout www.sqldts.com. It is an excellent site packed with all the
relevant information on DTS including its programming considerations.
Anith

Create DTS PACKAGE programmatic

Hi guys..!!

i am working on Dynamic creation of DTS-packages in C#.NET 2005(sql server 200)

but i not must create package in Sql Server.
but i cant...

can i do ?
any ideas ?

thx...

DTS has a Save as VB option. This is a great way of getting sample code, so try that on a demo package. VB to VB.Net has some differences, see this link for some tips.

Converting a DTS Package from Visual Basic 6.0 to Visual Basic .Net
(http://www.sqldts.com/default.aspx?264)

VB.Net to C# should not be hard, plenty of tools that do this.

Hopefully when you view the VB sample code you will get a feel for the object model and how it is used, and going forward you can just write the C# directly.

There is a DTS specific newsgroup (microsoft.public.sqlserver.dts) which may be worth search and posting on, as it is DTS not SSIS focused.

|||

but this source not contain code for vb or vb.net
no problem is writing vb or vb.net

problem is "how to create programmatic (dynamic) DTS-Package in dotnet? "

thx...

|||

You appear to be repeating yourself, so can we try again...

Mehmet Metin Altuntas wrote:

problem is "how to create programmatic (dynamic) DTS-Package in dotnet? "

To create a DTS package dynamically in dotnet you need to write some code. DTS uses an object model, have you added a reference?

Mehmet Metin Altuntas wrote:

but this source not contain code for vb or vb.net

What is not source code? I suggested using the Save as VB option to generate some sample code. If you already know how to use the DTS object model in code, what are you asking? If you do not know how to use the DTS object model in code, try generating some sample code as a guide.

Mehmet Metin Altuntas wrote:

no problem is writing vb or vb.net

Sorry, that does not make sense.

The Save as VB option wil give you VB code. The link told you how to convert this to VB.net. There are tools that convert VB.net to C#. It may be a three stage process but it will give you C# code. Once you are familiar with this you can write c# directly, but to HELP you LEARN how to use it in code, Save as VB is a start point.

Surely some code, even VB is easier to learn from than no code at all. There is no Save As C# option, so learn from the VB.

Any help?

Create DTS Package in SQL server 2005 (Ver:9.0.1116).

Hi,
I am using SQL server 2005 (Ver:9.0.1116).
I am unable to find how to create a DTS package from Sql Server Management Studio.
It is showing "DTS 2000 Packages" in the "Object Explorer" of the Sql Server Management Studio.
I want to know how to start a Integration services in Yukon.
As,the DTS 2000 Packages in the Services tree does not Open nor can Import any package.

Thanks!
TechFreakYou need to use the "Business Intelligence Development Studio" to build SQL Server Integration Services (SSIS) packages, not SQL Server management Studio.

Go to: Start-->Programs-->Microsoft SQL Server 2005-->SQL Server Business Intelligence Development Studio

This is all in the documentation (Books Online) so look in there, and in the tutorials, to see how to go about building your first package.

-Jamie|||Yeah Jamie,

Thanx for the concern..

But using "Business Intelligence Development Studio" also it shows an error message as below:

"Could not load file or assembly 'Microsoft.DataTransformationServices.Wizards' or one of its dependencies.The System cannot find the file specified"

In the Yukon tutorials there is no info provided for Integration Services.

-TechFreak|||

Does anybody has a solution for this? I am getting the same error. I have Visual Studio 2005, SQL Server 2005 (Developer Edition) on Windows 2003 machine. I was trying to create an Integration Services Project, but getting the above error. Please help!

Thanks

|||

even i am getting the same error, any help regarding this ?

Thanks

http://techyfreak.blogspot.com

|||You have to be sure that SQL Server Integration Services installed on your PC.
To check go Help -> About Microsoft Visual Studio.

I got the same error after reinstalled MS Visual Studio 2005 from default location
C:/Program Files/Microsoft Visual Studio 8 to D:/Program Files/Microsoft Visual Studio 8
due to insufficient disk space on C.

SQL Server Integration Services just disappeared from installed list.
I was trying repairing VS from CD. Did not help.
I had to uninstall VS from D to C drive again and leave MSDN on D. After I could start Integration project again.
Why this happened I do not know. May be because MS SQL Server 2005 was still on C drive. Not sure.

I hope this help.

Create DTS Package in SQL server 2005 (Ver:9.0.1116).

Hi,
I am using SQL server 2005 (Ver:9.0.1116).
I am unable to find how to create a DTS package from Sql Server Management Studio.
It is showing "DTS 2000 Packages" in the "Object Explorer" of the Sql Server Management Studio.
I want to know how to start a Integration services in Yukon.
As,the DTS 2000 Packages in the Services tree does not Open nor can Import any package.

Thanks!
TechFreakYou need to use the "Business Intelligence Development Studio" to build SQL Server Integration Services (SSIS) packages, not SQL Server management Studio.

Go to: Start-->Programs-->Microsoft SQL Server 2005-->SQL Server Business Intelligence Development Studio

This is all in the documentation (Books Online) so look in there, and in the tutorials, to see how to go about building your first package.

-Jamie|||Yeah Jamie,

Thanx for the concern..

But using "Business Intelligence Development Studio" also it shows an error message as below:

"Could not load file or assembly 'Microsoft.DataTransformationServices.Wizards' or one of its dependencies.The System cannot find the file specified"

In the Yukon tutorials there is no info provided for Integration Services.

-TechFreak|||

Does anybody has a solution for this? I am getting the same error. I have Visual Studio 2005, SQL Server 2005 (Developer Edition) on Windows 2003 machine. I was trying to create an Integration Services Project, but getting the above error. Please help!

Thanks

|||

even i am getting the same error, any help regarding this ?

Thanks

http://techyfreak.blogspot.com

|||You have to be sure that SQL Server Integration Services installed on your PC.
To check go Help -> About Microsoft Visual Studio.

I got the same error after reinstalled MS Visual Studio 2005 from default location
C:/Program Files/Microsoft Visual Studio 8 to D:/Program Files/Microsoft Visual Studio 8
due to insufficient disk space on C.

SQL Server Integration Services just disappeared from installed list.
I was trying repairing VS from CD. Did not help.
I had to uninstall VS from D to C drive again and leave MSDN on D. After I could start Integration project again.
Why this happened I do not know. May be because MS SQL Server 2005 was still on C drive. Not sure.

I hope this help.|||Try Start>Run> DTSwizard

Create DTS Package in SQL server 2005 (Ver:9.0.1116).

Hi,
I am using SQL server 2005 (Ver:9.0.1116).
I am unable to find how to create a DTS package from Sql Server Management Studio.
It is showing "DTS 2000 Packages" in the "Object Explorer" of the Sql Server Management Studio.
I want to know how to start a Integration services in Yukon.
As,the DTS 2000 Packages in the Services tree does not Open nor can Import any package.

Thanks!
TechFreak
You need to use the "Business Intelligence Development Studio" to build SQL Server Integration Services (SSIS) packages, not SQL Server management Studio.

Go to: Start-->Programs-->Microsoft SQL Server 2005-->SQL Server Business Intelligence Development Studio

This is all in the documentation (Books Online) so look in there, and in the tutorials, to see how to go about building your first package.

-Jamie|||Yeah Jamie,

Thanx for the concern..

But using "Business Intelligence Development Studio" also it shows an error message as below:

"Could not load file or assembly 'Microsoft.DataTransformationServices.Wizards' or one of its dependencies.The System cannot find the file specified"

In the Yukon tutorials there is no info provided for Integration Services.

-TechFreak|||

Does anybody has a solution for this? I am getting the same error. I have Visual Studio 2005, SQL Server 2005 (Developer Edition) on Windows 2003 machine. I was trying to create an Integration Services Project, but getting the above error. Please help!

Thanks

|||

even i am getting the same error, any help regarding this ?

Thanks

http://techyfreak.blogspot.com

|||You have to be sure that SQL Server Integration Services installed on your PC.
To check go Help -> About Microsoft Visual Studio.

I got the same error after reinstalled MS Visual Studio 2005 from default location
C:/Program Files/Microsoft Visual Studio 8 to D:/Program Files/Microsoft Visual Studio 8
due to insufficient disk space on C.

SQL Server Integration Services just disappeared from installed list.
I was trying repairing VS from CD. Did not help.
I had to uninstall VS from D to C drive again and leave MSDN on D. After I could start Integration project again.
Why this happened I do not know. May be because MS SQL Server 2005 was still on C drive. Not sure.

I hope this help.

Create DTS Package in SQL server 2005 (Ver:9.0.1116).

Hi,
I am using SQL server 2005 (Ver:9.0.1116).
I am unable to find how to create a DTS package from Sql Server Management Studio.
It is showing "DTS 2000 Packages" in the "Object Explorer" of the Sql Server Management Studio.
I want to know how to start a Integration services in Yukon.
As,the DTS 2000 Packages in the Services tree does not Open nor can Import any package.

Thanks!
TechFreak
You need to use the "Business Intelligence Development Studio" to build SQL Server Integration Services (SSIS) packages, not SQL Server management Studio.

Go to: Start-->Programs-->Microsoft SQL Server 2005-->SQL Server Business Intelligence Development Studio

This is all in the documentation (Books Online) so look in there, and in the tutorials, to see how to go about building your first package.

-Jamie|||Yeah Jamie,

Thanx for the concern..

But using "Business Intelligence Development Studio" also it shows an error message as below:

"Could not load file or assembly 'Microsoft.DataTransformationServices.Wizards' or one of its dependencies.The System cannot find the file specified"

In the Yukon tutorials there is no info provided for Integration Services.

-TechFreak|||

Does anybody has a solution for this? I am getting the same error. I have Visual Studio 2005, SQL Server 2005 (Developer Edition) on Windows 2003 machine. I was trying to create an Integration Services Project, but getting the above error. Please help!

Thanks

|||

even i am getting the same error, any help regarding this ?

Thanks

http://techyfreak.blogspot.com

|||You have to be sure that SQL Server Integration Services installed on your PC.
To check go Help -> About Microsoft Visual Studio.

I got the same error after reinstalled MS Visual Studio 2005 from default location
C:/Program Files/Microsoft Visual Studio 8 to D:/Program Files/Microsoft Visual Studio 8
due to insufficient disk space on C.

SQL Server Integration Services just disappeared from installed list.
I was trying repairing VS from CD. Did not help.
I had to uninstall VS from D to C drive again and leave MSDN on D. After I could start Integration project again.
Why this happened I do not know. May be because MS SQL Server 2005 was still on C drive. Not sure.

I hope this help.