I want to use Python to automate the "Generate Scripts" option in Management Studio so that I can get the data from tables which are stored on local SQL Server and save it into a .sql file.
I want to save it in an SQL file so that later another user can access and verify the data on SSMS, even if he does not have access to the local SQL Server.
Thanks! Any help would be appreciated as I have been trying this for sometime now.
I tried using dataframes to fetch the data from SQL Server and then writing it into a csv file. Then I am not able to store it in a .sql file from csv.