on 2018 Jul 25 5:31 AM
I'm guessing the answer is no.
Before unloading to a file I want to assure that the according directory does exist, so I'm using sp_list_directory() for that. (I'm on 16.0.0.2673.)
Simply testing via
select count(*) from sp_list_directory('MyDirectoryPath');
does return 0 both for an empty and an non-existing directory.
Q: Is that by design, or is there a way to make sp_list_directory() return an error for a non-existing "root_path" argument?
Aside: The obvious workaround is to check the parent directory if it does contain the desired subdirectory.
Request clarification before answering.
we create a proxy table in a directory access server then run the procedure below not null result indicates directory exists.
ALTER FUNCTION "owner"."DirectoryConnectionTest"() RETURNS INTEGER BEGIN DECLARE @Result INTEGER;
SELECT COUNT(*) INTO @Result FROM ESTA.Outbox WHERE Permissions NOT like 'd%';
RETURN ( @Result );
EXCEPTION WHEN OTHERS THEN RETURN ( @Result ); END
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
47 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.