Viewing 15 posts - 661 through 675 (of 5,504 total)
Why don't you use the DATEDIFF() function?
What's the goal you're trying to achieve?
January 23, 2012 at 4:39 pm
Thomas Abraham (1/20/2012)
Funny you should mention that. I'm taking my wife to Greece this Summer for two weeks. (Trying to talk her into retiring there.) That's where I would have...
January 23, 2012 at 4:21 pm
Something like this?
DECLARE @xml XML
SET @xml='<Policies>
<Policy>
<GroupUserName>BUILTIN\Administradores</GroupUserName>
<GroupUserId>AQIAAAAAAAUgAAAAIAIAAA==</GroupUserId>
<Roles>
<Role><Name>Administrador de contenido</Name></Role>
</Roles>
</Policy>
<Policy>
<GroupUserName>MEMSYS\EMEJIA</GroupUserName>
<GroupUserId>AQUAAAAAAAUVAAAAVss+Zs3s+svCUho7wgQAAA==</GroupUserId>
<Roles>
<Role><Name>Administrador de contenido</Name></Role>
<Role><Name>Explorador</Name></Role>
<Role><Name>Generador de informes</Name></Role>
<Role><Name>Mis informes</Name></Role>
<Role><Name>Publicador</Name></Role>
</Roles>
</Policy>
</Policies>'
;
WITH cte AS
(
SELECT
c.value ('(GroupUserName/text())[1]','VARCHAR(255)') GroupUserName,
v.value ('(Name/text())[1]','VARCHAR(255)') Name
FROM @xml.nodes ('Policies/Policy') T(c)
CROSS APPLY c.nodes('Roles/Role') U(v)
)
SELECT
GroupUserName,
STUFF(
(SELECT ',...
January 23, 2012 at 1:34 pm
Brandie Tarvin (1/23/2012)
jcrawf02 (1/23/2012)
Blargh. User just requested a pie chart for their analysis....:sick:Does this help?
Or how about this?
Referring to your first link: He asked for a...
January 23, 2012 at 11:40 am
There are a few thing I noticed:
a) In your WHERE clause you use CAST to convert receiptdate into a char value and compare it with @FromDate and @ToDate.
It's already in...
January 23, 2012 at 11:20 am
Is there any chance for you to post the actual execution plan as asked for before?
Otherwise all we can do is guessing and provide some rather vague recommendation...
January 22, 2012 at 5:18 am
meelan (1/21/2012)
So, 96GB is going to be just luxury and not used by Sql. Since the price difference between 64Gb and 96GB is not much here, i will choose 96GB...
January 22, 2012 at 1:37 am
Another reason might be the varchar value is in a different date format than the DATEFORMAT setting of SQL Server for the code block/session the query is used in.
Example: the...
January 21, 2012 at 2:44 pm
Depending on the SQL Server version you're planning to use, not all of the RAM can be used (e.g. Standard edition is limited to 64GB RAM as per Microsoft).
The next...
January 21, 2012 at 2:15 pm
Please have a look at the CrossTab and DynamicCrossTab article referenced in my signature.
Those might help you to find a solution.
However, I second Gus: it should be done at the...
January 17, 2012 at 4:49 pm
I'd start with first shredding the xml document:
DECLARE @xml XML
SET @xml=
'<STUDENTLIST>
<STUDENT>
<NAME>Doe</NAME>
<COURSE>Math</COURSE>
<COURSE>Computers</COURSE>
</STUDENT>
<STUDENT>
<NAME>Rick</NAME>
<COURSE>Science</COURSE>
<COURSE>Math</COURSE>
<COURSE>English</COURSE>
</STUDENT>
</STUDENTLIST>'
SELECT
T.c.value('(NAME/text())[1]','VARCHAR(30)') AS StudentName,
U.v.value('(./text())[1]','VARCHAR(30)') AS StudentCourse
INTO #temp
FROM @xml.nodes('STUDENTLIST/STUDENT') T(c)
CROSS APPLY T.c.nodes('COURSE') U(v)
Based on that I'd insert the grouped values for...
January 15, 2012 at 3:22 pm
I think you could wrap the original call into a TRY ... CATCH block and don't raise an error at the CATCH section.
January 15, 2012 at 7:16 am
jpdp101 (1/14/2012)
I think i forgot to mention one important thing, Table_Main has an unique index on for Col_A and Col_B..
does this mean the query did an Index...
January 15, 2012 at 3:33 am
Ok, 2008 version definitely makes it a little easier...
Here's my completed version. Please note that I didn't use your latest sample data since it would have taken too long to...
January 14, 2012 at 3:20 pm
Steve Jones - SSC Editor (1/14/2012)
shivani.kataria (1/13/2012)
Year is part of date and records are just seven days apart, and that makes it weekly. 14th Jan is missing for both and...
January 14, 2012 at 1:11 pm
Viewing 15 posts - 661 through 675 (of 5,504 total)