Red Gate forums :: View topic - accented character
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Packager 6
SQL Packager 6 forum

accented character

Search in SQL Packager 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
RGLS



Joined: 17 Nov 2010
Posts: 3

PostPosted: Fri Dec 03, 2010 10:18 pm    Post subject: accented character Reply with quote

hi, i have a problem when my sql statement have accented character. Here is a exemple of my problem.
Sql Script :
INSERT INTO TEST(a) VALUES('')

INSERT INTO TEST(a) VALUES('')

INSERT INTO TEST(a) VALUES('')


Sql Package Statement :
INSERT INTO TEST(a) VALUES('�')

INSERT INTO TEST(a) VALUES('�')

INSERT INTO TEST(a) VALUES('�')

After i ran the package i got this characer("�") in my tablem.

Could you help me with this ?

Philippe
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Mon Dec 06, 2010 6:42 pm    Post subject: Reply with quote

Thanks for your post.

I haven't been able to reproduce this on my machine. It seems that SQL Packager will always create unicode scripts.

It might have something to do with the database collation or the datatype of column [A]. Do you get the correct value if you query the table directly?

Let me know if this doesn't help explain and I'll try and troubleshoot this further.
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
RGLS



Joined: 17 Nov 2010
Posts: 3

PostPosted: Mon Dec 06, 2010 7:51 pm    Post subject: Try this for reproduce my problem Reply with quote

---Step 1
--Create a table test
CREATE TABLE dbo.SqlPackager
(
id int NOT NULL IDENTITY (1, 1),
comments varchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE dbo.SqlPackager ADD CONSTRAINT
PK_Table_1 PRIMARY KEY CLUSTERED
(
id
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO


---Step 2
--This is my Sql script i want package for a Update Database.
--update.sql
INSERT INTO dbo.SqlPackager( comments ) VALUES ( 't')
INSERT INTO dbo.SqlPackager( comments ) VALUES ( 'lve')
INSERT INTO dbo.SqlPackager( comments ) VALUES ( ' faire')
INSERT INTO dbo.SqlPackager( comments ) VALUES ( 'summer')
INSERT INTO dbo.SqlPackager( comments ) VALUES ( 'student')
INSERT INTO dbo.SqlPackager( comments ) VALUES ( 'to do')

--When i look into the package.exe for Upgrade database(With no compression)
--i got this:

--This is my Sql script i want package for a Update Database.
--update.sql
INSERT INTO dbo.SqlPackager( comments ) VALUES ( '�t�')
INSERT INTO dbo.SqlPackager( comments ) VALUES ( '�l�ve')
INSERT INTO dbo.SqlPackager( comments ) VALUES ( '� faire')
INSERT INTO dbo.SqlPackager( comments ) VALUES ( 'summer')
INSERT INTO dbo.SqlPackager( comments ) VALUES ( 'student')
INSERT INTO dbo.SqlPackager( comments ) VALUES ( 'to do')



--Step 3 Run the package.

--Step 4.
SELECT * FROM redGate.dbo.SqlPackager

--OUTPUT
1 ?t?
2 ?l?ve
3 ? faire
4 summer
5 student
6 to do
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Mon Dec 06, 2010 8:14 pm    Post subject: Reply with quote

Which version of SQL Packager are you using? I've tried it using 6.0 and the 6.3 patch version, and I'm not encountering the same issue.

Maybe this behaved differently with an older version.

The extract below is from the script SQL Packager generates when I try your steps.

-- Add 6 rows to [dbo].[SqlPackager]
SET IDENTITY_INSERT [dbo].[SqlPackager] ON
INSERT INTO [dbo].[SqlPackager] ([id], [comments]) VALUES (1, 't')
INSERT INTO [dbo].[SqlPackager] ([id], [comments]) VALUES (2, 'lve')
INSERT INTO [dbo].[SqlPackager] ([id], [comments]) VALUES (3, ' faire')
INSERT INTO [dbo].[SqlPackager] ([id], [comments]) VALUES (4, 'summer')
INSERT INTO [dbo].[SqlPackager] ([id], [comments]) VALUES (5, 'student')
INSERT INTO [dbo].[SqlPackager] ([id], [comments]) VALUES (6, 'to do')
SET IDENTITY_INSERT [dbo].[SqlPackager] OFF
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
RGLS



Joined: 17 Nov 2010
Posts: 3

PostPosted: Mon Dec 06, 2010 8:15 pm    Post subject: Version Reply with quote

6.0.0.107
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Mon Dec 06, 2010 8:20 pm    Post subject: Reply with quote

I've sent you a private email to continue this. I think we might need to get some more information from you to get to the bottom of this.
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
BProvencher



Joined: 23 Aug 2011
Posts: 2
Location: Montreal, Qc, Canada

PostPosted: Tue Aug 23, 2011 5:27 pm    Post subject: Reply with quote

Hi,

I'm running SQL Packager 6.4.0.8, and it does the same thing.

I'm using the collation : SQL_Latin1_General_CP1_CI_AS
Back to top
View user's profile Send private message
BProvencher



Joined: 23 Aug 2011
Posts: 2
Location: Montreal, Qc, Canada

PostPosted: Tue Aug 23, 2011 6:03 pm    Post subject: Reply with quote

Ok, I found it out...

In the advanced save options, you have to specify the encoding you save the SQL script to be "Unicode - Codepage 1200".

(the "Advanced Save Options" can be accessed by the little down arrow (drop down) on right of the "save" button in the "save as" window)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group