Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I working on script running on sql server 2019 using python 3.10 .

I have directory path \\192.168.7.9\Import\8 and can

write and read to files and delete and create files on

this directory path \\192.168.7.9\Import\8.

my issue when run script python on sql server 2019

it return false

but it must return true because directory path exist.

this path have permissions everyone and administrator and system full control read and write and delete .

Expected result is True

from sql server it return true as exist but from python script it return false for same server and same user.

File sharing and storage made simple[^]

What I have tried:

script python

declare @ExportPath varchar(max)='\\192.168.7.9\Import\8'
EXEC sp_execute_external_script
@language =N'Python',
@script=N'
import os
d = os.path.isdir(ExportFilePath)
print(d)'
,@params = N'@ExportFilePath NVARCHAR(MAX)'
,@ExportFilePath = @ExportPath
Posted
Comments
Richard MacCutchan 6-Aug-22 4:18am    
You need to show the actual Python script and the output of when it runs.
ahmed_sa 6-Aug-22 7:20am    
thank you for reply
can you help me
i will show the actual Python script and the output of when it runs.
but how to show it
tell me what i do to show you
ahmed_sa 6-Aug-22 9:21am    
After more search I found that `os.path.isdir`working local not remote
so How to solve this issue please

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900