We have a database that we technically have admin access to on a database server. I can access the server and database on SSMS just fine, but can't actually RDP into that server as its controlled by the DBA team, which is expected.
I'm tasked to optimize the database, as currently we have a ridiculous amount of views that are just pivot and unpivot images of tables we implemented as part of a POC design last summer.
Since we are satisfied with the POC phase, I'm trying to reduce these views and so before I do that I need to export the data to csv file.
I am using the following command (based on this suggestion) in SSMS to do so:
EXEC xp_cmdshell 'bcp "select * from view1" queryout "\\fin-nas.dev.domain.com\abc01\CSV_Files\file1.csv" -c -t, -U "user123" -P "Password123" -S "dbserver.dev.domain.com" -d "Database1"';
I am running into the following issue:
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC Driver 13 for SQL Server]Unable to open BCP host data-file
After some research, I realized that either:
file1.csv
has to be created first in the directory specified (\\fin-nas.dev.domain.com\abc01\CSV_Files
) which I did createor this is basically an access issue, so from this suggestion here, I ran
xp_cmdshell 'whoami';
and that returned what seems to be the account associated with the DBA login...
domain\dom_sasql$
Does this mean I'm completely unable to export the data and only the DBA can do so?