Hi All,
I want to copy 15 tables from my database and copy/load all the data into one JSON file. I am using BCP bulk utility to copy data, but I don't know how to write the script (select * from table1, select * from table2... using QUERYOUT or table1, table2,,,table n using OUT) for multiple tables.
Please let me know if this utility doesn't support my requirement then how can I implement this.
For Example:
SET @alenzi = 'bcp "SELECT (SELECT ID,City,State,PostalCode,Country, code,loadId' +
'FOR JSON PATH, INCLUDE_NULL_VALUES, WITHOUT_ARRAY_WRAPPER)' +
'FROM table1" ' +
'queryout "C:\My_File\tablesn.json" ' +
'-c -S servername -d dbname -T'
EXEC sys.XP_CMDSHELL @alenzi ;
Thanks All.