Click here to Skip to main content
14,769,456 members
Home » Discussions » Database
   

Database

 
GeneralRe: Naming my clustered index column which isn't the PK (and is a non-PK clustered Identity a good idea?) Pin
Jörgen Andersson25-Apr-18 3:15
professionalJörgen Andersson25-Apr-18 3:15 
GeneralRe: Naming my clustered index column which isn't the PK (and is a non-PK clustered Identity a good idea?) Pin
JChrisCompton25-Apr-18 6:47
MemberJChrisCompton25-Apr-18 6:47 
GeneralRe: Naming my clustered index column which isn't the PK (and is a non-PK clustered Identity a good idea?) Pin
Jörgen Andersson25-Apr-18 11:49
professionalJörgen Andersson25-Apr-18 11:49 
PraiseRe: Naming my clustered index column which isn't the PK (and is a non-PK clustered Identity a good idea?) Pin
JChrisCompton26-Apr-18 5:17
MemberJChrisCompton26-Apr-18 5:17 
QuestionEXCEPTIONS INTO Equivalent for SQL Server Pin
Member 1208387120-Apr-18 5:59
MemberMember 1208387120-Apr-18 5:59 
AnswerRe: EXCEPTIONS INTO Equivalent for SQL Server Pin
Eddy Vluggen23-Apr-18 6:21
professionalEddy Vluggen23-Apr-18 6:21 
GeneralRe: EXCEPTIONS INTO Equivalent for SQL Server Pin
Member 1208387123-Apr-18 6:24
MemberMember 1208387123-Apr-18 6:24 
Questionhow to access temp table field in subquery? Pin
joost.versteegen11-Apr-18 22:43
Memberjoost.versteegen11-Apr-18 22:43 
hi,
I get an error :
The multi-part identifier "e.ent_name" could not be bound.
when trying to access a field from a temp table in a sub-query.

declare @entities table(ent_id int, ent_name varchar(50), startDT datetime)

insert into @entities
select ent.ent_id, ent_name, prod_job.act_start_time_local
from job as prod_job
inner join ent as ent on prod_job.run_ent_id = ent.parent_ent_id
where prod_job.wo_id = 'B.100077779'

select * from @entities -- so far so good

select * from @entities as e
inner join
(
    select top(1) act_finish_time_local, oper_id from job as cleaningJob
    where cleaningJob.oper_id like '%'+ e.ent_name +'%' ----> error
    order by act_finish_time_local desc
)
as j on j.act_finish_time_local < e.startDT


how can i fix this?
Thanks
AnswerRe: how to access temp table field in subquery? Pin
Victor Nijegorodov11-Apr-18 23:18
MemberVictor Nijegorodov11-Apr-18 23:18 
AnswerRe: how to access temp table field in subquery? Pin
Mycroft Holmes12-Apr-18 0:42
professionalMycroft Holmes12-Apr-18 0:42 
GeneralRe: how to access temp table field in subquery? Pin
joost.versteegen12-Apr-18 0:53
Memberjoost.versteegen12-Apr-18 0:53 
AnswerRe: how to access temp table field in subquery? Pin
Richard Deeming19-Apr-18 3:34
mveRichard Deeming19-Apr-18 3:34 
QuestionExporting Select statement values into csv with escape characters Pin
indian1439-Apr-18 13:16
Memberindian1439-Apr-18 13:16 
AnswerRe: Exporting Select statement values into csv with escape characters Pin
Victor Nijegorodov9-Apr-18 21:27
MemberVictor Nijegorodov9-Apr-18 21:27 
QuestionReading csv file data using selecte statement Pin
indian1439-Apr-18 7:50
Memberindian1439-Apr-18 7:50 
AnswerRe: Reading csv file data using selecte statement Pin
Victor Nijegorodov9-Apr-18 9:37
MemberVictor Nijegorodov9-Apr-18 9:37 
GeneralRe: Reading csv file data using select statement Pin
indian14311-Apr-18 10:18
Memberindian14311-Apr-18 10:18 
Questionwriting complex queries in Sql Pin
emilyz788-Apr-18 9:42
Memberemilyz788-Apr-18 9:42 
Questionwriting complex queries in Sql Pin
emilyz788-Apr-18 9:42
Memberemilyz788-Apr-18 9:42 
AnswerRe: writing complex queries in Sql Pin
Mycroft Holmes8-Apr-18 13:57
professionalMycroft Holmes8-Apr-18 13:57 
AnswerRe: writing complex queries in Sql Pin
CHill609-Apr-18 0:33
mveCHill609-Apr-18 0:33 
AnswerRe: writing complex queries in Sql Pin
Eddy Vluggen9-Apr-18 3:16
professionalEddy Vluggen9-Apr-18 3:16 
QuestionConfiguring multiple properties or values in SSIS Package using Package Configuration file Pin
indian1432-Apr-18 15:18
Memberindian1432-Apr-18 15:18 
QuestionTrying to insert values into Table Variable in Dynamic Sql Pin
indian1432-Apr-18 14:17
Memberindian1432-Apr-18 14:17 
AnswerRe: Trying to insert values into Table Variable in Dynamic Sql Pin
Mycroft Holmes2-Apr-18 15:22
professionalMycroft Holmes2-Apr-18 15:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.