1

I am trying to perform some SQL Server related checks through PowerShell, pre and post SQL Server patching and one of the checks is to test if the SQL Server Import/Export functionality is working as expected post patching.

Note: this check is necessary to be verified so that SSRS works fine in my environment.

Hence please let me know if there is any way to implement SQL Server import/export functionality through PowerShell.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
SQLDoctor
  • 343
  • 7
  • 16
  • 1
    have a look into the SQLDBATools PowerShell module : https://dbatools.io – Prasoon Karunan V Dec 24 '18 at 05:16
  • Thank you for the help @PrasoonKarunanV but unfortunately I am not allowed to download any third party plugins. Please let me know if there is any alternative. – SQLDoctor Dec 24 '18 at 09:47
  • I'm not a SQL guy, but you can find out if there a query available to do this, then you can just follow this link and modify accordingly. https://stackoverflow.com/questions/8423541/how-do-you-run-a-sql-server-query-from-powershell – Prasoon Karunan V Dec 24 '18 at 14:09
  • Ok thank you for the update. @PrasoonKarunanV. However can you let me know the corresponding command to export data from dbatools.io – SQLDoctor Dec 25 '18 at 11:15
  • I'm not a SQL guy, But sure that dbatools has max coverage for SQL with POwerShell. https://dbatools.io/commands/ has tons of them. please explore... – Prasoon Karunan V Dec 25 '18 at 17:38
  • @PrasoonKarunanV Thanks I am checking it. Meanwhile can you please let me know if BCP utility would serve the purpose of impersonating the SQL Import/Export feature. – SQLDoctor Dec 26 '18 at 04:03

0 Answers0