What's the difference between tsql and excite sql task

Jefferson-2765 486 Reputation points
2023-03-29T02:59:30.17+00:00

II have a table with some data, i can select the data i need with tsql. With ssis excute sql task, i could also do that. So what's the difference? Which one is more useful or advice....

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,815 questions
{count} votes

Accepted answer
  1. LiHongMSFT-4306 27,016 Reputation points
    2023-03-29T06:01:13.2533333+00:00

    Hi @Jefferson

    As far as I know, it makes no difference. Excute SQL task is to apply the execution result in SSIS.

    If your requirement is just to get data and view output in the SQL database, then use tsql will be fine.

    If you want to output the results to a local folder or other places, then SSIS is better.

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Erland Sommarskog 111.4K Reputation points MVP
    2023-03-29T21:43:07.1066667+00:00

    Execute SQL Task simply runs a T-SQL batch.

    If you want to use the data in your SSIS package, you could use Execute SQL Task. Same goes if it is an update operation that is part of a larger plot which you have in an SSIS package.

    But if you just want to run a plain query, or a plain update, there is no need to use SSIS.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.