Viewing 15 posts - 406 through 420 (of 14,953 total)
SQL_Kills (12/11/2012)
Sorry what is the above meant to be saying to me?
One of the common flaws in dynamic SQL is that it allows what's called "SQL Injection". Simple version...
December 11, 2012 at 12:25 pm
In that case, try the version I posted, with the OR clause in it. Case will do the same thing, but can result in even more complex execution plans...
December 11, 2012 at 12:22 pm
I'd be inclined to create an indexed view that breaks the data down for you, and then query that.
Alternatively, a set of computed columns in the table itself.
Computed columns version:
USE...
December 11, 2012 at 11:41 am
I can't tell what criteria you are using to determine which rows to return in your query.
Is it the last (per EntryDate) for each quiz? The first? Something...
December 11, 2012 at 11:11 am
Get rid of the "o.name <> 'GLUCOSE'" part. It's the primary problem here.
Change the "o.entered_date <> '2012-12-11 06:35:55.120'" to a simple less-than. Should be "o.entered_date < '2012-12-11 06:35:55.120'"....
December 11, 2012 at 11:06 am
Yup. Looks like you've probably got it.
December 11, 2012 at 9:50 am
You're welcome. Glad we could help.
I just saw arthurolcot's post.
If the log entries are always singular, that will work. I used the nodes() function in my solution in...
December 11, 2012 at 9:48 am
jbnv (12/11/2012)
Jeff Moden (12/11/2012)
jbnv (12/11/2012)
December 11, 2012 at 9:42 am
It is a good question.
I'd hope for answers along the lines of, "There are several options, depending on the server settings (including whether dbmail has been enabled or not), the...
December 11, 2012 at 9:28 am
Guras (12/11/2012)
December 11, 2012 at 9:22 am
Here's a simple version:
DECLARE @XML XML = '
<server name="Server1">
<log>
<logItem type="LogDate">
<value string="2012/12/15" />
</logItem>
<logItem type="error">
<value string="File not found" />
</logItem>
<logItem type="source">
<value string="Dir/SubDir/SomeFile" />
</logItem>
</log>
</server>';
SELECT LogItem.value('(/logItem/value/@string)[1]', 'varchar(max)') AS ErrorString
FROM (SELECT L.Item.query('.')...
December 11, 2012 at 9:16 am
If you're using SQL 2008 (as per the forum you posted in), then yes, there's a simple solution. Cast the columns to NVarchar(max). That will work in any...
December 11, 2012 at 8:55 am
TheSQLGuru (12/11/2012)
GSquared (12/10/2012)
Like this:
WHERE (@finclass = 1 AND p.finclass = @FinclassCategory OR @finclass != 1)
AND P.HOSPITAL = @HOSPITAL
This is going to get you a BAD cached plan. No matter...
December 11, 2012 at 7:50 am
Viewing 15 posts - 406 through 420 (of 14,953 total)