Viewing 15 posts - 3,901 through 3,915 (of 5,504 total)
Something like this?
;WITH cte AS
(
SELECT 50420 AS val UNION ALL
SELECT 50421 UNION ALL
SELECT 50422 UNION ALL
SELECT 50423 UNION ALL
SELECT 55030 UNION ALL
SELECT 56640 UNION ALL
SELECT 51010 UNION ALL
SELECT 53010 UNION...
March 25, 2010 at 2:51 pm
You have an answer on how to convert your character values into datetime format.
I also answered your question on how to get your input values transformed into datetime values (using...
March 25, 2010 at 2:42 pm
Did you notice that your sample data and your expected result don't match?
You could verify the result if you'd aggregate the three columns. The result should match the number of...
March 25, 2010 at 1:23 pm
Please keep in mind that you should not post real data.
And if you have a query to auto-generate those 4k rows you could just post that query so we can...
March 25, 2010 at 12:28 pm
Hi Matt,
I googled and found the following link: http://beyondrelational.com/blogs/jacob/archive/2008/08/21/xquery-lab-23-retrieving-values-and-position-of-elements.aspx
I applied it to your scenario resulting in the following code.
But when comparing execution plans for both solutions this new version seems...
March 25, 2010 at 11:38 am
Marv-1058651 (3/25/2010)
I want the sum of sales by employee grouped by the months going across.
basically...
March 25, 2010 at 10:58 am
You could use one of the following options. The reason your solution didn't work is you've assigned a table column instead of an alias name.
Side note: I added an ELSE...
March 25, 2010 at 10:56 am
The Dixie Flatline (3/25/2010)
It depends on whether or not it depends? :w00t:
Yes and/or no. :hehe:
March 25, 2010 at 10:40 am
Paul White NZ (3/24/2010)
The default string output...
March 25, 2010 at 9:47 am
Slick84 (3/25/2010)
In your query like below:
DECLARE @xml XML
SET @xml = (SELECT * FROM OPENROWSET(BULK 'c:\filepath\variablefileName', SINGLE_BLOB) AS x)
Can I somehow use a variable filename? This is because my filename...
March 25, 2010 at 9:40 am
Hi Matt,
I'd use XQuery instead of OPENXML in combination with PIVOT and UNPIVOT.
Something like the following:
DECLARE @xml XML
SET @xml='<ADKMessage>
<c n="totalmb" tn="3" t="1269017107034">
<v>139390.0</v>
<v>571133.0</v>
</c>
<c n="name" tn="1" t="1269017107034" kc="true">
<v>C:</v>
<v>D:</v>
</c>
<c n="freemb" tn="3" t="1269017107034">
<v>57649.14453125</v>
<v>516178.40625</v>
</c>
<c n="usedmb"...
March 24, 2010 at 4:09 pm
Thanx Wayne for taking over.
I've been busy in between so I couldn't follow up for a while...
@Slick: Glad it worked. 😀
Sometimes it's easier to rely on T-SQL including some new...
March 24, 2010 at 3:39 pm
If the values for field2 are fixed (0, 10, 20, 30), then you could either use PIVOT (see BOL for details) or DynamicCrossTab (see the related link in my signature).
If...
March 24, 2010 at 1:37 pm
Here's a sample code to populate three tables. Let me know if it helps and/or if you need any further assistance.
DECLARE @xml XML
SET @xml=(SELECT * FROM OPENROWSET(
BULK...
March 24, 2010 at 1:32 pm
Let's see what we can do...
Do you have to use SSIS or would a T-SQL / XQuery solution work for you, too?
If the latter, please provide a (valid) XML snippet...
March 24, 2010 at 12:49 pm
Viewing 15 posts - 3,901 through 3,915 (of 5,504 total)