how can I use USE <tablename> in SSIS

  • Hi,

    how can I use USE <tablename> and run DBCC command and then use next table and run DBCC command in SSIS and get result in txt files

  • 1. in the control flow tab, create a data flow task

    2. then in the data flow tab create a ole DB SOURCE

    3. then connect to the Db and the table that you are looking for

    4. then you can create another ole data base source select sql command on the drop down

    5. then add a flat file destination

    6. connect the ole db source to it

    7, go back to the control flow and hit the green button

    ps. on the flat file destination you will need to create a new connection manager pretty simple that will just tell the sql command what type and where to send the file too

    good luck

  • hi,

    Thanks for the reply, i have to run this for 20 db's, and create a .txt file

    use Dynamics

    DBCC Checkdb

    use Dynamics

    DBCC CheckCatalog

    print 'Finished Dynamics'

    ----

    use INTL

    DBCC Checkdb

    use INTL

    DBCC CheckCatalog

    print 'Finished INTL'

    ----

    use PCA

    DBCC Checkdb

    use PCA

    DBCC CheckCatalog

    print 'Finished PCA'

    ----

  • in that case use the ole db source connect to the master db and select the sql command on the drop down

    form here you can just enter the whole code for the dbcc...easier then creating a bunch of ole db sources....that could get ugly

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply