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 2008 Forums
 Transact-SQL (2008)
 SPACE ISSUE IN SQL SERVER

Author  Topic 

kond.mohan
Posting Yak Master

213 Posts

Posted - 2013-02-21 : 09:18:44
dear all
we 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.

----SQLSERVER
SELECT REF_CODE,REF_DESC FROM RCT WHERE rct.REF_REC_TYPE ='01' and RCT.REF_CODE = 'MAA'
--OUTPUT
REF_CODE REF_DESC
MAA CHENNAI
MAA MASHAD

USING OPEQUERY EXECUTING ON ORACLE DATABASE
select * from openquery(finuat,'select REF_CODE,REF_DESC from tbaadm.RCT where rct.REF_REC_TYPE =''01'' and RCT.REF_CODE = ''MAA''')
---------OUTPUT
REF_CODE REF_DESC
MAA CHENNAI
select * from openquery(finuat,'select REF_CODE,REF_DESC from tbaadm.RCT where rct.REF_REC_TYPE =''01'' and RCT.REF_CODE ''MAA ''')
--------OUTPUT
REF_CODE REF_DESC
MAA 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 MVP
http://visakhm.blogspot.com/

Go to Top of Page

kond.mohan
Posting Yak Master

213 Posts

Posted - 2013-02-22 : 00:17:35
datatype is :REF_CODE(nvarchar(5),null)
Go to Top of Page

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
Go to Top of Page

kond.mohan
Posting Yak Master

213 Posts

Posted - 2013-02-22 : 04:52:57
hi all
same field in oracle is
varchar2 datatype
Go to Top of Page

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

Go to Top of Page

kond.mohan
Posting Yak Master

213 Posts

Posted - 2013-02-22 : 07:24:32
DEAR ALL
we are connecting through linked server.which using in SSIS packages.
fetching all the data without any trnsforamtions between source and distnations(full load).
Go to Top of Page

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 MVP
http://visakhm.blogspot.com/

Go to Top of Page

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
Go to Top of Page

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 MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -