Viewing 15 posts - 3,601 through 3,615 (of 3,957 total)
Jeff Moden (5/15/2012)
Shifting gears back to the subject at hand... there's a While Loop...
May 15, 2012 at 11:36 pm
Jeff Moden (5/15/2012)
dwain.c (5/15/2012)
Jeff Moden (5/15/2012)
dwain.c (5/15/2012)
Jeff Moden (5/15/2012)
dwain.c (5/14/2012)
Forgive me oh experts for I have sinned. I have not compared performance against other suggestions. 🙂
Since you used a...
May 15, 2012 at 10:27 pm
Jeff Moden (5/15/2012)
dwain.c (5/15/2012)
Jeff Moden (5/15/2012)
dwain.c (5/14/2012)
Forgive me oh experts for I have sinned. I have not compared performance against other suggestions. 🙂
Since you used a recursive CTE for...
May 15, 2012 at 7:22 pm
Another puzzle:
DECLARE @t TABLE (ID INT IDENTITY, strcol VARCHAR(100))
INSERT INTO @t
SELECT '[p]a]a]s]s][p'
UNION ALL SELECT '[z]z]z]z]y][y'
;WITH Tally (n) AS (
SELECT TOP 100 ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) FROM sys.all_columns)
SELECT...
May 15, 2012 at 7:15 pm
Note that the computed result after all THENs (or ELSE) must match in datatype.
I don't see that as a problem in your CASE (:-)) but I thought I'd mention it.
May 15, 2012 at 6:34 pm
Jeff Moden (5/15/2012)
Lynn Pettis (5/15/2012)
There was a recent thread where the OP wanted to return the difference between two date/time values as hh:mm:ss. Does anyone remember this thread?
Yes. ...
May 15, 2012 at 6:29 pm
Jeff Moden (5/15/2012)
dwain.c (5/14/2012)
Forgive me oh experts for I have sinned. I have not compared performance against other suggestions. 🙂
Since you used a recursive CTE for this task, that...
May 15, 2012 at 6:24 pm
Here's a solution that may work if you won't or can't use a CLR:
DECLARE @t TABLE (strcol VARCHAR(100))
INSERT INTO @t
SELECT 'here is some text'
UNION ALL SELECT ' and HERE is...
May 14, 2012 at 11:19 pm
Lynn Pettis (5/13/2012)
First of all, I really can't make much sense out of what you are doing. I can tell you you syntax is wrong.
I can't make sense of...
May 14, 2012 at 10:08 pm
Jeff Moden (5/12/2012)
MaverickMan (4/30/2012)
Performance is not the need for our problem so it will work with any of the solutions presented above.
BWAAA-HAAAA!!!! So! Did you pick the slowest...
May 14, 2012 at 8:06 pm
Jack Corbett (5/14/2012)
The only thing I"d quibble with is where you say "(i.e., the last) record" as ordering is not guaranteed in SQL Server so you aren't guaranteed...
May 14, 2012 at 6:18 pm
I saw an article that may help with this: http://www.sqlskills.com/BLOGS/BOBB/post/Using-the-OUTPUT-clause-results-and-INSERT-SELECT.aspx
Adapting the code there to your problem (alas, without being able to test in my SQL 2008 playground):
CREATE TABLE Stock (Stock...
May 14, 2012 at 2:03 am
Steve - Thanks for the vote of confidence to us dinosaurs.
May 14, 2012 at 1:29 am
Have you considered taking the two WHERE clauses from your two DELETEs and combining them with an OR instead of trying to use CASE?
May 14, 2012 at 12:57 am
Note that all of your title tags were incorrectly constructed. After fixing that, I came up with the following:
DECLARE @XML XML
SET @XML = CAST('<DocumentElement>
<QuestionList>
<QuestionId>Q1000</QuestionId>
<Title>Apple</Title>
<Sequence>3</Sequence>
<MergeSequence>1</MergeSequence>
</QuestionList>
<QuestionList>
<QuestionId>Q1028</QuestionId>
<Title>Banana</Title>
<Sequence>3</Sequence>
<MergeSequence>2</MergeSequence>...
May 13, 2012 at 10:42 pm
Viewing 15 posts - 3,601 through 3,615 (of 3,957 total)