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.
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 |
|
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. |
 |
|
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 AthalyeIndia."Nothing is Impossible" |
 |
|
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 workingDeclare LibraryPage_Cursor cursor forselect Author, Location from test.dbo.books_infoopen 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 EndCLOSE LibraryPage_CursorDEALLOCATE LibraryPage_CursorThank you very much for help. I was very stupid. :) |
 |
|
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_infoNo cursor, one operation, much faster. |
 |
|
|
|
|
|
|