Viewing 15 posts - 6,871 through 6,885 (of 7,597 total)
You can use CASE w/i a GROUP BY.
You can also use CASE w/i a SUM to control which values get aggregated. For example:
SELECT
a, b,
...
January 24, 2013 at 9:45 am
HowardW (1/24/2013)
SQL* (1/23/2013)
While reading about Computed column if found that if we mentioned PERSISTED Key word while creating/altering table then we can create index. But i'm able to create...
January 24, 2013 at 9:42 am
IF and only if ABC.COLUMN2 is a (very) large column, and ABC.COLUMN1 is used by itself a lot, it might be worthwhile to keep both indexes.
You should also review sys.dm_db_index_usage_stats...
January 24, 2013 at 9:33 am
You need to get rid of the massive GROUP BY; you should be able to do the SUM() in a subquery rather than the main query, but I can't be...
January 24, 2013 at 9:26 am
AFAIK there's no any accurate way to do that.
I guess IF every caller used a different login or sql user, you could tell from that, but overall I think that's...
January 24, 2013 at 9:13 am
First, I assume you've all met all the oodles of restrictions for an indexed view; you might want to verify that using Books Online "CREATE INDEX", "Remarks", "Indexed Views" as...
January 24, 2013 at 9:09 am
declare @search_pattern_should_be varchar(100)
set @search_pattern_should_be = '%[[][[][%] SQL Server [%]]]%'
--example
select case when @string like '%[[][[][%] SQL Server [%]]]%'
then'Matched' else 'No...
January 24, 2013 at 8:51 am
I think EXISTS would be the clearest indication that you just want to know if a matching row exists, not retrieve data from that row. For example:
SELECT
...
January 24, 2013 at 8:39 am
You should also consider specifying "SORT_IN_TEMPDB = ON" on the creation. That usually saves a little space in the db, and, perhaps more importantly, often makes the final table...
January 23, 2013 at 4:43 pm
DBA_Dom (1/23/2013)
Or what...
January 23, 2013 at 3:41 pm
Perry Whittle (1/23/2013)
and all that's easier than a quick check in the dbo.sysjobhistory table??
Yes: which specific entry for "Job A" does one check in sysjobhistory?
The last one? What if...
January 23, 2013 at 11:25 am
Btw, I suggest using the clear datepart name, not the obscure abbreviations -- it can help you/others later, and avoid having to use Books Online just to lookup the &#^)@...
January 23, 2013 at 10:52 am
That's trickier than it sounds, because of the way SQL Server updates the sysjob* tables, and because you don't want to have to hardcode job schedules into the code.
Instead of...
January 23, 2013 at 10:48 am
Don't know full details, but the usual outline for such queries is shown below.
SELECT
DATEADD(MONTH, DATEDIFF(MONTH, 0, tp.trc_startdate), 0) AS start_month,
SUM(tp.??) AS active_units
FROM...
January 23, 2013 at 10:36 am
I think what's arrogant is for a developer to assume that they have the professional skills of another a DA/DBA job when they've never done. Not sure why everyone...
January 23, 2013 at 8:26 am
Viewing 15 posts - 6,871 through 6,885 (of 7,597 total)