Execute Process Task (SQLCMD)

  • Hello,

    I have a execute process task that runs SQLCMD that in turn processes a backup/copy/restore script. Rather then using an input file (-i filename) I would like to somehow embed the script and pass the contents to sqlcmd through SSIS. Rather then having a seperate script file on the server. Does anyone have any ideas on how I can make this work?

    Here is the arguments I'm using:

    -S servername -U sa -P password -i C:\Scripts\InputFile.sql -o C:\Scripts\LogFiles\LogFile.txt

    Thanks!

  • If that is all you are doing, why not do it using the Execute SQL Task?


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • But how would I call SQLCMD and run the script in SQLCMD mode in an Execute SQL Task object?

  • Why are you using SQLCMD to run your backup? You can do it just as easily in SQL.

  • Is there is not there a way to meet my original requirement? If you don't know how to do it just say so?

  • Alot of very rude and what appears to be blatant disrespect and rudeness so far. Okay you arrogant and unhelpful people. May life and God show as much caring, consideration, and help as you are showing me in your replies. I put a Karmic curse on your heads! :w00t:

  • forumdog (11/18/2009)


    Is there is not there a way to meet my original requirement? If you don't know how to do it just say so?

    Do not be so rude. If you have not followed / understood what Lynn and I replied try to request for more information but not be so rude.

    If you want to execute a backup , copy and restore script, why are you using Sqlcmd you can do it using Execute SQL Task.

    If you have tried it and your requirement does not suit this solution, say that and that's accepted.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • forumdog (11/18/2009)


    Alot of very rude and what appears to be blatant disrespect and rudeness so far. Okay you arrogant and unhelpful people. May life and God show as much caring, consideration, and help as you are showing me in your replies. I put a Karmic curse on your heads! :w00t:

    Well thanks for your blessings !!


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • I shouldn't have to say it. It is assumed. My requirement was what I stated. For you to assume otherwise is just being unhelpful and being difficult. Be a professional and treat others with professionalism. That you haven't done. You should change your approach and help people with what they need and not what they don't need. Karma has nothing to do with my blessing or not. It is earned by you. For me to call it out is like me setting the intent and sending a message to the universe for it to be followed up on. If you really do have good intent yourself it won't matter but if you don't it makes it a certainty that you will pay your karmic debt.

  • forumdog (11/18/2009)


    Alot of very rude and what appears to be blatant disrespect and rudeness so far. Okay you arrogant and unhelpful people. May life and God show as much caring, consideration, and help as you are showing me in your replies. I put a Karmic curse on your heads! :w00t:

    Excuse me????? If all you want is an answer try OverStack or Ask SQL Server Central[/url]. If you really want to learn something and become better at what you do try being more professional. We are all (except Steve) volunteers here willing to help those who want help.

  • forumdog (11/18/2009)


    I shouldn't have to say it. It is assumed. My requirement was what I stated. For you to assume otherwise is just being unhelpful and being difficult. Be a professional and treat others with professionalism. That you haven't done. You should change your approach and help people with what they need and not what they don't need. Karma has nothing to do with my blessing or not. It is earned by you. For me to call it out is like me setting the intent and sending a message to the universe for it to be followed up on. If you really do have good intent yourself it won't matter but if you don't it makes it a certainty that you will pay your karmic debt.

    And here we have the pot calling the kettle black!

    There are usually more than one way of doing things. Some more efficient than others. As we are professionals here we do feel it important to show people alternatives to accomplishing tasks. Just like we will encourage people who think they need to cursors to accomplish a task, we'll try to show them how a set-based approach may actually be better.

    In your case, we are trying to understand why you are doing your backups the way you are so that we can show you alternatives.

  • forumdog (11/18/2009)


    I shouldn't have to say it. It is assumed. My requirement was what I stated. For you to assume otherwise is just being unhelpful and being difficult. Be a professional and treat others with professionalism. That you haven't done. You should change your approach and help people with what they need and not what they don't need. Karma has nothing to do with my blessing or not. It is earned by you. For me to call it out is like me setting the intent and sending a message to the universe for it to be followed up on. If you really do have good intent yourself it won't matter but if you don't it makes it a certainty that you will pay your karmic debt.

    We are here to help and solve each others problems.

    For an example visit these links from the past 2 days where people have been helped and came back replying thanks to me.

    http://www.sqlservercentral.com/Forums/Topic819670-360-1.aspx#bm820886

    http://www.sqlservercentral.com/Forums/Topic820488-146-1.aspx#bm820524

    http://www.sqlservercentral.com/Forums/Topic818293-357-2.aspx#bm820554

    Such people's thanks gives a satisfaction that we could solve someone's problems.

    We are professional, working and at the same time trying to help others. So a single line reply to your post does not represent that we have disrespect to you or any other forum newbie.

    Stop blaming others and learn to respect other professionals. About your enlightening words on Karmatic debt, we already know that.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • forumdog (11/18/2009)


    Alot of very rude and what appears to be blatant disrespect and rudeness so far. Okay you arrogant and unhelpful people. May life and God show as much caring, consideration, and help as you are showing me in your replies. I put a Karmic curse on your heads! :w00t:

    I was considering offering some suggestions as to how you might accomplish your task the way you want, but then I read this response and decided it wasn't worth my time.

    I didn't read anything disrespectful or unprofessional by either Lynn or Bru, all I saw were questions, which, IMO, were valid. No one knows your level of experience with SQL Server so sometimes questions are asked to clarify and to see if you had considered any other solutions. You can politely answer the questions, you can ignore them, or you can attack the people who asked them and are trying to help you. I'd like to think that the 3rd option is one that no one would pick, unfortunately that's the one you chose.

    Had you said, "I'm not sure I understand the relevance of your question, but [this] is why I need to do this task this way" You likely would have gotten helpful responses.

  • forumdog (11/18/2009)


    I shouldn't have to say it. It is assumed. My requirement was what I stated. For you to assume otherwise is just being unhelpful and being difficult. Be a professional and treat others with professionalism. That you haven't done. You should change your approach and help people with what they need and not what they don't need. Karma has nothing to do with my blessing or not. It is earned by you. For me to call it out is like me setting the intent and sending a message to the universe for it to be followed up on. If you really do have good intent yourself it won't matter but if you don't it makes it a certainty that you will pay your karmic debt.

    If someone asked me for "the best way to jump off a tall building and die", I'd be more inclined to try to stop them and see if I could help fix the real problem, than to assume they know what they're doing and help them jump.

    This isn't quite that extreme, but it illustrates the point.

    As to an answer for your original question: Use a file. Don't overcomplicate the thing.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • forumdog (11/18/2009)


    Is there is not there a way to meet my original requirement? If you don't know how to do it just say so?

    I don't know how to do it.

    kthxbye

Viewing 15 posts - 1 through 15 (of 20 total)

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