Viewing 15 posts - 7,411 through 7,425 (of 7,626 total)
@scott: By best practice you never store your unencryption mechanisms and your data in the same place. Admittedly, there are times when you may need to work with the data...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 4, 2012 at 5:06 pm
I suggest looking into SQL's existing EncryptByKey and DecryptByKey functions.
I disagree with the idea that encryption/decryption can be left to the app. Because you may want to work with...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 4, 2012 at 4:35 pm
Maybe I'm not getting this, but tableB does not get updated.
No, but tableB provides a lookup table to get the value with which to update the other table. ...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 4, 2012 at 3:25 pm
My best (educated) guess based on what you've posted so far is:
A filtered index on ISAPPLIEDFORSPECIFICDAYS = 1, including the daily columns.
That index may or may not help -- you'd...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 4, 2012 at 1:49 pm
CREATE NONCLUSTERED INDEX [IDX_ApplAcctNo] ON [dbo].[tableB]
(
[applAcctNo] ASC
)
Since tableB already has that index, I suggest changing its definition to also contain the acct_nbr and the bit flag. Then...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 4, 2012 at 11:46 am
So much for a UNIQUE Clustered Index and the performance that will offer.
The way around this problem is to determine what makes each row UNIQUE in your table while considering...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 4, 2012 at 9:06 am
The DBCC SHRINKDATABASE() will shrink the log file also, so you don't need to do it separately; thus, you can just comment out the "DBCC SHRINKFILE".
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 1, 2012 at 5:12 pm
You can specify a batchsize for a bulk load, and SQL then commits every time after that many rows are loaded (obviously you definitely want to specify a batchsize for...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 1, 2012 at 4:59 pm
As for the restore, it's very easy to create a script to have SQL restore the last backup of a db.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 1, 2012 at 4:48 pm
Maybe, then you could also do this:
select
a.* -- to save time, should define all columns you want to return
from
dbo.Appointments a
...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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]%'...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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 *,...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
May 31, 2012 at 2:30 pm
Viewing 15 posts - 7,411 through 7,425 (of 7,626 total)