Viewing 15 posts - 4,846 through 4,860 (of 7,597 total)
DECLARE @database_name NVARCHAR(50)
SELECT @database_name=DB_NAME()
WHILE 1 = 1
BEGIN
IF EXISTS(
SELECT 1
FROM msdb.dbo.backupmediafamily
INNER JOIN msdb.dbo.backupset ON...
August 27, 2015 at 1:11 pm
No, you'd need to use a synonym for each object. But it's easy enough to generate the code to create the synonyms for all tables in the current db.
August 27, 2015 at 1:04 pm
Similar to the first option above; you may need to adjust for your specific values:
AND ((@JobStatus IN ('O', 'o') AND JobStatus = 1) OR
...
August 27, 2015 at 10:43 am
I'd try a combined query, force it to recompile so SQL can ignore the unmatchable condition:
SELECT JobStatus
FROM dbo.JCJM
WHERE
(@JobStatus IN ('O', 'o') AND JobStatus = 1) OR
...
August 27, 2015 at 10:37 am
I prefer just:
DECLARE @MyDate DATETIME;
SET @MyDate = '2/28/2009';
SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, @MyDate) - 11, -1);
August 27, 2015 at 10:30 am
The basic trigger rewrite is easy enough, but trying to return the value is and will be a very severe issue. Returning data directly from a trigger should never...
August 27, 2015 at 10:20 am
It sets the corresponding bits on, regardless of whether they were on before or not.
For example:
SELECT CAST(0 AS int) | 1 | 2 | 4
SELECT CAST(1 AS int) | 1...
August 26, 2015 at 12:49 pm
AND AppDetails.DateDetailDisposed >= Dateadd(Day, Datediff(Day, 0, Getdate()), 0) - 21
AND AppDetails.DateDetailDisposed < Dateadd(Day, Datediff(Day, 0, Getdate()), 0) - 20 INNER JOIN
August 26, 2015 at 12:44 pm
mitzyturbo (8/26/2015)
It doesn't make much sense for such a change in performance as the indexes are rebuilt and stats updated on a nightly basis.
After an index is rebuilt, you should...
August 26, 2015 at 11:19 am
I'd take a different approach. How about using synonyms to re-direct from the old schema name to the new one? Then you wouldn't have to directly change any...
August 26, 2015 at 11:14 am
Can't troubleshoot that query without more details on it.
One specific thing to check, though, is that you have limited SQL's use of RAM via the 'max memory' setting, and not...
August 26, 2015 at 9:16 am
It looks like it could be a good, and perhaps overlooked, area for investigation, but I don't fully understand exactly what is being listed/described by the query.
August 26, 2015 at 8:54 am
SQLPain (8/25/2015)
the current result set contains only 500 values, I don't think it would ever go higher than that. what would be the difference in the...
August 25, 2015 at 3:41 pm
Check the statistics on the replicated server, make sure they are current (or at least as current as the other servers).
August 25, 2015 at 3:09 pm
I think you can combine the two queries, possibly if will perform better, esp. if the joins are a lot of overhead. As to the joins, they seem fairly...
August 25, 2015 at 2:45 pm
Viewing 15 posts - 4,846 through 4,860 (of 7,597 total)