Mail Merge using SQL Server 2005

D

David Clifford

Hello all.

I am using SQL server 2005 and Word 2000. Previously, I have used Access
2000 to create a query to merge names and addresses on a Word 200 document.
No porblems.

It is a simple query..."Select ID, Forename, Surname, Address1...etc"

I am now using SQL Server 2005, and I want to Mail Merge the same addresses
etc. I set up the query, no problem. I select my datasource (SQL Server
database), no problems, I select the fields, no problems, I run the
merge...no data, just blank lines for nvarchar fields, and strange numbers
for integer fields.

Obviously something is wrong. I re-run the same query from Access 2000, Mail
Merge, no problems.

Any suggestions? I ahve tried this Merge now about 10 times, same result.

Thank you for any help that you may offer.

Regards

David
 
P

Peter Jamieson

The problem is that Word 2000 can only se ODBC to connect to SQL Server, and
ODBC does not pass the Unicode data in your NVARCHAR fields along. FWIW
later versions of Word can use OLE DB which does that properly, but for the
moment you either have to:
a. change your NVARCHAR fiels to VARCHAR fields (which means you may lose
data if you are actuall using the Unicode features provided by NVARCHAR) or
b. create a SQL Server View that converts each NVARCHAR field into a
VARCHAR field (there are SQL Server Transact-SQL functions called CAST and
CONVERT that do that - you probably need CONVERT). Again, you will lose
data, but only when you are doing your merge.

Peter Jamieson
 
D

David Clifford

Thank you very much Peter, that was a vey concise and helpful answer. I
think that I will play with the Convert function and see what happens.
Thanks for your time and help.

Regards

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top