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
 General SQL Server Forums
 New to SQL Server Programming
 Join with contain Help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

masond
Constraint Violating Yak Guru

447 Posts

Posted - 08/15/2013 :  07:00:51  Show Profile  Reply with Quote
Hey guys

I am hoping this is the last question of the day
Aim – There are various lengths of MID_External and MID_Internal in the [FDMS].[SalesForce].[DailyAccounts] table.
I want to find some kind of match from [FDMS].[SalesForce].[DailyAccounts] into [FDMS].[dbo].[stg_LMPAB502] where ,[Client_Conf] = ‘Y’

The length of FDMSaccountno is 12 and the length of external_Id is 15 in table [FDMS].[dbo].[stg_LMPAB502]. This is the correct length for these appropiate fields

SELECT [FDMSAccountNo]
,[External_ID]
,[Client_Conf]
FROM [FDMS].[dbo].[stg_LMPAB502]
MID_Internal = FDMSaccountno
MID_External = [External_ID]

Would appreciate any help available

Eg results
Mid_internal 870650888 = Length 11
Fdmdaccountno 878306508887 = Length 11
would be a match

Edited by - masond on 08/15/2013 07:41:17

MuMu88
Aged Yak Warrior

547 Posts

Posted - 08/15/2013 :  10:22:01  Show Profile  Reply with Quote
It is not clear what you want, if you want to verify the length of a field you can do this:


SELECT [FDMSAccountNo]
 ,[External_ID] 
 ,[Client_Conf]
 FROM [FDMS].[dbo].[stg_LMPAB502] 
(MID_Internal = FDMSaccountno and LEN(MID_Internal) = 11) 
and
MID_External = [External_ID] 


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 0.06 seconds. Powered By: Snitz Forums 2000