Viewing 15 posts - 1,216 through 1,230 (of 1,400 total)
I would start by finding all of the objects that reference the lookup table.
SELECT
SchemaName = OBJECT_SCHEMA_NAME(sm.object_id)
, ObjectName = OBJECT_NAME(sm.object_id)
FROM sys.sql_modules...
January 19, 2017 at 10:56 am
All the outputs of your case statement need to have the same (or implicitly convertable) data type.
Also, your case statement needs to be terminated with and end
January 18, 2017 at 11:20 am
January 16, 2017 at 3:14 am
January 16, 2017 at 3:11 am
I have a set of relatively big tables with very high reads and writes occurring...
January 16, 2017 at 2:51 am
DECLARE @String VARCHAR(50) = '#BAVDB#(RowCount=3204)';
-- As a single statement
SELECT NumVal = SUBSTRING(@String, CHARINDEX('=', @String) +1, CHARINDEX(')', @String, CHARINDEX('=', @String) +1) - CHARINDEX('=', @String) -1);
--...
January 13, 2017 at 3:44 am
January 13, 2017 at 3:31 am
You can try this
select TOP 1 count(*) as [number of occurences]
from (
select case
when answer_count between 0 and 5 then '...
January 13, 2017 at 3:26 am
Formatted SQL code that is wider than the display box does not wrap. There are scroll bars, but they only seem to work if you highlight text and keep going....
January 12, 2017 at 10:55 pm
I am really not liking the new interface.
There is waaaay too much white space. Makes everything look clunky.
January 12, 2017 at 5:15 am
WITH cteSports AS (
SELECT * ,sn = ROW_NUMBER() OVER (PARTITION BY name ORDER BY sport)
FROM #example
)
SELECT
cte.name
, cte.city
, cte.entryDate
, sport1 = MAX(CASE WHEN cte.sn =...
January 6, 2017 at 10:30 pm
When SQL processes a batch of records, it's an all or nothing process. If one of them has an error, all are aborted.
The only way to do skip a...
January 6, 2017 at 10:17 pm
Here are 3 different approaches that will acheive the same results
-- Using cte with ROW_NUMBER
WITH cte AS (
SELECT CustID, PrintedDate, rn = ROW_NUMBER() OVER (PARTITION BY CustID ORDER...
January 5, 2017 at 11:04 pm
Since your query does not have an ORDER BY clause, you are not guaranteed of any specific order.
Perhaps adding the following to the end of your query will help
ORDER BY...
January 5, 2017 at 10:51 pm
Viewing 15 posts - 1,216 through 1,230 (of 1,400 total)