SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SPACE ISSUE IN SQL SERVER
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kond.mohan
Posting Yak Master

India
189 Posts

Posted - 02/21/2013 :  09:18:44  Show Profile  Reply with Quote
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

India
52309 Posts

Posted - 02/21/2013 :  22:41:12  Show Profile  Reply with Quote
whats the datatype of REF_CODE ?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

kond.mohan
Posting Yak Master

India
189 Posts

Posted - 02/22/2013 :  00:17:35  Show Profile  Reply with Quote
datatype is :REF_CODE(nvarchar(5),null)
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2202 Posts

Posted - 02/22/2013 :  03:18:19  Show Profile  Reply with Quote
In Oracle database, what is the data type of REF_CODE ?

--
Chandu
Go to Top of Page

kond.mohan
Posting Yak Master

India
189 Posts

Posted - 02/22/2013 :  04:52:57  Show Profile  Reply with Quote
hi all
same field in oracle is
varchar2 datatype
Go to Top of Page

DonAtWork
Flowing Fount of Yak Knowledge

2161 Posts

Posted - 02/22/2013 :  07:20:57  Show Profile  Reply with Quote
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

India
189 Posts

Posted - 02/22/2013 :  07:24:32  Show Profile  Reply with Quote
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

India
52309 Posts

Posted - 02/23/2013 :  02:08:44  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
2202 Posts

Posted - 02/26/2013 :  09:14:14  Show Profile  Reply with Quote
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

India
52309 Posts

Posted - 02/26/2013 :  22:42:59  Show Profile  Reply with Quote
Apply RTRIM and do the comparison then

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 2.52 seconds. Powered By: Snitz Forums 2000