Viewing 15 posts - 5,971 through 5,985 (of 6,036 total)
CREATE PROCEDURE dbo.MyProc @Script ntext
AS
......
GO
EXEC dbo.MyProc ''
and assign your SQL string to @Script inside SP.
_____________
Code for TallyGenerator
And "E4.EmpId <=E.EmpId" is priority for employees to be returned.
If you want another criteria choose another unique key for employees - join date, duration period on the job, etc.
_____________
Code for TallyGenerator
Try this:
SELECT *
FROM (select E1.EmpId, E1.EmpName, E2.ReportTo from Employee E1
inner join Employee E2 on E1.ReportTo = E2.EmpID
where E2.ReportTo IS NULL) TL
INNER JOIN Employee E on E.ReportTo = TL.EmpId
WHERE (SELECT COUNT(EmpId)
From...
_____________
Code for TallyGenerator
Indexed view is a table, in fact.
When you select data from indexed view you don't run the query because data is already prepared for selecting.
Query is being run every time...
_____________
Code for TallyGenerator
View is just a piece of code for retrieving data.
This code is compiled first time it's being used and is stored in database compiled until you change it.
Using view is...
_____________
Code for TallyGenerator
First and dummiest: single quote instead of double quote.
_____________
Code for TallyGenerator
When you press "Restore DB" EM runs set of queries searching for physical devises, last backups, etc.
8 queries in total.
Run profiler and find out which query causes your error.
Probably it's...
_____________
Code for TallyGenerator
0,1,2 -> /3 = 0
If you need to group weeks 1,2,3 then you need to substract 1 from those values.
If you need to group 2,3,4 then substract 2.
_____________
Code for TallyGenerator
GROUP BY (Number_of_the_week - 1)/3
GROUP BY (Number_of_the_week - 1)/6
_____________
Code for TallyGenerator
Viewing 15 posts - 5,971 through 5,985 (of 6,036 total)