Viewing 15 posts - 20,581 through 20,595 (of 49,552 total)
If I'm understanding you correctly (you want to either insert or update depending whether the exception is already there)
Use Merge.
Rough syntax:
MERGE
[ INTO ] <target_table> [...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 6, 2012 at 3:18 am
The distribution of answers is frankly terrifying.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 6, 2012 at 3:17 am
The usual trick is a unique filtered index.
CREATE UNIQUE INDEX <index name> ON <table name>(<column name>)
WHERE <Column name> IS NOT NULL
Uniqueness only enforced over the non-null portion of the table.
Has...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 6, 2012 at 3:03 am
Yes, the database corruption is almost certainly due to hardware problems, most likely the IO subsystem.
There's way too much noise in that checkDB output. Please run the following and post...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 6, 2012 at 2:55 am
The root of the problem is that you are not taking log backups.
Please read through this - Managing Transaction Logs[/url]
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 6, 2012 at 2:52 am
The buffer cache hit ration is another of those near-useless counters. If it's high, you may be fine or you may have a severe memory problem. If it's low, you...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 6, 2012 at 2:30 am
Ignore disk queue length. It's a meaningless counter, especially with a SAN.
What's your disk latencies? (avg sec/read, avg sec/write)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 5, 2012 at 6:32 pm
What wait types are you seeing on the slow queries?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 5, 2012 at 5:59 pm
Yes, it will have a major effect. I strongly suggest you do some basic reading on indexes.
Start with this series:
http://www.sqlservercentral.com/articles/Indexing/68439/
http://www.sqlservercentral.com/articles/Indexing/68563/
http://www.sqlservercentral.com/articles/Indexing/68636/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 5, 2012 at 5:58 pm
No, it has nothing to do with foreign keys.
Let me guess, the table is under 50 pages?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 5, 2012 at 5:56 pm
Developer edition can do online rebuilds, but they take even more space than offline rebuilds do.
Scripts, certainly.
http://sqlfool.com/2011/06/index-defrag-script-v4-1/
or
http://ola.hallengren.com/versions.html
p.s. I hope I misunderstood you and you are not using developer edition for...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 5, 2012 at 5:56 pm
You didn't read the article. Please do so. The easier you can make it for someone to help you, the more likely it is that someone will.
CTE or subquery means...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 5, 2012 at 10:37 am
Please post table definitions, sample data and desired output. Read this to see the best way to post this to get quick responses.
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 5, 2012 at 8:31 am
Note that those may well increase your compile time, not decrease it. They're used when non-optimal plans are generated (for whatever reason), they are not there to allow you to...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 5, 2012 at 4:35 am
No, it will not. SQL Server is smarter than that.
Adding the clustering key to the index if it is necessary is a sensible thing to. Otherwise, what happens when someone...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 4, 2012 at 12:37 pm
Viewing 15 posts - 20,581 through 20,595 (of 49,552 total)