Viewing 15 posts - 646 through 660 (of 1,156 total)
Like I said I would not use dynamic sql, if I did not have to. Dynamic SQL does not reuse execution plans and can hinder performance, if there are...
February 14, 2008 at 11:08 am
Ah, much better. Thanks for the tip, I knew the equivilant but didnt even think to use it.
Thanks.
February 14, 2008 at 10:25 am
Post with Matt's tip.
CREATE PROCEDURE TEST
@filter VARCHAR(100)
AS
BEGIN
DECLARE @x XML
SET @x = '<i>' + REPLACE( @filter, '|', '</i><i>') + '</i>'
SELECT *
FROM MyTable
WHERE [Status]
IN (SELECT x.i.value('.', 'VARCHAR(7)')
FROM @x.nodes('//i') x(i))
END
February 14, 2008 at 10:24 am
Man, I hate how this site strips the XML. You have to change the question marks to open and close xml tags ( )
DECLARE @x XML
SET @x = '?i?'...
February 14, 2008 at 8:17 am
I dont know how your tables are indexed or anything but you could use some simple xml to parse a string and retreive values from the table based on the...
February 14, 2008 at 8:13 am
You should note that if you alter the left join to an inner join both queries return the same result. The reason the inner join works is the inner...
February 14, 2008 at 7:11 am
I pasted your solution in Jeff and it seems both queries use the same execution plan.
February 13, 2008 at 9:33 pm
Looks like you beat me to it Jeff. My solution is a little different than yours and I dont know how the performance is different but there is more...
February 13, 2008 at 9:29 pm
You could actually do something like this:
create table Test1(
id int,
descr varchar(25),
Col char(1)
)
go
INSERT INTO Test1
select 1, 'test1', 'Y' union all
select 2, 'test1', 'Y'
go
create table Test2(
id int,
descr varchar(25),
Col char(1)
)
go
INSERT INTO Test2
select...
February 13, 2008 at 6:22 pm
Alorenzini,
CASE Repflag =
WHEN RepFlag = (Select Repflag From #Temp WHere r.ConsultantID = d.COnsultantID ) THEN 'x'
WHEN repFlag =(Select Repflag From #Temp WHere r.ConsultantID = d.COnsultantID AND d.CurrentLevelXID = r.AchieveLevel...
February 13, 2008 at 1:54 pm
Johnnie,
The stored procedure we helped him with is returning the correct results however he has extended it to work inside his main process. The main process is not marking...
February 13, 2008 at 1:52 pm
A case statement is more along the lines of what I was thinking. I was thinking something like this.
CASE
WHEN d.CurrentLevelXID = r.AchieveLevel AND
r.PeriodEndDate < (SELECT MAX(a.PeriodEndDate)
FROM #temp a...
February 13, 2008 at 1:48 pm
Do you need to reset mycount after the 72 records have been processed? Otherwise mycount will still be 72 for the second loop through @selectnum
February 13, 2008 at 12:28 pm
I really do not know enough about this main process to give a concise answer. I would start by looking at why are joining with a left outer join,...
February 13, 2008 at 11:05 am
Viewing 15 posts - 646 through 660 (of 1,156 total)