Viewing 15 posts - 6,676 through 6,690 (of 8,760 total)
serg-52 (10/30/2014)
Alternatively use OPENXML
DECLARE @xmlDocument nvarchar(max)
SET @xmlDocument = N'<table>
<tr>
<td>cell1</td>
<td>cell2</td>
<td>cell3</td>
</tr>
<tr>
...
October 30, 2014 at 8:23 am
Tweaking the code a little bit more shaves off approximately 17 percent, here is an all in one code
😎
USE tempdb;
GO
SET NOCOUNT ON;
--===== Create the 100K row test table
...
October 30, 2014 at 5:01 am
Quick thought, the dynamic sql should be nvarchar so use NCHAR(39) where it's needed, it is on the other hand not needed for the parameters, use sp_executesql and the execution...
October 30, 2014 at 1:50 am
Thanks Alan and Jeff, very good job indeed!
This is really the SSC community at it's best and although I haven't had any time to look properly into this, Alan and...
October 29, 2014 at 11:29 pm
A quick solution, should get you passed this hurdle
😎
USE tempdb;
GO
SET NOCOUNT ON;
DECLARE @TXML XML = '<table>
<tr>
<td>cell1</td>
<td>cell2</td>
<td>cell3</td>
...
October 29, 2014 at 2:37 pm
Quick suggestion, use a case statement
😎
USE tempdb;
GO
create table dbo.fun_test(
packtype nvarchar(50),
price money)
insert into dbo.fun_test
values ('Single','2'),('Monthly','25.00'),('Monthly','27.00'),('Monthly','23.50'),('Single','2'),('Deposit','1'),('Deposit','2')
select
PackType
,count(*) as Records
,sum(CASE ...
October 28, 2014 at 11:16 am
Little clean up in the logic, now it looks pretty good
😎
/********************************************************************
-- Stripping out any non-numerical characters
-- EE 2014-10-28 Inital coding
-- EE ...
October 28, 2014 at 7:22 am
Looks like this is coming from sqlmap (sqlmap.org), automated injection tool.
😎
October 28, 2014 at 6:48 am
SQL Server's implementation of the window functions does not allow for sharing window specification (over clause specs) between functions.
😎
October 28, 2014 at 3:21 am
Here is my attempt from the train journey to work this morning, looks like it will give the while loop a real run for the money.
😎
/********************************************************************
-- Stripping out any...
October 28, 2014 at 2:55 am
Nice problem, just what's needed to get the brain started in the morning:-D
😎
/* BASE_DATA brings together everything that is needed, adds
a group identifier for...
October 27, 2014 at 10:37 pm
Some test results, looks like the computed column method is roughly 4 times faster than the next one
😎
Beginning execution loop
--============================================================================================================
-- Method 1 by sqlslacker
-- ...
October 27, 2014 at 7:44 am
Chipping in a little more, another method is a computed column and an index on that column, here is a script adapted to fit Jeff's test harness, append it at...
October 27, 2014 at 6:33 am
Quick thought, embed the case statement in a CTE and then do the aggregations on the output.
😎
October 27, 2014 at 12:23 am
Quick note, if the ROW_NUMBER function has a satisfying index to work on it is not expensive at all, consider the code below which only does one index scan and...
October 26, 2014 at 11:52 pm
Viewing 15 posts - 6,676 through 6,690 (of 8,760 total)