How to Remove SQL Mail Merge Data Sources from a Word Document
Question details
The user needs to remove a mail merge data connection from a Word document to stop a SQL query warning from appearing when clients open the file.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Preparing a Word document for client distribution without triggering external data connection warnings.
- Observed behavior
- The document displays a warning message stating it will run a SQL query against a worksheet to insert database data upon opening.
Before disconnecting your data source, ensure that you no longer need to update the mail merge fields, or consider generating the final merged output document first.
Convert to a Normal Word Document
This is the most reliable method to permanently remove the mail merge data source while keeping your document's layout intact.
By converting the template back to a standard document, you sever the link to the external database or spreadsheet. This ensures the recipient will not see the SQL query prompt.
Open your document in Word and navigate to the 'Mailings' tab on the top ribbon.
Click on the 'Start Mail Merge' button to open the drop-down menu.
Choose 'Normal Word Document' from the list of options. This action immediately disconnects the external data source.
Press 'Ctrl + S' or go to 'File' > 'Save' to apply the changes permanently. The warning will no longer appear.

Decline the SQL Prompt Upon Opening
A quick alternative to break the data link by simply refusing the SQL query when you open the file.
Send the Final Merged Output
If the goal is to provide clients with the completed data, send the finalized merge rather than the linked template.
Manage Mail Merges Easily with WPS Writer
WPS Office provides an intuitive and highly compatible platform for managing Word documents, allowing you to easily disconnect data sources and handle mail merges without hassle.
- 1. Open Your Document: Launch WPS Writer and open the document containing the mail merge.
- 2. Access the References Tab: Navigate to the 'References' or 'Mailings' tab on the ribbon menu.
- 3. Disconnect the Data Source: Use the mail merge settings to convert the file to a standard document, severing the SQL connection.
- 4. Save and Share: Save the clean document and send it to your clients without worrying about security prompts.

Frequently Asked Questions
Why does the SQL query warning appear when opening my Word document?
This warning is a built-in security feature in Word. It alerts you that the document is linked to an external data source, such as an Excel spreadsheet or an Access database, and is attempting to pull data via a SQL command before displaying the contents.
Can I disable the SQL warning using the Windows Registry?
While modifying the registry can suppress the warning on your specific computer, it will not prevent the warning from appearing when you send the file to clients or other external recipients. Converting the file to a normal document is the best approach for shared files.
Will converting to a Normal Word Document delete my typed text?
No, converting the file to a Normal Word Document only breaks the connection to the external data source. All your typed text, formatting, and images will remain intact, though the merge fields will no longer update automatically.




