Viewing 15 posts - 8,416 through 8,430 (of 26,490 total)
Don't have time to compare them that I need but we are looking at two completely different query plans. Also, the troublesome query is a select and the other...
March 18, 2013 at 7:00 am
Can you also post the actual execution plan for the query from the server where it works well?
March 18, 2013 at 6:40 am
Have you checked the windows and sql server logs on the server itself?
March 18, 2013 at 5:44 am
I find that derived tables make the queries more difficult to read and understand. Using CTEs allows you to move the derived table to an easy to understand construct...
March 18, 2013 at 5:31 am
So, does the extra typing make it more complex? I think it makes the query more understandable.
March 17, 2013 at 7:28 pm
Sergiy (3/17/2013)
Lynn Pettis (3/17/2013)
Really, CTEs are complex? I find them to make writing queries easier as you don't have to write derived tables.
🙂
Let's compare:
;WITH MyData AS (
...
March 17, 2013 at 7:09 pm
Vedran Kesegic (3/17/2013)
March 17, 2013 at 6:41 pm
clintonG (3/17/2013)
kevaburg (3/17/2013)
March 17, 2013 at 12:12 pm
Welcome to SSC. First, you did describe your problem okay but we really could use more information to really help you. For myself, and others, it helps to...
March 17, 2013 at 10:46 am
It would help if you would provide the DDL (CREATE TABLE statement(s)) for the table(s) involved in the query, sample data (NOT real data, just sample data that mimics your...
March 16, 2013 at 5:45 pm
brettstahlman (3/16/2013)
Lynn Pettis (3/16/2013)
brettstahlman (3/16/2013)
opc.three (3/16/2013)
March 16, 2013 at 5:35 pm
pooya1072 (3/16/2013)
i craete a SP in my database . by this command :
USE [MyDatabase];
GO
CREATE PROCEDURE test
AS
SET NOCOUNT ON;
SELECT id, feed1, feed2
...
March 16, 2013 at 11:30 am
brettstahlman (3/16/2013)
opc.three (3/16/2013)
March 16, 2013 at 11:20 am
Perhaps something like this:
declare @ProductType varchar(???),
@SalesIncrease int;
set @ProductType = 'LEISURE';
set @SalesIncrease = 1000;
with ProductsToUpdate as (
select
Year,
Company,
Product,
ProductType,
LastYearsSales,
ForecastSales
ProductCnt = count(Product) over (partition by ProductType)
from
MyTable
where
ProductType...
March 16, 2013 at 11:11 am
karthik M (3/16/2013)
I just refreshed all my posts.
This is a very old post (asked on 2009) 🙂
How to identify whether a code fall under O(n) / O (n2) /...
March 16, 2013 at 10:43 am
Viewing 15 posts - 8,416 through 8,430 (of 26,490 total)