Professional Web Applications Themes

how to list all the file names in a directory in Stored Procedure - Microsoft SQL / MS SQL Server

EXEC master..xp_cmdshell 'DIR C:\*.* /b' -- David Portas ------------ Please reply only to the newsgroup -- "john" <john_ebenzer> wrote in message news:0ef501c346e3$6f4550c0$a101280aphx.gbl... > hi > > Can anyone help me out !! > > how to list all the file names in a particular directory > in Stored Procedure. > > I need to do this in a Stored Procedure. kindly provide me > some solution.. hope to hear from u .. > > Thanks in advance .. > > regards > John...

  1. #1

    Default Re: how to list all the file names in a directory in Stored Procedure

    EXEC master..xp_cmdshell 'DIR C:\*.* /b'

    --
    David Portas
    ------------
    Please reply only to the newsgroup
    --

    "john" <john_ebenzer> wrote in message
    news:0ef501c346e3$6f4550c0$a101280aphx.gbl...
    > hi
    >
    > Can anyone help me out !!
    >
    > how to list all the file names in a particular directory
    > in Stored Procedure.
    >
    > I need to do this in a Stored Procedure. kindly provide me
    > some solution.. hope to hear from u ..
    >
    > Thanks in advance ..
    >
    > regards
    > John

    David Portas Guest

  2. #2

    Default Re: how to list all the file names in a directory in Stored Procedure

    There are the undoented stored procedures xp_dirtree and
    xp_availablemedia. Since they're undoented, Dave's method is more
    reliable.

    "john" <john_ebenzer> wrote in message
    news:0ef501c346e3$6f4550c0$a101280aphx.gbl...
    > hi
    >
    > Can anyone help me out !!
    >
    > how to list all the file names in a particular directory
    > in Stored Procedure.
    >
    > I need to do this in a Stored Procedure. kindly provide me
    > some solution.. hope to hear from u ..
    >
    > Thanks in advance ..
    >
    > regards
    > John

    Bob Castleman Guest

  3. #3

    Default Re: how to list all the file names in a directory in Stored Procedure

    Although "XP_dirtree" is also undoented; however, it lists the content of
    the subdirectories and their depth.



    "Bob Castleman" <nomailhere> wrote in message
    news:%23QpJlauRDHA.1624tk2msftngp13.phx.gbl...
    > There are the undoented stored procedures xp_dirtree and
    > xp_availablemedia. Since they're undoented, Dave's method is more
    > reliable.
    >
    > "john" <john_ebenzer> wrote in message
    > news:0ef501c346e3$6f4550c0$a101280aphx.gbl...
    > > hi
    > >
    > > Can anyone help me out !!
    > >
    > > how to list all the file names in a particular directory
    > > in Stored Procedure.
    > >
    > > I need to do this in a Stored Procedure. kindly provide me
    > > some solution.. hope to hear from u ..
    > >
    > > Thanks in advance ..
    > >
    > > regards
    > > John
    >
    >

    Sean H Guest

  4. #4

    Default Re: how to list all the file names in a directory in Stored Procedure



    hi

    Thank u very much for ur answer, but how do I store these list of files
    names into a temporary table.

    Pls help me !!

    Thanks
    John

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    john ebenezer Guest

Similar Threads

  1. Unix: List only File names and not directory
    By Srinath M.K in forum Linux / Unix Administration
    Replies: 16
    Last Post: February 13th, 05:26 PM
  2. What file or directory is mysql data stored in?
    By Gordon Burditt in forum MySQL
    Replies: 0
    Last Post: July 31st, 10:28 PM
  3. stored procedure value
    By -D- in forum Dreamweaver AppDev
    Replies: 1
    Last Post: March 28th, 07:48 PM
  4. Case sensitive Stored Procedure names in IDS9.4
    By Colin Bull in forum Informix
    Replies: 0
    Last Post: September 23rd, 08:52 AM
  5. Replies: 1
    Last Post: July 10th, 01:39 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139