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 2012 Forums
 Transact-SQL (2012)
 case statement
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gaviliv
Starting Member

USA
1 Posts

Posted - 03/06/2014 :  11:29:26  Show Profile  Reply with Quote
I am trying to update columns in a table based on join condition and included in create statement using case statement:

Following is part of create statement:

[SAV Sub-Segment] AS (case when ([Validated End Customer Name]=[dbo].[SLED_VAL-GM-MAPPING].[SAV Name]) THEN [dbo].[SLED_VAL-GM-MAPPING].[SAV Sub Segment ] else NULL end),

and get the following error
"The multi-part identifier "dbo.SLED_VAL-GM-MAPPING.SAV Name" could not be bound."

James K
Flowing Fount of Yak Knowledge

3744 Posts

Posted - 03/06/2014 :  15:40:05  Show Profile  Reply with Quote
quote:
Originally posted by gaviliv

I am trying to update columns in a table based on join condition and included in create statement using case statement:

Following is part of create statement:

[SAV Sub-Segment] AS (case when ([Validated End Customer Name]=[dbo].[SLED_VAL-GM-MAPPING].[SAV Name]) THEN [dbo].[SLED_VAL-GM-MAPPING].[SAV Sub Segment ] else NULL end),

and get the following error
"The multi-part identifier "dbo.SLED_VAL-GM-MAPPING.SAV Name" could not be bound."

Does your join include the table dbo.SLED_VAL-GM-MAPPING? If it does, is it aliased?

Would be easier to identify the problem if you post the entire query, or at least everything in the FROM clause.
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22769 Posts

Posted - 03/10/2014 :  05:13:26  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
quote:
Originally posted by gaviliv

I am trying to update columns in a table based on join condition and included in create statement using case statement:

Following is part of create statement:

[SAV Sub-Segment] AS (case when ([Validated End Customer Name]=[dbo].[SLED_VAL-GM-MAPPING].[SAV Name]) THEN [dbo].[SLED_VAL-GM-MAPPING].[SAV Sub Segment ] else NULL end),

and get the following error
"The multi-part identifier "dbo.SLED_VAL-GM-MAPPING.SAV Name" could not be bound."



The syntax is wrong. It should be

[SAV Sub-Segment] =(case when ([Validated End Customer Name]=[dbo].[SLED_VAL-GM-MAPPING].[SAV Name]) THEN [dbo].[SLED_VAL-GM-MAPPING].[SAV Sub Segment ] else NULL end),

Madhivanan

Failing to plan is Planning to fail
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.08 seconds. Powered By: Snitz Forums 2000