Viewing 15 posts - 3,631 through 3,645 (of 7,614 total)
If you have FK relationships, you don't have to do the data changes yourself.
Script out the FKs, "DROP and CREATE", and change the "ON UPDATE CASCADE" to "ON...
January 4, 2018 at 3:50 pm
I don't know about detach at this point, but with some "fancy footwork" you can DROP a database only if it was OFFLINE. You have to rollback the DROP, of...
January 4, 2018 at 2:37 pm
Or perhaps multiply by 2.2046226218, or some shorter variant of that, if you need more accuracy. 2.2 is rather rough estimate.
December 29, 2017 at 8:18 am
Maybe easy, maybe not. You have to create a synonym for every remote object you reference. And keep them in sync if, for any reason, you have to rename an object.
December 27, 2017 at 10:20 am
That's going to be a royal pita.
Why not just stop using different names for dev and prod? It's easier to mess up the aliasing than it is to...
December 26, 2017 at 2:41 pm
From Books Online, under sys.dm_db_index_operational_stats:
December 26, 2017 at 9:11 am
Go by the values in the clustered index. For example, if the table is clustered on a datetime column, use that as the value for the UPDATE.
Here's a...
December 22, 2017 at 8:27 am
December 22, 2017 at 7:15 am
The key lookups should cost more than the sort for only 7 rows (I know the lookup is in both queries). You should consider adding DateRegistered to the NC lindex.
December 21, 2017 at 3:11 pm
Be sure to create a unique clustered key / primary clustered key on SiteKey in the #Sites tables. With only ~20+ rows it may not matter, but it can't hurt.
December 21, 2017 at 11:13 am
DayOfWeek 7 is ambiguous in SQL Server, since SQL allows the week to start on any day that you specify.
Instead, I'd strongly urge you to use known day...
December 21, 2017 at 9:51 am
If you can, TRUNCATE the table rather than DELETE all the rows, as trunc will be much less overhead (btw, in case you're wondering, a trunc can be rolled back...
December 19, 2017 at 2:29 pm
Sorry about the HOUR(), that's the one function I always forget doesn't exist. Per quarter for the current year, something like this:
select
DATEPART(quarter,...
December 19, 2017 at 12:51 pm
Not 100% sure what you need, but, for example, this gives sales for the latest quarter for >=7AM and <8AM:
select *
from TicketItem
where s_item...
December 19, 2017 at 11:19 am
Viewing 15 posts - 3,631 through 3,645 (of 7,614 total)