Viewing 15 posts - 481 through 495 (of 698 total)
That could very well be your problem.
For example, there are two tables, T1 and T2, and an INSERT trigger is defined on T1. When a row is inserted to T1,...
July 8, 2011 at 6:39 am
One thing you should check is how you are retrieving that value to insert as the foreign key.
Make sure you are using SCOPE_IDENTITY(). That is the only reliable way of...
July 7, 2011 at 4:48 pm
You should realise, that even though using SELECT @Var = Data FROM TABLE will not crash when multiple rows are returned, the results that you get back from the query,...
July 7, 2011 at 4:33 pm
Again though be sure you don't use COUNT(*), since that will return a value of 1 even if the LEFT JOIN produces no results. Use COUNT(Name).
July 7, 2011 at 1:50 pm
Like LutzM said, you could use a CTE instead if you'd like, or make a physical table with the data. But bottom line is you need some way of telling...
July 7, 2011 at 1:45 pm
*Slight correction to post, sorry, forgot that you need to COUNT(Name) instead, that way you'll get the 0 results for the ones that don't have any records.
July 7, 2011 at 1:29 pm
GROUP BY takes all the results in the table and aggregates them. It has no way of knowing about any data which doesn't exist.
If you want to achieve your results,...
July 7, 2011 at 1:25 pm
Could be wrong, but I think what he means is that, because these developers switch from using stored procedures to inline ad-hoc queries, the plan cache gets filled up by...
July 7, 2011 at 6:14 am
Could you do something like:
SELECT
MIN(FileDate) AS 'StartDate',
MAX(FileDate) AS 'EndDate',
EmployeeID,
EmployeeName,
ManagerID
FROM dbo.EmployeeDaily
GROUP BY EmployeeID, EmployeeName, ManagerID
gary.proctor (7/6/2011)
I intend to use...
July 6, 2011 at 12:27 pm
I think I see your problem. In your SELECT clause, you say "ISNULL(mersum.subisonum,0),isnull(mersum.repnum,0) as repnum". In your GROUP BY clause, you say "mersum.subisonum,mersum.repnum".
If you change the GROUP BY clause to...
July 6, 2011 at 12:24 pm
Thanks for the suggestion!
I like that idea, except for one problem - that requires a trace to be running in order to capture the results.
If I apply the relevant filters...
July 6, 2011 at 11:25 am
You forgot to attach the doc 😛
July 6, 2011 at 11:17 am
Since its not always possible to actually modify the raw input data from the source, which I've seen many times, the best solution in my opinion is often to create...
July 6, 2011 at 11:16 am
Grats!
I'm curious - supposing you were a fairly experienced database developer, how much of the exam is theoretical questions which practical experience may never encounter, and thus would actually require...
July 6, 2011 at 10:25 am
Keep in mind I haven't tested this solution, since I have no linked servers on the server I'm currently using. But, this should work. Basically, you're looping through each linked...
July 6, 2011 at 8:59 am
Viewing 15 posts - 481 through 495 (of 698 total)