Viewing 15 posts - 14,386 through 14,400 (of 14,953 total)
Does this do what you need?
;with CTE (ConsultantID) as
(select consultantid
from volume
where deactivationdate between @startdate and @enddate
and active = 0
group by consultantid
having sum(purchaseamount) > 1000)
update #Temp6
set points = points + 1
grom...
April 3, 2008 at 8:49 am
d.col1 = replace(c.col1, '-','')
April 3, 2008 at 8:33 am
bitbucket (4/3/2008)
For Steve and others - might I suggest asking a few users to form a panel to check the questions BEFORE they are published...
April 3, 2008 at 8:31 am
I modified your test data as follows:
create table prod (pid int primary key, name varchar(10), pdesc varchar(max))
insert into prod (pid, name) values (1,'prod1')
insert into prod (pid, name) values (2,'prod2')
create...
April 3, 2008 at 8:19 am
Soundexes for "Gardeners" and "Garden'" are the same (G635), but soundexes for "Botanicals" and "Bot'icals" aren't the same (B352 vs B300). It might help narrow down the similarities, but...
April 3, 2008 at 7:36 am
If you want to change the data:
update dbo.YourTableName
set YourColumnName = replace(YourColumnName, '-', '')
where YourColumnName like '%-%'
That'll be better than having a function in your Join clause, in terms of performance....
April 3, 2008 at 7:31 am
PW (4/2/2008)
SELECT Convert(Char(15),LastUpdate,106) as LastUpdate..
...
ORDER BY LastUpdate desc
The 2 "LastUpdate" references above...
April 3, 2008 at 7:22 am
Jeff Moden (4/2/2008)
Your solution doesn't work with the test data I created. Please post your test data generator and the result times you got.
Gus, you're splitting out more than...
April 3, 2008 at 7:00 am
Jeff Moden (4/1/2008)
GSquared (4/1/2008)
select dateadd(month, 1, cast(enddate + '01' as datetime)) - 1
from dbo.sasimp
Should give you what you need. If it gives you an error about converting enddate to...
April 3, 2008 at 6:58 am
Jeff Moden (4/2/2008)
GSquared (4/2/2008)
Jeff, please tell me what I got wrong on the Numbers table version
At a high level, yes... You split on the "&" instead of the "=" which...
April 3, 2008 at 6:23 am
Looks like this one got set up incorrectly.
April 3, 2008 at 6:18 am
(I have to confess I wasn't as courteous as Antonio, and posted my tests on Numbers/Tally vs XML on the original thread. That's here: http://www.sqlservercentral.com/Forums/Topic478171-338-2.aspx)
April 2, 2008 at 2:06 pm
Just in case the Cross Apply is somehow more efficient than a straight up join (which is ridiculous on the face of it), I also tested:
ALTER function [dbo].[StringParser]
(@String_in varchar(max),
@Delimiter_in char(1))
returns...
April 2, 2008 at 2:03 pm
XML Function test:
ALTER function [dbo].[StringParserXML]
(@String_in varchar(max),
@Delimiter_in char(10))
returns @Parsed table (
Parsed varchar(100))
as
-- This one is faster than StringParser, but it doesn't correctly handle
-- XML-specific characters, such as "<" or "&". ...
April 2, 2008 at 1:51 pm
I created test data as follows:
create table ParserTest (
ID int identity primary key,
String varchar(max))
go
insert into dbo.parsertest (string)
SELECT 'Subject=Drilling&Category=Drill Header&Status=NO&IPPDM_Count=94356'
+'&Well_Count=84353&Zone_Status=NO&Prod_String_Count=95249&R_Master_W_Count=94353&'
+'BeginDate=2/3/2008&EndDate=2/5/2008'
from common.dbo.bignumbers
insert into dbo.parsertest (string)
SELECT 'Subject=Zone&Category=Zone Header&Status=YES&IPPDM_Count=94356&Well_Count='
+'94356&Zone_Status=NO&Prod_String_Count=95249&R_Master_W_Count=94356&AddlZoneInterest'
+'=107674'
from common.dbo.bignumbers
Then I tested a...
April 2, 2008 at 1:43 pm
Viewing 15 posts - 14,386 through 14,400 (of 14,953 total)