Viewing 15 posts - 16 through 30 (of 119 total)
Thank you both for your help, the query does make sense, thank you.
If I run this for a slightly different sample data set, I get:
DECLARE @T TABLE (Id INT, Category...
May 13, 2015 at 4:31 pm
Thank you for your response. Yes, as the title suggests I'm trying to calculate the running totals.
So for the first row:
15 is the Total count
11 is the Activated count
May 13, 2015 at 2:35 pm
Thanks again, appreciate the help. If I added an additional attribute (ProductId) in my sample data would it be possible to include this in the result set so that it...
December 13, 2014 at 11:38 am
Jeff Moden (12/10/2014)
clayman (12/10/2014)
See sample data below. I want hourly breakdown for the last X years, the month and day will be the same for each year. Thank you
SELECT...
December 10, 2014 at 10:37 pm
Thanks, figured it out. The second solution seems to run ~6-7 times faster.
December 3, 2014 at 11:01 am
Thank you. Can you please help changing the query so that it also works with a date range ( from date, to date)? What I'd like to do is I'd...
December 2, 2014 at 5:11 pm
Thank you. Your query also returns data for October, I Only want to return data for the last 30 days so the oldest data I want to see should be...
December 1, 2014 at 5:11 pm
Thank you.
Is there a way to replace A2 with something so that it is not hard-coded?
SET @TXML.modify('insert sql:variable("@NXML") after (/Attribute/A2)[1]');
No guarantees that A2 node will exist as they are optional....
November 23, 2014 at 7:22 pm
This is not the first time you are trying to help me out. Thank you very much.
I should have mentioned that my XML is validated against a schema that looks...
November 23, 2014 at 1:01 pm
SET @XML.modify('replace value of (Attribute/*[local-name()=sql:variable("@n")]/text())[1] with sql:variable("@v")')
Seems to work ok. Thanks.
November 21, 2014 at 5:03 pm
Thank You!
Could you also tell what the query would be if I wanted to update the value of <A3> from a sql variable?
DECLARE @XML XML = '<Attribute>
<A1>6529</A1>
...
November 21, 2014 at 3:58 pm
Thanks for your response.
The number of attributes/values will be different for each order item, some may have only 2-3, others may have a hundred. Say I can have at most...
October 30, 2014 at 9:49 am
Seong-Bae Hwang (10/18/2014)
If t2 has large volume of data, there would be performance issue on your approach. My approach is below.
USE tempdb;
GO
DECLARE @t TABLE (Id INT);
INSERT INTO @t
VALUES(108)
, (102)
, (103)
,...
October 20, 2014 at 4:02 pm
The reason why I split the string is that I want to order the Ids, eg.
DECLARE @INPUT_STR VARCHAR(50) = '101,102,103,108';
will be the same as
DECLARE @INPUT_STR VARCHAR(50) = '103,102,101,108';
October 17, 2014 at 5:28 pm
Viewing 15 posts - 16 through 30 (of 119 total)