Viewing 15 posts - 391 through 405 (of 1,193 total)
It's because of the return type of CASE.
A CASE expression's return data type will be the data type with the highest precedence of all the possible result expressions. See https://msdn.microsoft.com/en-us/library/ms181765.aspx#Anchor_2
Some...
August 30, 2016 at 12:01 pm
Most likely in the first environment the conditions that result in the execution of the branch with the ROLLBACK are not being met, while in the second environment those conditions...
August 26, 2016 at 4:06 pm
ZZartin (8/25/2016)
Ed Wagner (8/25/2016)
Lynn Pettis (8/25/2016)
Got to the following from a LinkedIn email. Not sure about a few of the answers.https://intellipaat.com/interview-question/sql-interview-questions/
I didn't make it the whole way through, but...
August 25, 2016 at 1:22 pm
The documentation is incorrect about that for sys.types.
Pull max_length from sys.columns instead, and it should correctly show -1.
Cheers!
August 25, 2016 at 10:20 am
UNIQUEIDENTIFIER only permits hexadecimal digits, and your strings contain many non-hexadecimal characters.
Exactly what is the goal of turning strings into UNIQUEIDENTIFIERS like this?
Cheers!
August 25, 2016 at 9:54 am
Another alternative is to construct a dynamic UNION ALL query by SELECTing from sys.databases.
Just a quick example of how that might look if my goal is to see all tables...
August 25, 2016 at 9:25 am
drew.allen (8/22/2016)
Jacob Wilkins (8/22/2016)
drew.allen (8/22/2016)
COUNT(CASE...
August 22, 2016 at 3:33 pm
drew.allen (8/22/2016)
COUNT(CASE WHEN status='Discharge' THEN...
August 22, 2016 at 1:46 pm
A few things:
1) You said this was per avatarid/episode combination, so you would need to group by both columns, not just avatarid.
2) To filter based on aggregates, you should use...
August 22, 2016 at 12:54 pm
drew.allen (8/22/2016)
Jacob Wilkins (8/22/2016)
Something like this:
[column] LIKE '['+@a+'-'+@b+']%'
Cheers!
This will only work if you pass in single characters as your parameters. Given that you've defined your parameters as VARCHAR(50), it...
August 22, 2016 at 12:17 pm
To follow up on Luis' fine answer, the reason you're seeing those results is that you're not actually using the parameters you're passing.
When you do this:
[column] LIKE '[@a-b]%'
you're saying to...
August 22, 2016 at 11:30 am
The first point to make is that you should never assume the output of a query will be ordered any particular way unless you use an ORDER BY clause (I'm...
July 27, 2016 at 12:31 pm
There's a table of dates (presumably), dbo.date.
The first SET command sets the @EndDate variable to be the most recent date from the dbo.date table that is earlier than the current...
June 15, 2016 at 2:51 pm
The shrink will attempt to reclaim space starting at the end of the file, but will not shrink past the part of the log that is active.
Most likely the active...
June 15, 2016 at 12:30 pm
ScottPletcher (6/14/2016)
In autocommit mode, when can an UPDATE statement partially complete, some UPDATEs made, some not, where SQL does not roll it back?
Edit:...
June 14, 2016 at 2:39 pm
Viewing 15 posts - 391 through 405 (of 1,193 total)