Viewing 15 posts - 46 through 60 (of 173 total)
The easiest method would be to place your case statements in a derived table and then perform a grouping of the results.
select year, max(yada)...
from
( yourqueryhere
) myDerivedTable
GROUP BY year
June 10, 2009 at 10:12 am
I would look at the emailTable populating process.
1 - create a distinct list of users who should receive email
2 - populate table information by level of validity
create table #tEmailList
insert into...
June 10, 2009 at 10:08 am
I guess I need an alibi for my alias...
I did NOT know that the locking behavior on temp stopped at 6.5...
thx...
February 13, 2009 at 6:04 am
determine where the query is slowing down.. Review the execution plan.
this site is GOLD! http://www.simple-talk.com/sql/performance/execution-plan-basics/
SWAGs
1.. place a clustered index on RevID in the temporary...
February 12, 2009 at 2:08 pm
The sub-query is required by the bizlogic
If one of transaction is between 01/09/2008 to 30/09/2008 then it will show all related transaction.
October 7, 2008 at 10:40 am
if exists(SELECT material_code
FROM MATERIAL_UPDATES
GROUP BY material_code
HAVING count(*) > 1)
BEGIN
select "Table has Duplicates"
RETURN
END
else
select "No Duplicates"
-- your query here
October 1, 2008 at 5:13 pm
I have used the Insert Into with Exec (below) and recently ran into a Sql issue. Insert Into with Exec() does not allow nested uses.
create table #tYada (...)
Insert...
October 1, 2008 at 5:11 pm
As far as I know, when a function is returning a table the input cannot change in the query.
Every different row in the above table join would return...
October 1, 2008 at 8:04 am
That worked to a 'T'.
thanks!
Daryl
September 8, 2008 at 2:10 pm
SqlProfiler could be the means to determine how the data is being inserted into your table.
Especially if you have a test environment to weed out the normal course...
July 31, 2008 at 3:06 pm
First thing would be determining where your data is originating. Your query starts with Part when it appears it should start at invoice. (by the right join)
<determine a...
July 31, 2008 at 2:56 pm
If the parameters are not used for the recursion (and I don't think they are) you can just create the view w/0 the where statement. Then when you access...
July 23, 2008 at 9:49 am
Syntax below works for commonTableExpressions
create vYourViewHere
as
with cteName as
(...)
select * from cteName
Note: cte's are usable in sprocs the point to remember is to add the semicolon before the WITH
create proc...
July 23, 2008 at 9:35 am
If you are fortunate enough to have a Data Layer this change may be less painful.
1- update sprocs with addition criteria 'group' (defaults to All, or not filtering)
2- at the...
July 23, 2008 at 9:30 am
Viewing 15 posts - 46 through 60 (of 173 total)