Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to perform a mail merge to a SQL Server 2005 view. I created the same view twice, once without specifying the schema (ie. DBO), and once with specifying the schema. In SQL Server Management Studio, logged in using Windows authentication, I have no problem accessing both views.

Using the "Select Recipients" > "Use Existing List" option in Word 2012, I made a connection to the database server using Windows authentication. Both views are included in the list of available tables, as shown below.

Select database and table

Following through, I created a connection for each view. I am able to successfully merge from the view owned by "dbo". I cannot however merge from the view owned by "Permit". I receive the following error.

Error message

The only difference that I know of is that the successful one uses the default "dbo" schema, while the other uses "Permit". Is there an extra step to ensure the schema information is used when merging? How do I do a mail merge off a table or view not owned by "dbo"?

Update

I did some additional testing. Looking at the ODC file used to define the connection, I see that the schema information is properly recorded.

ODC File

For testing, I renamed the ODC file to an HTM file, and opened it in Internet Explorer. It displayed the live data from the database without an issue.

I then tried doing the mail merge while listening with SQL Server Profiler, just to see what queries Word was trying to run.

SQL Server Profiler

As I suspected, Word 2010 is not using the schema information when mail merging.

share|improve this question
    
I tried manually changing the <meta name=Table content=CirculationForComment> to include the schema name. <meta name=Table content=Permit.CirculationForComment> does not work because the mail merge code automatically puts double-quotes around the table name. –  dangowans Nov 21 '12 at 14:04
    
I'm leaning toward this being a bug in the way Word 2010 does mail merging. I'm posted the question to the Microsoft Community form as well ( answers.microsoft.com/en-us/office/forum/office_2010-word/… ). –  dangowans Nov 21 '12 at 15:55
add comment

1 Answer

up vote 0 down vote accepted

This is a known problem in Word 2003, Word 2007, and Word 2010. There is a Microsoft knowledge base article that contains the answer.

http://support.microsoft.com/kb/918295

The article describes the process for Word 2003 and Word 2007, but Word 2010 is similar. Here's what I did for Word 2010.

  1. Exit all Office programs.
  2. Click Start, click Run, type regedit, and then click OK.
  3. Locate and then click the following registry subkey: HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common
  4. On the Edit menu, point to New, and then click DWORD Value.
  5. Type UseQualifiedTableNameForMailMerge, and then press ENTER.
  6. Right-click UseQualifiedTableNameForMailMerge, and then click Modify.
  7. In the Value data box, type 1, and then click OK.
  8. On the File menu, click Exit to exit Registry Editor.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.