Hi Anders.
 
Just a thought ...
 
Is your SQL script stored as a Unicode file, or an ASCII one?
 
I've seen problems before when an ASCII file containing high-ascii characters (with codes over 127) is processed by a .NET program. Changing the file to a Unicode UTF-8 format fixed the issues.
 
Hope this helps,
Bevan.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anders Olsen
Sent: Thursday, 5 October 2006 10:01 p.m.
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] SQL task and file encoding

Hello fellow NAnt users
 
We are using NAnt to deploy our database. Now we would also like to use it to insert some data in the database. We are trying to use the sql-task from NAntContrib to execute our script.
 
Our script contains data written using Danish characters (like øæå), but these characters are not handled correctly by NAnt - they are not inserted into the database.
 
We use the following task definition to start the sql-task:
  <sql
    connstring="Provider=SQLOLEDB;Data Source=<source>; Initial Catalog=DPSData; Integrated Security=SSPI"
    transaction="true"
    delimiter="GO"
    delimstyle="Line"
    print="true"
    batch="false"
    source="${project.basedir}\..\DataBase\Database\Change Scripts\Data_Insert.sql"
  />
 
Part of the Data_Insert.sql script looks like this:
---
/* ActorType */

INSERT INTO [DPSData].[dbo].[ActorType] ([TypeName]) VALUES ('TSO')
INSERT INTO [DPSData].[dbo].[ActorType] ([TypeName]) VALUES ('Handelsbalanceansvarlig')
INSERT INTO [DPSData].[dbo].[ActorType] ([TypeName]) VALUES ('Produktionsbalanceansvarlig')
INSERT INTO [DPSData].[dbo].[ActorType] ([TypeName]) VALUES ('Forbrugsbalanceansvarlig')
INSERT INTO [DPSData].[dbo].[ActorType] ([TypeName]) VALUES ('Netoperatør')
INSERT INTO [DPSData].[dbo].[ActorType] ([TypeName]) VALUES ('Producent')
go

---
All values are inserted into the database, except that the 'ø' in 'Netoperatør' is missing.
 
When we run the script using Microsoft SQL Server Management Studio, there is no problem.
 
How do I tell NAnt or the sql-task to handle the danish characters correctly?

--
Regards

Anders Kåre Olsen

 

******************************************************************************

"This message (and any files transmitted with it) are confidential and

may be legally privileged. If you are not the intended recipient please

notify the sender immediately and delete this message from your system.

 

This message does not necessarily reflect the views of the

Reserve Bank of New Zealand. If the recipient has any concerns about

the content of this message they should seek alternative confirmation

from the Reserve Bank of New Zealand."

******************************************************************************

 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to