SQL Server 2000: Write message to text file


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: SQL Server 2000: Write message to text file

  1. #1
    Mark Guest

    SQL Server 2000: Write message to text file


    How do you reliably and efficiently write a message to an operating system
    level text file? I am trying to use the Microsoft(R) OLE Automation stored
    procedures sp_OACreate() etc.

    From Query Analyzer, I can successfully create, destroy and use methods on
    the Scripting.FileSystemObject class. Any message is written to the named
    file.

    However, when the code is incorporated into a stored procedure that is executed
    from a COM+ component that is used from an Active Server Page, there is nothing
    written to the file.

    I have checked the OS permissions (Windows 2000) and the directory and its
    children are all EVERYONE=FULL CONTROL.

    There are articles documenting the use of the command shell extended stored
    procedure, but this is likely to perform like a snail super-glued to the
    concrete.

    Any comments or suggestions welcomed.

    Many thanks, Mark

  2. #2
    David Satz Guest

    Re: SQL Server 2000: Write message to text file

    see http://www.mssqlserver.com/faq/general-flatfile.asp

    "Mark" <mtshipman@hotmail.com> wrote in message
    news:3cf2df8b$1@10.1.10.29...
    >
    > How do you reliably and efficiently write a message to an operating system
    > level text file? I am trying to use the Microsoft(R) OLE Automation stored
    > procedures sp_OACreate() etc.
    >
    > From Query Analyzer, I can successfully create, destroy and use methods on
    > the Scripting.FileSystemObject class. Any message is written to the named
    > file.
    >
    > However, when the code is incorporated into a stored procedure that is

    executed
    > from a COM+ component that is used from an Active Server Page, there is

    nothing
    > written to the file.
    >
    > I have checked the OS permissions (Windows 2000) and the directory and its
    > children are all EVERYONE=FULL CONTROL.
    >
    > There are articles documenting the use of the command shell extended

    stored
    > procedure, but this is likely to perform like a snail super-glued to the
    > concrete.
    >
    > Any comments or suggestions welcomed.
    >
    > Many thanks, Mark




  3. #3
    MarkW Guest

    Re: SQL Server 2000: Write message to text file


    "David Satz" <davidNOSPAMsatz@yahoo.NOSPAM.com> wrote:
    >see http://www.mssqlserver.com/faq/general-flatfile.asp
    >
    >"Mark" <mtshipman@hotmail.com> wrote in message
    >news:3cf2df8b$1@10.1.10.29...
    >>
    >> How do you reliably and efficiently write a message to an operating system
    >> level text file? I am trying to use the Microsoft(R) OLE Automation stored
    >> procedures sp_OACreate() etc.
    >>
    >> From Query Analyzer, I can successfully create, destroy and use methods

    on
    >> the Scripting.FileSystemObject class. Any message is written to the named
    >> file.
    >>
    >> However, when the code is incorporated into a stored procedure that is

    >executed
    >> from a COM+ component that is used from an Active Server Page, there is

    >nothing
    >> written to the file.
    >>
    >> I have checked the OS permissions (Windows 2000) and the directory and

    its
    >> children are all EVERYONE=FULL CONTROL.
    >>
    >> There are articles documenting the use of the command shell extended

    >stored
    >> procedure, but this is likely to perform like a snail super-glued to the
    >> concrete.
    >>
    >> Any comments or suggestions welcomed.
    >>
    >> Many thanks, Mark

    >
    >

    Try using the xp_commandshell stored proc to generate a text file.
    It is fairly quick and easy to use if you have access to the xp stored procs.

    Mark W.

  4. #4
    David Satz Guest

    Re: SQL Server 2000: Write message to text file

    it is xp_cmdshell and that is what the FAQ I referenced suggested...

    "MarkW" <JTNMUFVHDMXI@spammotel.com> wrote in message
    news:3cf52f6c$1@10.1.10.29...
    >
    > "David Satz" <davidNOSPAMsatz@yahoo.NOSPAM.com> wrote:
    > >see http://www.mssqlserver.com/faq/general-flatfile.asp
    > >
    > >"Mark" <mtshipman@hotmail.com> wrote in message
    > >news:3cf2df8b$1@10.1.10.29...
    > >>
    > >> How do you reliably and efficiently write a message to an operating

    system
    > >> level text file? I am trying to use the Microsoft(R) OLE Automation

    stored
    > >> procedures sp_OACreate() etc.
    > >>
    > >> From Query Analyzer, I can successfully create, destroy and use methods

    > on
    > >> the Scripting.FileSystemObject class. Any message is written to the

    named
    > >> file.
    > >>
    > >> However, when the code is incorporated into a stored procedure that is

    > >executed
    > >> from a COM+ component that is used from an Active Server Page, there is

    > >nothing
    > >> written to the file.
    > >>
    > >> I have checked the OS permissions (Windows 2000) and the directory and

    > its
    > >> children are all EVERYONE=FULL CONTROL.
    > >>
    > >> There are articles documenting the use of the command shell extended

    > >stored
    > >> procedure, but this is likely to perform like a snail super-glued to

    the
    > >> concrete.
    > >>
    > >> Any comments or suggestions welcomed.
    > >>
    > >> Many thanks, Mark

    > >
    > >

    > Try using the xp_commandshell stored proc to generate a text file.
    > It is fairly quick and easy to use if you have access to the xp stored

    procs.
    >
    > Mark W.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center