Sample Header Ad - 728x90

What are the .BCP files inside a .bacpak file?

5 votes
1 answer
1407 views
Diving on dba.stackexchange.com I found a nice answer that teach me how to open a .bacpac file with File Explorer. I gave it a try with the database AdventureWorks2008R2 and all I did was: 1. Save the database as .bacpac file 2. Rename the file extension to .zip 3. Unzip it And there you go, you can see the tables of the database as folders and inside each folder you can see the raw data. enter image description here But when I open the folder Person.Address I see there are 38 files into it with extension .BCP. enter image description here At the beginning I taught they were the pages in which the data are split. But those cannot be pages because they weight about 67KB. Pages should weight 8KB. So I checked the number of pages with this query: -- Total # of pages, used_pages, and data_pages for a given heap/clustered index SELECT t.NAME AS TableName, p.rows AS RowCounts, SUM(a.total_pages) AS TotalPages, SUM(a.used_pages) AS UsedPages, (SUM(a.total_pages) - SUM(a.used_pages)) AS UnusedPages FROM sys.tables t INNER JOIN sys.indexes i ON t.OBJECT_ID = i.object_id INNER JOIN sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id INNER JOIN sys.allocation_units a ON p.partition_id = a.container_id WHERE t.NAME NOT LIKE 'dt%' AND t.is_ms_shipped = 0 AND i.OBJECT_ID > 255 GROUP BY t.Name, p.Rows ORDER BY t.Name And I found out that the Person.Address table has 689 pages. So what are those 38 .BCP files?
Asked by Francesco Mantovani (1695 rep)
Aug 16, 2021, 03:00 PM
Last activity: Aug 16, 2021, 04:43 PM