Viewing 15 posts - 7,396 through 7,410 (of 7,602 total)
Maybe, then you could also do this:
select
a.* -- to save time, should define all columns you want to return
from
dbo.Appointments a
...
June 1, 2012 at 1:04 pm
I think this will do it:
WHERE
DIAG1 NOT LIKE 'C[0-8][0-9]%' AND
DIAG1 NOT LIKE 'C9[0-7]%' AND
DIAG1 NOT LIKE 'D3[7-9]%'...
June 1, 2012 at 12:41 pm
I strongly suspect you will want to see more details on the last appointment than just the date:
SELECT
CustomerId, AppointmentDate, ...
FROM (
SELECT *,...
June 1, 2012 at 12:35 pm
but that does not mean that someone else didn't change something
As Lynn has stated, that can happen even without any change being made to anything.
SQL only provides ORDERing if you...
May 31, 2012 at 4:08 pm
Yes, your queries will be vastly faster if you cluster on add datetime rather than identity. Hopefully your queries are then typically like this:
SELECT
SUM(...) AS...
May 31, 2012 at 3:53 pm
An occassional highly unusual exception doesn't validate the horrible idea in general of identity as the default for a clus key.
May 31, 2012 at 2:30 pm
True, there could be special situations.
you could potentially have a very large and active table that is in a database mirrored over a slow wan connection.
If you're trying to mirror...
May 31, 2012 at 2:14 pm
Other than logging-type tables, where the clus key value is essentially irrelevant, I can't imagine any case where identity would be the proper clus key on business data.
Sure, for some...
May 31, 2012 at 2:05 pm
There are vastly better ways to stress that in general a table needs a clustered key than to have the damaging and false notion that it should be an identity...
May 31, 2012 at 1:57 pm
While I may agree, I have to play devils advocate, why not cluster on the identity column?
Because the overwhelming majority of queries will specify the datetime.
I wish I had a...
May 31, 2012 at 1:49 pm
As long as you do things in the proper sequence -- change AD first, then use the SQL tools, not the Windows tools, to change the account pwd -- you...
May 31, 2012 at 1:40 pm
*Cluster* the table on the add date/time (rather than on, say, an identity column, which may still be a good idea to have on this table, just don't cluster by...
May 31, 2012 at 1:18 pm
Create a logon trigger, and capture everything you can -- app_name, host_id, host_name (most people don't bother to fake this) and original_login (just in case).
You could of course then also...
May 31, 2012 at 1:15 pm
How about something like this?:
SELECT
/*@date1 = */ last_friday,
/*@date2 = */ DATEADD(DAY, -07, last_friday),
/*@date3 = */ DATEADD(DAY, -14, last_friday),
...
May 31, 2012 at 1:02 pm
Interesting. I used a start-up proc to set the flag, so it was almost immediately on.
May 31, 2012 at 9:34 am
Viewing 15 posts - 7,396 through 7,410 (of 7,602 total)