I need to query my database that has thousands of rows to generate my website's site map. Since it has many rows I will create a siteindex.xml like this:
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.test.com/sitemap_1.xml</loc>
</sitemap>
<sitemap>
<loc>https://www.test.com/sitemap_2.xml</loc>
</sitemap>
<sitemap>
<loc>https://www.test.com/sitemap_3.xml</loc>
</sitemap>
<sitemap>
<loc>https://www.test.com/sitemap_4.xml</loc>
</sitemap>
</sitemapindex>
With each sitemap xml having the maximum 500 results allowed.
I'm thinking about looping recordsets in PHP and generating the files but is there a best (and faster) way to generate these files directly from SQL Server?
Let's image for example sake that the Table structure is a one column named LINK with a full url