Viewing 15 posts - 31 through 45 (of 95 total)
Your @Names variable is null which means joining this into your dynamic query will make the whole statement NULL.
You also do not have a space in this part @columnname +...
November 29, 2015 at 7:04 pm
From my understanding the percentage format will automatically add in a *100 to the data.
Check to see if you are doing this in your expression or code and if so...
October 29, 2015 at 9:50 pm
Hi,
You cant reference a column alias in the same select statement it was created.
You will either need to do Column1*10*column2 as Column6
or wrap it in a cte first
with cte as...
April 12, 2015 at 5:50 pm
Soemthing like this maybe ?
DECLARE @choice int;
SET @choice = 0;
if exists (select 1 from yourtable)
set @choice = 1;
October 13, 2014 at 10:11 pm
I think this is what you are after.
with cte as (
select
o.custid, od.orderid as IorderID, sum(amt * itemcnt) as tot,
ROW_NUMBER() over (PARTITION by o.custid order by sum(amt * itemcnt) desc) as...
September 9, 2014 at 4:27 pm
Why not use something thats already around ?
Ive used the scripts from Ola Hallengren with great success in the past.
June 3, 2014 at 10:06 pm
Something like this ?
select distinct
itemno as [Item],
count(*) over (partition by ITEMNO) as [Purchases],
sum(case when entrytype = 0 then qty else 0 end) over (partition by ITEMNO) as [QtyPurchased],
sum(case when...
June 3, 2014 at 9:41 pm
Potentially can just do a cross join like the below.
create table #test (PO int, DaysToTravel int, DaysInWarehouse int)
insert into #test VALUES
(1, 10, 20),
(2, 5, 30),
(3, 7, 40)
select b.PO, b.DaysToTravel, b.DaysInWarehouse,...
May 20, 2014 at 9:39 pm
Why dont you add the column(s) in the key lookup to your index as included columns ?
This will most likely still allow an index seek and remove the key lookup...
April 3, 2014 at 4:34 pm
Really not sure if this is what you are after. (No sample results so i cant be sure)
;with cte2 as
(
select
[Invoice],
[D_Type],
[Status],
left(datename(month, [RemediationDate]), 3) as Mo,
year([RemediationDate]) as Yr
From
#Remediation
),
cte3 as...
February 17, 2014 at 12:00 am
You have a typo
@Poll_I int
Im pretty sure this should be @Poll_ID
December 29, 2013 at 4:21 pm
Thanks - this is a lot nicer than what i had.
June 4, 2013 at 1:40 am
Are you trying to compare an actual date or just a time ?
Can you put together some sample data ?
April 17, 2013 at 12:28 am
There really isnt much information to go on here.
If you can post the ACTUAL execution plans and the definitions for both views that would be a start.
April 16, 2013 at 6:50 pm
Viewing 15 posts - 31 through 45 (of 95 total)