Viewing 15 posts - 4,291 through 4,305 (of 7,597 total)
You can backup the dbs using the commands below from within SSMS or other appropriate SQL utility. Since someone has gone to the trouble to cluster the SQL instance,...
May 3, 2016 at 10:09 am
Using HAVING eliminates a pass of the table and makes it easier to specify different conditions.
SELECT mt.*
FROM@myTable mt
INNER JOIN (
SELECT ColumnA
FROM @myTable
...
May 2, 2016 at 10:12 am
--pull first four digits in a row that start with 2, should be year.
SELECT SUBSTRING(@@VERSION, PATINDEX('%2[0-9][0-9][0-9]%', @@VERSION), 4)
May 2, 2016 at 10:05 am
As always with triggers, the biggest issue is to make the sure the triggers are coded properly, i.e. they deal with sets and not a row at a time, and...
May 2, 2016 at 10:02 am
First, look into implementing snapshot isolation (SI) for the underlying db(s). If nothing else, if will reduce contention issues while you tune the indexes. Be sure to adjust...
May 2, 2016 at 9:45 am
If "MyOtherTable" has an index on O.ID, add "IsPurged" to the key of that index.
May 2, 2016 at 9:35 am
I can't imagine any problem with a column named "number", since number is not a reserved word in SQL Server anyway.
I must admit, I don't generally worry too much about...
April 28, 2016 at 1:19 pm
It sounds like:
at least one nvarchar is working its way into some concatenation or other string operation, forcing the string to become nvarchar, and thus a max of 4000 bytes.
or...
April 28, 2016 at 10:33 am
IF EXISTS(SELECT 1 FROM dbo.ShiftScheduler WHERE ShiftType=2 AND Emp_Code='2414')
SELECT FromDate,enddate,Shift,ShiftType
FROM dbo.ShiftScheduler
WHERE ShiftType = 2 AND EndDate...
April 26, 2016 at 10:40 am
Try code something like below.
Btw, the GroupAssignment table does not need an identity column. The unique clustering key should be either ( GroupID, UserID ) or (...
April 25, 2016 at 4:17 pm
Fwiw, I prefer the a different way to check the current ansi / connection settings, using:
@@OPTIONS
I actually use a table of config values so the code is more readable, but...
April 22, 2016 at 9:36 am
You can use CROSS APPLY to assign an alias name to value(s). You can then use that alias in subsequent code, even in another CA. That is, alias...
April 22, 2016 at 9:19 am
If the table is clustered first on that datetime, the purge is easy and it should have very minimal effect on current queries.
If it's clustered differently, you have a more...
April 21, 2016 at 10:55 am
You probably want to verify that the dates are actually backwards before swapping them:
update tableA
set StartDate = EndDate,
...
April 20, 2016 at 10:45 am
Can you give any example of where converting a literal value to appropriate non-unicode literal could ever cause SQL a performance issue?
Or for dates. Our rule is you convert...
April 18, 2016 at 12:57 pm
Viewing 15 posts - 4,291 through 4,305 (of 7,597 total)