Viewing 15 posts - 1,366 through 1,380 (of 14,953 total)
Here's something a bit flexible for this kind of thing:
DECLARE @String VARCHAR(1000) = 'Bev\Soda\The Dew',
@Delim CHAR(1) = '\',
@Elements INT = 0,
...
June 12, 2012 at 1:37 pm
Instead of a CTE, insert into a temp table, and query the count(*) and top (4000) from that.
June 12, 2012 at 12:57 pm
Given this table structure:
PostID | ParentPostID | Subject | Body | CreatedDate | ThreadID
Do you have any data where ParentPostID goes up to a row that also has a parent?...
June 12, 2012 at 12:00 pm
"Tuning" people and organizations is easy. You just have to know what you're doing. Most don't. A few are the equivalent of "he's good with computers, let's...
June 12, 2012 at 8:21 am
Something like this:
;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan')
SELECT * ,
query_plan.value('(/ShowPlanXML/BatchSequence/Batch/Statements/StmtSimple/QueryPlan/@CompileTime)[1]','int')
FROM sys.dm_exec_cached_plans
CROSS APPLY sys.dm_exec_query_plan(plan_handle) ;
You might want to Cross Apply query_plan.nodes() down to the Statements level, if you have multiple statements in...
June 9, 2012 at 2:22 pm
dwain.c (6/8/2012)
June 9, 2012 at 2:03 pm
In the SplitCMD function, is the number the position?
And, are the arguments always one digit (I think that's what I'm seeing in your sample), or are they potentially longer?
June 7, 2012 at 2:11 pm
You need to take "/sessions" out of there.
You're already going to that level because of the nodes() piece, so you need to start at "/session". nodes() is correct, value()...
June 7, 2012 at 1:54 pm
Sapen (6/7/2012)
Is there a way that I can loop through if I have too many xml records?
Not sure what you mean. Too many nodes in the XML?
June 7, 2012 at 1:32 pm
I've actually been seeing YMMV for many more years than SQL or HTTP or WWW. I know people were using YMMV in the '70s, because car ads had it...
June 7, 2012 at 1:31 pm
Your innermost query will be a list of all the teachers from LA.
Assuming a standard many-to-many structure, where you have a table-in-the-middle that has teachers and rooms in it, you...
June 7, 2012 at 12:57 pm
If you have IsNumeric in the Where clause, you can get some odd behavior, where it tries to convert out-of-range or invalid values to your numeric format, then filter them,...
June 7, 2012 at 12:42 pm
Recurs1on (6/7/2012)
June 7, 2012 at 11:04 am
The usual way to do that is to find the total count of teachers born in LA, then the count per room of teachers that were born in LA. ...
June 7, 2012 at 11:02 am
Viewing 15 posts - 1,366 through 1,380 (of 14,953 total)