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

Thursday, March 29, 2012

deleting sql server 2005 deployed packages?

Hi there

This is probably a dead easy question.
I have deployed 3 SSIS packages to sql server, but now i cannot find any option anywhere to delete them?
How do i delete SSIS packages from the SQL Server instance they were deployed to ?

ThanxRight click on it in Management Studio and select the Delete menu item.|||Hi Kirk

Ok my main problem was that i could not find them , but i realised i have to register it as a integration services server, then connect to it , correct?

Ok first question i have sql2000 and sql2005 instances running on my machine, when i register the SSIS server , it will not accept seanlo\sqlserver2005 , it says it does not support multiple instances, so therefore i have to register it as just seanlo, problem is that is my sql 2000 instance ? So i am not sure how to register the SSIS server as it will not accept the name of my 2005 instance?

If i try simply enter SQLSERVER2005 as the instance, it get the following error:
Connect to SSIS Service on "SQLSERVER2005" failed, The RPC server is unavailable?

Now i am not sure how SSIS servcies work in SQL Server 2005, i have chcked that the SQL Server2005 and SSIS services are started and running on my machine?

Thanx again for the help!|||Sean,
Kirk has posted on this: http://www.sqljunkies.com/WebLog/knight_reign/archive/2005/06/08/15765.aspx

It tells you all you need to know.

-Jamie|||Great ! Worked like a charm, thanx so much for you time Jamie|||Oh, and, you're welcome for the post too Sean. :)|||

KirkHaselden wrote:

Oh, and, you're welcome for the post too Sean. :)

Oi, I'm claiming all the credit for this one :)

Tuesday, March 27, 2012

deleting multiple packages at once

Hi,

How do you delete multiple packages at once ?

We have a folder in SSIS called ETL and there are about 25 SSIS packages in it.

Now we need to update it.

I tried to delete the folder but you get the message that the folder is not empty.

So I renamed the folder to ETL_old and my deployement works fine.

But now I want to get rid of all the old folders. Delete a folder didn't work.

Selecting multiple packages doesn't work.

To delete a single one you select the package, right click and select delete, click yes.

But then I have to do it 25 times. I was unable to set a short cut with the keyboard for that action.

Any ideas ?

Constantijn Enders

I don't think you can. But if you find a way please post it

cheers

sql

Sunday, March 25, 2012

Deleting Files using SSIS Scripting Object

I am utlizing a scripting object in my ssis to combine two text files into one final file, and then I want to delete the original files. To do this I am utilizing the FileSystemInfo namespace and associating the file names, then utilizing the DELETE functionality.

The creation of the final file works perfectly...unfortunately, my base files do not delete, and I do not get a failure message or indictator.

Here is my code:

' 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.Math
Imports System.IO
Imports System.IO.File
Imports System.IO.FileSystemInfo
Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain

' The execution engine calls this method when the task executes.
' To access the object model, use the Dts object. Connections, variables, events,
' and logging features are available as static members of the Dts class.
' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
'
' To open Code and Text Editor Help, press F1.
' To open Object Browser, press Ctrl+Alt+J.

Public Sub Main()

Dim strCurrentMonth As String
Dim strCurrentYear As String
Dim strWriteFileName As String
Dim strReadHeaderFileName As String
Dim strReadBodyFileName As String

'Utilizing a case statement, determine the monthname & year and set the appropriate variables

Select Case Month(Now())
Case 1
strCurrentMonth = "January"
Case 2
strCurrentMonth = "February"
Case 3
strCurrentMonth = "March"
Case 4
strCurrentMonth = "April"
Case 5
strCurrentMonth = "May"
Case 6
strCurrentMonth = "June"
Case 7
strCurrentMonth = "July"
Case 8
strCurrentMonth = "August"
Case 9
strCurrentMonth = "September"
Case 10
strCurrentMonth = "October"
Case 11
strCurrentMonth = "November"
Case 12
strCurrentMonth = "December"
End Select

strCurrentYear = Year(Now()).ToString

'Set variables with file names (reader files and write file) for ease in readability and to
'set final (write file) with appropriate nameing convention utilized by Matria HealthCare.

strWriteFileName = "\\CUPSRV05\SHARED\IS\Public\Data Export\Matria\Files TO Matria\cup_ref_cup_" & strCurrentMonth & strCurrentYear & "_ftp_ReferralFormat.txt"

strReadHeaderFileName = "\\CUPSRV05\SHARED\IS\Public\Data Export\Matria\Files TO Matria\Matria_Referral_Control.txt"

strReadBodyFileName = "\\CUPSRV05\SHARED\IS\Public\Data Export\Matria\Files TO Matria\Matria_Referral.txt"

'create stream reader/writer objects

Dim sr As New StreamReader(strReadHeaderFileName)
Dim sr2 As New StreamReader(strReadBodyFileName)
Dim sw As New StreamWriter(strWriteFileName)

'feed the header record into the final file

Do Until sr.Peek = -1
'write the header record
sw.WriteLine(sr.ReadLine)
Loop

'close the read stream for the header record file
sr.Close()

'Feed the body records into the final file
Do Until sr2.Peek = -1
'write all base records
sw.WriteLine(sr2.ReadLine)
Loop

'close the read stream for the body records
sr2.Close()

'close the write stream for the final distribution file
sw.Close()

'dispose of all stream objects
sr.Dispose()
sr2.Dispose()
sw.Dispose()

Dim EligBaseFile As New FileInfo("strReadBodyFileName")
Dim EligHeaderFile As New FileInfo("strReadHeaderFileName")

EligBaseFile.Delete() <--These do not delete or through an error
EligHeaderFile.Delete()

'final statement for SSIS package to determine script result

Dts.TaskResult = Dts.Results.Success

End Sub

End Class

I would appreciate any light you can shed on this. Thanks!

I have also posted this in the Visual Basic Language forum. But, again, any help/guidance would be appreciated.

|||

hi,

My issue going beyond of yours because of I am not be able even to read my file...

Do Until sFitxer.Peek = -1

sFitxer3.WriteLine(sFitxer.ReadLine)

Loop

--

Dim line As String


Do

line = sFitxer.ReadLine

sFitxer3.WriteLine(line)

Loop Until line Is Nothing

Neither of them works.

any help will be welcomed.

|||

Dim EligBaseFile As New FileInfo("strReadBodyFileName")
Dim EligHeaderFile As New FileInfo("strReadHeaderFileName")

EligBaseFile.Delete() <--These do not delete or through an error
EligHeaderFile.Delete()


The problem is on the first two lines. You are passing strReadBodyFileName and strReadHeaderFileName as string values rather than variables. Remove the quotes around them.

|||

You could always simplify the script you have as well:

File.WriteAllText(varForCombinedFile, File.ReadAllText(strReadHeaderFileName))
File.AppendAllText(varForCombinedFile, File.ReadAllText(strReadBodyFileName))
File.Delete(strReadHeaderFileName)
File.Delete(strReadBodyFileName)

Hope this helps.

|||

Also you can use String.Format("{0:MMMM}", DateTime.Now) to derive the Long month name instead of the Select Case.

Thursday, March 22, 2012

Deleting duplicate records from a table.....

I loaded one table via SSIS and found that it contained many duplicate records (from the input source). I can create a SQL task to delete them, but I wonder if SSIS offers and task "out of the box" to delete dups?

TAI,

barkingdog

I don't know about anything in SSIS to do so but here's a great way to do it using CTE's and Row_Number()

http://www.sqlservercentral.com/columnists/chawkins/dedupingdatainsqlserver2005.asp

|||

Use a Sort transform from SSIS is a possible alternation - Sort on certain keys and check "remove duplicate records" at Sort transform.

hth

wenyang

Sunday, February 19, 2012

delete records in the destination file in SSIS

How do I delete records in the destination file in SSIS using BI Development
Studio? Thanks.I mean I am running a daily task and I want to delete the records in destination DB or xls file before I export to this file. How can I do the delete task?|||Execute SQL Task for tables.

For Excel, I honestly don't know, but you might end up using a Script Task, where you use the Excel Object Model to empty the excel sheet.|||truncate table [table]. for sql

delete records in destination file in SSIS

How do I delete records in the destination file in SSIS using BI Development
Studio?
Can anyone please help? Thanks.
" 00ScarlettJohnson" <EE@.yahoo.com> wrote in message
news:u68kNVyeHHA.2396@.TK2MSFTNGP04.phx.gbl...
> How do I delete records in the destination file in SSIS using BI
> Development Studio?
>
|||I mean I am running a daily task and I want to delete the records in
destination DB or xls file before I export to this file. How can I do the
delete task?
" 00ScarlettJohnson" <EE@.yahoo.com> wrote in message
news:u68kNVyeHHA.2396@.TK2MSFTNGP04.phx.gbl...
> How do I delete records in the destination file in SSIS using BI
> Development Studio?
>

delete records in destination file in SSIS

How do I delete records in the destination file in SSIS using BI Development
Studio?Can anyone please help? Thanks.
" 00ScarlettJohnson" <EE@.yahoo.com> wrote in message
news:u68kNVyeHHA.2396@.TK2MSFTNGP04.phx.gbl...
> How do I delete records in the destination file in SSIS using BI
> Development Studio?
>|||I mean I am running a daily task and I want to delete the records in
destination DB or xls file before I export to this file. How can I do the
delete task?
" 00ScarlettJohnson" <EE@.yahoo.com> wrote in message
news:u68kNVyeHHA.2396@.TK2MSFTNGP04.phx.gbl...
> How do I delete records in the destination file in SSIS using BI
> Development Studio?
>

delete records in destination file in SSIS

How do I delete records in the destination file in SSIS using BI Development
Studio?Can anyone please help? Thanks.
" 00ScarlettJohnson" <EE@.yahoo.com> wrote in message
news:u68kNVyeHHA.2396@.TK2MSFTNGP04.phx.gbl...
> How do I delete records in the destination file in SSIS using BI
> Development Studio?
>|||I mean I am running a daily task and I want to delete the records in
destination DB or xls file before I export to this file. How can I do the
delete task?
" 00ScarlettJohnson" <EE@.yahoo.com> wrote in message
news:u68kNVyeHHA.2396@.TK2MSFTNGP04.phx.gbl...
> How do I delete records in the destination file in SSIS using BI
> Development Studio?
>