Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Problem with the language

Author  Topic 

avgoustinosc
Starting Member

17 Posts

Posted - 2006-11-09 : 06:00:28
Hi guys,
I have two databases. Test1 and Test2. Im using a cursor in order to transfer data from one table of db Test1 to an other table of db Test2.
In test1, i have some Greek entered and when im transferring the data into the other database, i can not read the Greek.

Anyone can help me?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-09 : 06:02:51
Change the columns to UNICODE, or use a COLLATION does accepts both greek characters and latin characters.
You had almost the same question here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=74362


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

avgoustinosc
Starting Member

17 Posts

Posted - 2006-11-09 : 07:54:48
I already used nvarchar and i already used the collation Greek_CI_AS but still nothing. Im viewing the Greek word like this: s???a?x? for example.
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-09 : 08:09:29
If it is not problem in the table definition, then it must be in the code you are using to transfer. Please post that code so we can get some ideas.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

avgoustinosc
Starting Member

17 Posts

Posted - 2006-11-09 : 08:16:51
Thanks guys. Got it. I didnt declare my variable as an nvarchar.

Thats my code:
Declare @Authors varchar(255), @Location varchar(10) -- I correct only this and is working
Declare LibraryPage_Cursor cursor for
select Author, Location from test.dbo.books_info
open LibraryPage_Cursor
FETCH NEXT FROM LibraryPage_Cursor
INTO @Authors, @Location
While @@FETCH_STATUS = 0
Begin
if @authors is null
set @authors=' '
insert into LibraryPage (LibraryPageTypeId, PageDate, Authors, URL, Summary, IsPaidService, SearchedText, AutologinTemplateId, IsFile, FirmId)
values (1, getdate(), @Authors, 'URL', @Location, 0, ' ', 0, 0, 1)
FETCH NEXT FROM LibraryPage_Cursor INTO @Authors, @Location
End
CLOSE LibraryPage_Cursor
DEALLOCATE LibraryPage_Cursor


Thank you very much for help. I was very stupid. :)
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-11-09 : 13:53:41
Just out of curiosity, why can't you just use this?:

INSERT LibraryPage (LibraryPageTypeId, PageDate, Authors, URL, Summary, IsPaidService, SearchedText, AutologinTemplateId, IsFile, FirmId)
SELECT 1, GetDate(), IsNull(Author, ''), 'URL', Location, 0, '', 0, 0, 1 FROM test.dbo.books_info


No cursor, one operation, much faster.
Go to Top of Page
   

- Advertisement -