Author |
Topic |
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2013-02-21 : 09:18:44
|
dear allwe are loading the data from ORACLE to Sql server.when i am selecting below part i am getting the 2 records RCT.REF_CODE VALUE 'MAA'but RCT.REF_CODE VALUE 'MAA' and RCT.REF_CODE VALUE 'MAA ' is different.----SQLSERVERSELECT REF_CODE,REF_DESC FROM RCT WHERE rct.REF_REC_TYPE ='01' and RCT.REF_CODE = 'MAA'--OUTPUTREF_CODE REF_DESCMAA CHENNAIMAA MASHAD USING OPEQUERY EXECUTING ON ORACLE DATABASEselect * from openquery(finuat,'select REF_CODE,REF_DESC from tbaadm.RCT where rct.REF_REC_TYPE =''01'' and RCT.REF_CODE = ''MAA''')---------OUTPUTREF_CODE REF_DESCMAA CHENNAIselect * from openquery(finuat,'select REF_CODE,REF_DESC from tbaadm.RCT where rct.REF_REC_TYPE =''01'' and RCT.REF_CODE ''MAA ''')--------OUTPUTREF_CODE REF_DESCMAA MASHAD how can i get the single record throug sql server statemet |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-21 : 22:41:12
|
whats the datatype of REF_CODE ?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2013-02-22 : 00:17:35
|
datatype is :REF_CODE(nvarchar(5),null) |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-02-22 : 03:18:19
|
In Oracle database, what is the data type of REF_CODE ?--Chandu |
|
|
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2013-02-22 : 04:52:57
|
hi all same field in oracle is varchar2 datatype |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2013-02-22 : 07:20:57
|
How are you getting the data from Oracle to SQL Server? Sounds like it is losing something in translation.How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
|
|
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2013-02-22 : 07:24:32
|
DEAR ALLwe are connecting through linked server.which using in SSIS packages.fetching all the data without any trnsforamtions between source and distnations(full load). |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-23 : 02:08:44
|
are these values taken from some other source like may a file in ssis?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-02-26 : 09:14:14
|
Hi,In Oracle, these two statements will give different results for varchar2 datatype, whereas sql server will treat both are same'select REF_CODE,REF_DESC from tbaadm.RCT where rct.REF_REC_TYPE =''01'' and RCT.REF_CODE = ''MAA''''select REF_CODE,REF_DESC from tbaadm.RCT where rct.REF_REC_TYPE =''01'' and RCT.REF_CODE ''MAA ''')--Chandu |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-26 : 22:42:59
|
Apply RTRIM and do the comparison then------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|