Showing posts with label xp_cmdshellplease. Show all posts
Showing posts with label xp_cmdshellplease. Show all posts

Monday, March 26, 2012

Running a Batch File in Query Analyzer

Hi,
I have to run a batch file in query analyzer. How do I do that.
I don't want to use 'xp_cmdshell'
Please advise
(An example would be great)
Regards
IT Dev
File->Open, browse and find the file, and when it is open hit F5...
If you're looking for an non-interactive way to run a file, you might check
out the OSQL command-line tool that ships with SQL Server. It is documented
in Books Online.

Adam Machanic
SQL Server MVP
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
"IT Developer" <ITDeveloper@.discussions.microsoft.com> wrote in message
news:7DE905C4-EF0B-45CB-B109-6E63894D38BA@.microsoft.com...
> Hi,
> I have to run a batch file in query analyzer. How do I do that.
> I don't want to use 'xp_cmdshell'
>
> Please advise
> (An example would be great)
> Regards
> IT Dev
|||IT Developer wrote:

> I have to run a batch file in query analyzer. How do I do that.
> I don't want to use 'xp_cmdshell'
Why don't you?
|||Hello,
You will have to use XP_CMDSHELL if you need to execute the .BAT from Query
Analyzer. There is no other alternative.
Thanks
Hari
"IT Developer" <ITDeveloper@.discussions.microsoft.com> wrote in message
news:7DE905C4-EF0B-45CB-B109-6E63894D38BA@.microsoft.com...
> Hi,
> I have to run a batch file in query analyzer. How do I do that.
> I don't want to use 'xp_cmdshell'
>
> Please advise
> (An example would be great)
> Regards
> IT Dev

Running a Batch File in Query Analyzer

Hi,
I have to run a batch file in query analyzer. How do I do that.
I don't want to use 'xp_cmdshell'
Please advise
(An example would be great)
Regards
IT Dev
I answered this question in the microsoft.public.sqlserver.programming.
Please don't post the same question independently to different groups
because that causes duplicate effort among the parties involved. You can
instead post the question once to all relevant groups so that the all
responses are tracked as a single thread.
Hope this helps.
Dan Guzman
SQL Server MVP
"IT Developer" <ITDeveloper@.discussions.microsoft.com> wrote in message
news:5D65C0C7-EABB-4A33-8C24-118C3CAC08F7@.microsoft.com...
> Hi,
> I have to run a batch file in query analyzer. How do I do that.
> I don't want to use 'xp_cmdshell'
>
> Please advise
> (An example would be great)
> Regards
> IT Dev
>