Cannot Access directory in novell shared folder from sql server xp_cmdshell

  • hi all,

    i have a problem when i executing this command from sql server

    exec xp_cmdshell 'dir \vs\dat'

    it return message "access denied".

    nvs is a novell server.

    in my computer, there is already novell client 4.90 SP2

    and i already login to novell server from novel client login

    but this command will work on dos prompt.

    'dir \vs\dat\'

    i also already change my sql server services login to using same as window login

    but it doesn't work

    my question is, is there a way to add permission to sql server to accessing novell network?

    so i can do this command exec xp_cmdshell 'dir \vs\dat'

    Thanks alot for answers n suggestions

    Sory for my bad english..

    Regards

    esthrim.

  • I think the Novell volumes are only visible through the Novell client. I believe that client only works for a logged on user (not for a service like SQL Server). You might check with your Novell admins to see if that's the case.

    K. Brian Kelley
    @kbriankelley

  • K. Brian Kelley (7/23/2009)


    I think the Novell volumes are only visible through the Novell client. I believe that client only works for a logged on user (not for a service like SQL Server). You might check with your Novell admins to see if that's the case.

    That's my understanding as well. The thing that's even more confusing is that you actually have TWO user ID's, which just happen to have the same "name", but are unfortunately not interchangeable. In other words, your Novell and Windows user ID's look the same to you, but are not the same behind the scenes.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Thanks all, Sorry for taking too long to respond.

    In other words, your Novell and Windows user ID's look the same to you, but are not the same behind the scenes.

    hmm.. but the weird is when i do import / export wizard (from sql server 2000), the process can import dbf files from the mapped drive (which is from novell).

    or maybe is there a way to run import / export from sql command?.

    Thanks before

  • Hi, in your server you'll need to install the netware client service. Control panel - Network - Local area connection - Add - Service - Netware client.

  • Hi, in your server you'll need to install the netware client service. Control panel - Network - Local area connection - Add - Service - Netware client.

    I already do that, but it still the same.

    But when i do import / export wizard (from sql server 2000), the process can import dbf files from the mapped drive (which is from novell).

    is there a way to run import / export from sql command?

  • Hi, two ways:

    A)

    /*

    SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.

    SELECT * INTO XLImport3 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',

    'Data Source=C:\Temp\Borrar\Libro1.xls;Extended Properties=Excel 8.0')...[Hoja1$]

    SELECT * INTO XLImport4 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',

    'Excel 8.0;Database=C:\Temp\Borrar\Libro1.xls', [Hoja1$])

    */

    B)

    /*

    You can use openrowset or opendatasource to export data to excel.

    If the data set is large its better to use bcp.

    Example of bcp -

    */

    -- EXPORT TO EXCEL

    -- ------------------------------------------------------------------

    xp_cmdshell 'bcp "select col1,xol2 from table1" queryout "C:\test.xls" -c -t"+" -r"" -S "YourServerInstance" -U"user" -P"pwd"'

    /*

    bcp is a command line utility so you need to xp_cmdshell

    to execute it from within sql server.

    Pls lookup BOL for more details.

    */

Viewing 7 posts - 1 through 6 (of 6 total)

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