Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    15

    Unanswered: How can i run my query in .sql file?

    Hi
    i want write a syntax in my storeprosedure or Query Analyzer that execute my sysntaxec in .sql file
    forexample i have Mine.sql that contain "select * from my table" and i have a Store procedure
    i want write a sysntax in my store procedure to execute my select in Mine.sql
    how can i do that?
    thanks

  2. #2
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    Look up osql in Books Online. You can execute the .sql file using the osql utility from your stored procedure.

    This is an example of how it works:

    EXEC master..xp_cmdshell 'osql /E /i Mine.sql'
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  3. #3
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    skunked again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •