![]() I created a gist with all of these options. I also tried out all tables in one file, as well as all tables in individual file. I settled on exporting all of the Dimension tables to separate Worksheets within the same Excel file, and exporting all of the Fact tables to their own individual files (since they tend to be much larger). To get sample data for Azure SQL Managed Instance instead, see restore World Wide Importers to SQL Managed Instance. You can use a sample when you create a new database, or you can deploy a database from SQL Server directly to Azure using SQL Server Management Studio (SSMS). I did some trial and error with this yesterday. You have two options to view sample Azure SQL Database data. ![]() After that, all you have to do is loop through the tables, ‘query’ them with the Read-SqlTableData cmdlet, and pipe the results to the Export-Excel cmdlet. Obviously, you have to have the module installed, and a copy of AdventureWorksDW2017 db restored to a SQL Server. Turns our, it’s extremely easy to do with the ImportExcel PowerShell module. Until yesterday, when I was trying to build a Power BI demo with sample data (that needed to come from files, not a db) I have never even considered doing such a thing. Have you ever wanted to export an entire SQL Server database to Excel file? Yeah, me neither.
0 Comments
Leave a Reply. |