Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Join with contain Help
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

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

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

Aged Yak Warrior

549 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:

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

Go to Top of Page
  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000