Viewing 15 posts - 91 through 105 (of 246 total)
select
title,
sum(convert(int,flag))
from (
select * from @ZL_Calculation1
)p
unpivot
(
Flag for Title IN (a_flag,b_flag,c_flag,d_flag,e_flag)
) unpvt
group by Title
March 23, 2012 at 6:06 am
i prefer tabs to spaces.
main reason is probably because i can highlight multiple rows and tab them across where as if i did that with the spacebar it would delete...
March 20, 2012 at 10:22 am
i haven't had time to test it but it sounds right. as you say, it rounds it to the nearest minute. the data we hold doesn't usually come in with...
March 9, 2012 at 6:14 am
doesn't just converting it to an int work?
select * from tableName where (convert(int,colname) & 32 = 32)
March 9, 2012 at 5:48 am
select * from tableName where (colname & 32 = 32)
March 9, 2012 at 4:56 am
well i couldn't work out why i couldn't insert using the Partitioned View.
so i took the code from the CheckConstraint, and ran a straight forward SELECT statement
SELECT * FROM Table2008...
March 6, 2012 at 6:33 am
select
sum(1) as Total,
sum(case igroup when 1 then 1 end) as Group1,
sum(case igroup when 2 then 1 end) as Group2,
sum(case igroup when 3 then 1 end) as Group3,
sum(case igroup when 4...
March 6, 2012 at 4:23 am
resolved the problem. for some reason, when i had:
([ConfirmDate]>='2008-01-01 00:00:00' AND [ConfirmDate]<='2008-12-31 23:59:59')
it was allowing all dates through, including from the year 2009.
if i changed it to
([ConfirmDate]>='2008-01-01 00:00:00' AND [ConfirmDate]<='2008-12-31...
March 6, 2012 at 2:58 am
[UPDATED: New CREATE TABLE code]
i've been playing around abit more with Partitioned Views but have come across a problem.
here are the 3 tables that i have created as a test:
CREATE...
March 5, 2012 at 3:09 am
Jeff Moden (2/28/2012)
davidandrews13 (2/28/2012)
The 7th table contains data from the year 2011 onwards, so currently i dont want to put a constraint on it.
You must include the constraint on the...
February 28, 2012 at 7:14 am
thanks Jeff.
i've used this link as my reference:
http://msdn.microsoft.com/en-us/library/aa933141(v=sql.80).aspx
so i've set a CheckConstraint on 6 of the 7 tables that are mentioned in my View:
table2005
table2006
table2007
table2008
table2009
table2010
([ChangedDate]>='2008-01-01 00:00:00' AND [ChangedDate]<='2008-12-31 23:59:59')
obviously, the year...
February 28, 2012 at 4:32 am
Jeff Moden (2/25/2012)
gary.morey (2/24/2012)
February 27, 2012 at 8:28 am
something like this?
here's an article on the tally table
http://www.sqlservercentral.com/articles/Tally+Table/70735/
declare @testitem TABLE (
itm_item varchar(43) NOT NULL,
itm_desc varchar(100) NOT NULL,
wsd_quantity int NOT NULL)
INSERT INTO @testitem
SELECT 'CHCWPSU10DMX','Chroma-Q Color Web Power Supply Unit For...
February 6, 2012 at 5:33 am
Steve Jones - SSC Editor (2/2/2012)
davidandrews13 (2/2/2012)
February 2, 2012 at 9:56 am
Gary Varga (2/2/2012)
It was when I looked at the side-by-side stored procedures example that it became clear. Literally!!!?
isn't that just down to formatting though? the fact that the article has...
February 2, 2012 at 9:34 am
Viewing 15 posts - 91 through 105 (of 246 total)