Yes, you will get the historical data, since SQL Server uses a special type of linked server to "stretch" out your query so it incorporates data from both the local and the remote table. Basically, a UNION between the local and the remote table.
Does Streach database cut cold data from localdatabase and transfers it to azure ?
Hi,
In Stretch Database, I want to confirm that cold data which is transferred from a local database to azure database exists at both ends, or it is cut from local and then transferred to azure database?
4 additional answers
Sort by: Most helpful
-
tibor_karaszi@hotmail.com 4,311 Reputation points
2022-03-22T09:22:29.917+00:00 The "cold" data is removed from your local SQL Server instance.
-
rajesh yadav 171 Reputation points
2022-03-22T10:31:09.817+00:00 That means the query I am running on the local database will not get historical data?
-
Tom Phillips 17,741 Reputation points
2022-03-22T12:41:54.373+00:00 Please see:
https://azure.microsoft.com/en-us/services/sql-server-stretch-database/#featuresThe table is online and ready to query, and you don’t have to change existing queries or applications—it’s completely transparent.
-
AmeliaGu-MSFT 13,986 Reputation points Microsoft Vendor
2022-03-23T06:22:59.383+00:00 Hi rajeshyadav-0048,
Agree with others. In addition, you can add the WITH ( REMOTE_DATA_ARCHIVE_OVERRIDE = LOCAL_ONLY|REMOTE_ONLY|STAGE_ONLY ) query hint to the SELECT statement to change the scope of a single query by a member of the db_owner role.
- LOCAL_ONLY. Query local data only.
- REMOTE_ONLY. Query remote data only.
- STAGE_ONLY. Query only the data in the table where Stretch Database stages rows eligible for migration and retains migrated rows for the specified period after migration. This query hint is the only way to query the staging table.
Please refer to Manage and troubleshoot Stretch Database and this article for more details.
Best Regards,
Amelia
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.