Showing posts with label delete. Show all posts
Showing posts with label delete. Show all posts

Tuesday, March 20, 2012

Changing SSIS package - new user question

I saved a simple export/import package from the import/export wizard to a .dtsx file/package. Now I want to change the package to delete/truncate all of the tables before adding data. (since this has 80 tables it would have been a pain to edit each of them individually)

How can I easily go about doing this with the SSIS package. I can't find out where this would actually be executed.

Also, how can I actually view the code behind the SSIS package.

Thanks.

fcb wrote:

I saved a simple export/import package from the import/export wizard to a .dtsx file/package. Now I want to change the package to delete/truncate all of the tables before adding data. (since this has 80 tables it would have been a pain to edit each of them individually)

How can I easily go about doing this with the SSIS package. I can't find out where this would actually be executed.

Execute SQL Task

fcb wrote:

Also, how can I actually view the code behind the SSIS package.

Thanks.

Right-click on the package in BIDS-->View Code

-Jamie

|||I assume I have to place the Execute SQL Task in the For Each Loop Container. Do I just place a truncate table statement in the SQL Statement property? Does the "for each loop container" ensure it truncates every table or is there some other coding that has to be done?

I don't know whether its the view I'm in but I can't actually find the View Code selection when I right click on the package.
|||

fcb wrote:

I assume I have to place the Execute SQL Task in the For Each Loop Container. Do I just place a truncate table statement in the SQL Statement property? Does the "for each loop container" ensure it truncates every table or is there some other coding that has to be done?

Well, why not just write 80 delete statements in a single task. It'll take a while but you'l only have to do it once!

fcb wrote:

I don't know whether its the view I'm in but I can't actually find the View Code selection when I right click on the package.

Try clicking the "View Code" button in the solution explorer

-Jamie

Saturday, February 25, 2012

Changing name on Sql server

I change the name on my SQL2005 server, after that i run sp_dropserver and
sp_addserver, but when i tru do delete som sql agent job or create new one
iam getting error:"An error has occurred while establishing a connection to
the server. When connecting to SQL Server 2005, this failure may be caused
by the fact that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server) (.Net SqlClient Data Provider)"
any help please
Did you restarted SQL when you changed SQL names?
And also one thing ... did you executed
"sp_addserver 'servername', local"?
"Viktor" <serguienkov@.hotmail.com> wrote in message
news:ef9Sza%23yHHA.1776@.TK2MSFTNGP03.phx.gbl...
>I change the name on my SQL2005 server, after that i run sp_dropserver and
>sp_addserver, but when i tru do delete som sql agent job or create new one
>iam getting error:"An error has occurred while establishing a connection to
>the server. When connecting to SQL Server 2005, this failure may be caused
>by the fact that under the default settings SQL Server does not allow
>remote connections. (provider: Named Pipes Provider, error: 40 - Could not
>open a connection to SQL Server) (.Net SqlClient Data Provider)"
> any help please
>

Changing name on Sql server

I change the name on my SQL2005 server, after that i run sp_dropserver and
sp_addserver, but when i tru do delete som sql agent job or create new one
iam getting error:"An error has occurred while establishing a connection to
the server. When connecting to SQL Server 2005, this failure may be caused
by the fact that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server) (.Net SqlClient Data Provider)"
any help pleaseDid you restarted SQL when you changed SQL names?
And also one thing ... did you executed
"sp_addserver 'servername', local"?
"Viktor" <serguienkov@.hotmail.com> wrote in message
news:ef9Sza%23yHHA.1776@.TK2MSFTNGP03.phx.gbl...
>I change the name on my SQL2005 server, after that i run sp_dropserver and
>sp_addserver, but when i tru do delete som sql agent job or create new one
>iam getting error:"An error has occurred while establishing a connection to
>the server. When connecting to SQL Server 2005, this failure may be caused
>by the fact that under the default settings SQL Server does not allow
>remote connections. (provider: Named Pipes Provider, error: 40 - Could not
>open a connection to SQL Server) (.Net SqlClient Data Provider)"
> any help please
>

Changing name on Sql server

I change the name on my SQL2005 server, after that i run sp_dropserver and
sp_addserver, but when i tru do delete som sql agent job or create new one
iam getting error:"An error has occurred while establishing a connection to
the server. When connecting to SQL Server 2005, this failure may be caused
by the fact that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server) (.Net SqlClient Data Provider)"
any help pleaseDid you restarted SQL when you changed SQL names?
And also one thing ... did you executed
"sp_addserver 'servername', local"?
"Viktor" <serguienkov@.hotmail.com> wrote in message
news:ef9Sza%23yHHA.1776@.TK2MSFTNGP03.phx.gbl...
>I change the name on my SQL2005 server, after that i run sp_dropserver and
>sp_addserver, but when i tru do delete som sql agent job or create new one
>iam getting error:"An error has occurred while establishing a connection to
>the server. When connecting to SQL Server 2005, this failure may be caused
>by the fact that under the default settings SQL Server does not allow
>remote connections. (provider: Named Pipes Provider, error: 40 - Could not
>open a connection to SQL Server) (.Net SqlClient Data Provider)"
> any help please
>