Find Jobs
Hire Freelancers

How to bind to a column for a where clause, no join between tables

$10-30 USD

Completed
Posted almost 7 years ago

$10-30 USD

Paid on delivery
I need to join to get the phone number from the PEOPLECHANGES table. When I try to filter I get the error The multi-part identifier "dbo.PEOPLECHANGES.People_ID" could not be bound. There's no join between the tables so I can't alias it. How do I bind to it? USE Bridge declare @NextIdentityID table (PersonId int, People_ID int); INSERT INTO [dbo].[PeopleTest] ([People_ID] ,[text]) output Inserted.People_ID, [login to view URL] into @NextIdentityID(People_ID, PersonId) SELECT PEOPLE_ID,'row1' --PEOPLE_ID, 000092437 FROM PeopleChanges WHERE PEOPLE_ID = '000092435' --just insert our single test row select * from @NextIdentityID INSERT INTO [dbo].[Phone] --Msg 8152, Level 16, State 4, Line 14, String or binary data would be truncated. ([PersonPhoneId] --000092437 ,[PersonId] --PersonId int 361 ,[PhoneType] --'Home Row 1' ,[Number]) --(927)968-7544, NULL, (214)709-3001 /* @NextIdentityID PersonId People_ID 388 92435 PEOPLECHANGES PEOPLE_ID 000092437 */ --method if PersonPhoneID not equal PEOPLE_ID, no join, use where PC.PEOPLE_ID = Idn.PEOPLE_ID select PEOPLE_ID, [login to view URL],'Home Row 1', REPLACE(REPLACE(REPLACE(REPLACE(Phone1,'(',''),' ',''),'-',''),')','') from @NextIdentityID Idn WHERE Idn.PEOPLE_ID = CONVERT(INT, dbo.PEOPLECHANGES.People_ID) --PEOPLE_ID 000092437, PersonID 92437 one is varchar, one is integer --The multi-part identifier "dbo.PEOPLECHANGES.People_ID" could not be bound. Msg 207, Level 16, State 1, Line 31 I can select from PEOPLECHANGES and get the following resultes SELECT PEOPLE_ID FROM PEOPLECHANGES WHERE PEOPLE_ID = '000092437' Results PEOPLE_ID 000092437
Project ID: 14162287

About the project

6 proposals
Remote project
Active 7 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
$15 USD in 1 day
5.0 (8 reviews)
3.5
3.5
6 freelancers are bidding on average $16 USD for this job
User Avatar
Dear Sir/Madam, Hope you are doing well. As a database administrator and developer have done tasks like this to understand and recommend on SQL's. Could we please have a chat and start the work? Thanks, Pratik
$15 USD in 0 day
4.6 (3 reviews)
3.2
3.2
User Avatar
Greetings. I am MSSQL dba. Having 13 years of IT experience. 5 years as dedicated dba and 8 years as .NET/SQL developer. Please ping me to discuss more. Looking to work with you to solve this. Thanks & Regards, Milind
$10 USD in 1 day
4.9 (6 reviews)
2.5
2.5
User Avatar
A proposal has not yet been provided
$30 USD in 1 day
5.0 (2 reviews)
1.9
1.9
User Avatar
Hello, I am able to writing sql query, If you give me chance to me. I am available now for discuss more in detail Regards, Chirag
$13 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
SAN ANGELO, United States
5.0
273
Payment method verified
Member since Jul 28, 2008

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.