November 25, 2019 at 4:30 pm
Is that possible? To have two databases with one query? If so the query below should populate some data! If not, how can I accomplish the task?
SELECT JobSheet.dbo.JobHrs.JobNo, JobSheet.dbo.JobHrs.ActualHrs, JobSheet.dbo.JobHrs.ReworkHrs, TimeReporting.dbo.TimeData.Time, TimeReporting.dbo.TimeData.Rework
FROM JobSheet.dbo.JobHrs
INNER JOIN TimeReporting.dbo.TimeData ON JobSheet.dbo.JobHrs.JobNo = TimeReporting.dbo.TimeData.JobNo
WHERE JobSheet.dbo.JobHrs.JobNo = '19-0228B'
Steve Anderson
November 25, 2019 at 4:46 pm
Yes, it's possible. A SELECT statement won't populate any data, though. What exactly are you trying to do?
John
November 25, 2019 at 4:58 pm
This is great because yes, it runs but populates no data.
Tried this as well:
SELECT T1.JobNo, T1.ActualHrs, T1.ReworkHrs , T2.Time, T2.Rework
FROM JobSheet.dbo.JobHrs T1
INNER JOIN TimeReporting.dbo.TimeData T2 ON T1.JobNo = T2.JobNo
WHERE T1.JobNo = '19-0228B'
In actuality, I want to read the field TimeData.Time from one database table, and populate it in JobHrs.ActualHrs in another database table. I am actually wanting to place a query in a Typed Dataset in Visual Studio.
Steve Anderson
November 25, 2019 at 5:38 pm
Populate data vs show data, my dilemma is that I see no data for my query at all. I don't agree that this should be the case, unless there is a another way to accomplish this. I'm not looking for the Visual Studio solution here, but what is the solution?
Steve Anderson
November 25, 2019 at 8:13 pm
This is your query:
SELECT T1.JobNo, T1.ActualHrs, T1.ReworkHrs , T2.Time, T2.Rework
FROM JobSheet.dbo.JobHrs T1
INNER JOIN TimeReporting.dbo.TimeData T2 ON T1.JobNo = T2.JobNo
WHERE T1.JobNo = '19-0228B'
If you are getting no data, then check these items:
Michael L John
If you assassinate a DBA, would you pull a trigger?
To properly post on a forum:
http://www.sqlservercentral.com/articles/61537/
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply