Viewing 15 posts - 16 through 30 (of 33 total)
Gail fixed your code, but I'll explain a little:
A CTE is really nothing more than a temporary view. Because of that, it acts just like a view when you interact...
October 24, 2014 at 7:59 am
Probably the most straightforward way to prevent divide-by-zero errors is to use a CASE statement. SQL Server SHOULD bypass any divide-by-zero evaluations if you tell it not to attempt to...
October 24, 2014 at 7:37 am
I'm a developer so I'm a little biased, but I'm not sure that "right-sizing" memory is the best approach. Memory is a relatively cheap way to increase performance for a...
October 24, 2014 at 7:11 am
I'd probably change my approach up a little bit.
SELECT Eq.EquipID, IE.Amount as EquipAmount
FROM Equipment Eq
INNER JOIN InvoiceEquipment IE
ON Eq.EquipID = IE.EquipID
WHERE IE.Type = 'A'
AND NOT EXISTS (
SELECT 1
FROM InvoiceEquipment
ON IE.EquipID...
October 23, 2014 at 11:56 am
I'm guessing your error rows destination is preceded by an OLE_DB destination pointing to the table?
What I've done in this kind of case is to do a two-stage insert. The...
October 23, 2014 at 10:00 am
It looks like Scott almost had what you wanted. You're wanting all records where there is a duplicate, which can be restated as "All records where a duplicate exists." So,...
October 23, 2014 at 9:10 am
One of the big changes that was made in SQL Server 2014 was that the cardinality estimator was significantly changed. This resulted in behavior changes, both good and bad.
Tom LaRock...
October 23, 2014 at 8:50 am
You can avoid the whole question of NULLs with NOT EXISTS. Also helps you to not abuse a LEFT JOIN.
September 23, 2014 at 6:46 am
ms-techie (3/4/2014)
With CTE1 AS
(
Select count(Column1) as Cnt_Column1_Tbl1 FROM TABLE1 with some...
March 4, 2014 at 10:10 am
You could do it either with inner joins or EXISTS clauses.
As this smells a bit like homework, implementation is left up to the reader.
March 4, 2014 at 10:02 am
You have a lot going on here, but I'll give this a try anyhow.
My first observation is that I'd probably make your subqueries into CTEs, if just for separation of...
February 28, 2014 at 7:37 am
I'd schedule a job that waits several seconds, then creates the new job you want using the T-SQL script for the job.
October 31, 2013 at 7:22 am
There are a couple of dynamics at work here:
A) Table order is never guaranteed unless you use an order by or some ordering/filtering mechanism like ROW_NUMBER() or such. So, the...
October 21, 2013 at 7:14 am
RTaylor2208 (9/5/2013)
I suspect its because the DB is 100GB in size. And they may only need some not all of the tables in the database.
The size is irrelevant. A...
September 6, 2013 at 7:23 am
Have you watched the I/O of the server while the queries are running? I know that, for example, we're limited to 600Mb/s for or developers, but the backups user can...
September 6, 2013 at 7:14 am
Viewing 15 posts - 16 through 30 (of 33 total)