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
 SQL Joins
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

manners
Starting Member

1 Posts

Posted - 10/04/2012 :  03:53:47  Show Profile  Reply with Quote
Hi, I need help with a join. Relatively new to SQL.Any help greatly appreciated.Here's the code:

set identity_insert idx_ref_attribute_type on
go

Insert into idx_ref_attribute_type
(idx_attribute_type_id,
type_desc,
value_type,
daily_change,
purpose)

Select idx_factor_type_id,
factor_type_desc,
factor_value_type,
daily_change,
factor_purpose

From idx_factor_type

inner join idx_attribute_type

on idx_ref_attribute_type.membershp_attribute = idx_attribute_type.membership_attribute

set identity_insert idx_ref_attribute_type off


The error I get is:
[Error] Script lines: 3-23 -------------------------
The column prefix 'idx_ref_attribute_type' does not match with a table name or alias name used in the query. Either the table is not specified in the FROM clause or it has a correlation name which must be used instead.


Without the inner join and following line it works perfectly! =(

Cheers

webfred
Flowing Fount of Yak Knowledge

Germany
8765 Posts

Posted - 10/04/2012 :  04:15:19  Show Profile  Visit webfred's Homepage  Reply with Quote
I only could answer like this:
The column prefix 'idx_ref_attribute_type' does not match with a table name or alias name used in the query. Either the table is not specified in the FROM clause or it has a correlation name which must be used instead.


Too old to Rock'n'Roll too young to die.
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2215 Posts

Posted - 10/04/2012 :  05:10:04  Show Profile  Reply with Quote
quote:
Originally posted by manners

Hi, I need help with a join. Relatively new to SQL.Any help greatly appreciated.Here's the code:

set identity_insert idx_ref_attribute_type on
go

Insert into idx_ref_attribute_type
(idx_attribute_type_id,
type_desc,
value_type,
daily_change,
purpose)

Select idx_factor_type_id,
factor_type_desc,
factor_value_type,
daily_change,
factor_purpose

From idx_factor_type

inner join idx_attribute_type

on idx_ref_attribute_type.membershp_attribute = idx_attribute_type.membership_attribute

set identity_insert idx_ref_attribute_type off


The error I get is:
[Error] Script lines: 3-23 -------------------------
The column prefix 'idx_ref_attribute_type' does not match with a table name or alias name used in the query. Either the table is not specified in the FROM clause or it has a correlation name which must be used instead.


Without the inner join and following line it works perfectly! =(

Cheers



Try this one


From idx_factor_type

inner join idx_attribute_type

on idx_factor_type.membershp_attribute = idx_attribute_type.membership_attribute

i think u mistakenly wrote idx_ref_attribute_type

--
Chandu
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