question

vivekchandra09 avatar image
vivekchandra09 asked

ssis package help

I have a test.gl database and prod.gl database. I need to create a sql 2012 package which will load the tables in test starting with 'S_' to their corresponding one from Prod. I have a excel with the test database tables. We need to test if the table is in prod before loading it.
sql server 2012ssis 2012
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

anthony.green avatar image anthony.green commented ·
Execute SQL Task to check the object exists, then do a Data Flow Task to load the table
0 Likes 0 ·

1 Answer

·
Avi1 avatar image
Avi1 answered
You can add a step in SSIS before data load for a table to check if it exists in prod by running below query SELECT * FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME ='YourTableName'
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ThomasRushton avatar image ThomasRushton ♦♦ commented ·
Bear in mind that the INFORMATION_SCHEMA views don't necessarily hold complete information; you might be better off checking the system views that Microsoft provides. See, among others, this article by Aaron Bertrand that goes into more detail. http://sqlblog.com/blogs/aaron_bertrand/archive/2011/11/03/the-case-against-information-schema-views.aspx
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.