Viewing 15 posts - 136 through 150 (of 414 total)
Alternatively:
update statement goes here
if @@ROWCOUNT = 0 -- i.e if no rows were updated
insert statement goes here
January 20, 2006 at 4:19 am
An alternative, which might be faster if you have a lot of data:
declare @test-2 table (str varchar(100))
insert @test-2 select 'ICE CREAM FOR THE INEPT STRING PARSER FUNCTION 55PT 767565'
insert @test-2...
January 20, 2006 at 4:01 am
Or you could use a derived table:
Select Area, (Area * Height) as 'Volume'
from
(
select Height, (Length * Width) AS 'Area' From Stuff
)
as AreaStuff
where Area > 25
January 20, 2006 at 2:46 am
No problem, David is great in guessing what people want....
For me personally, the best way to learn about T-SQL is to follow the...
January 20, 2006 at 2:29 am
My suggestion transforms
'<br><b>When input < 0, display error.</b>Else continue.<br>'
to
'When input 0, display error.Else continue.'
And
'<br><b>When input > 0, display error.</b>Else continue.<br>'
is actually transformed to
'When input > 0, display error.Else continue.'
But this...
January 19, 2006 at 7:06 am
OK, but I am still puzzled as to what the result of the query should be... How many columns are there in the result and what data should be in...
January 19, 2006 at 6:10 am
I am not sure precisely what you want. For the table above (with columns Col02, Ext01, Ext02, Ext60 and Col 110), could you describe (e.g. with a similar table display)...
January 19, 2006 at 5:54 am
<br><b>When input < 0, display error.</b>Else continue.<br>
is incorrect HTML (or at least incorrect XHTML). You should use
<br><b>When input < 0, display error.</b>Else continue.<br>
Rob has presented a simple and straightforward solution, which...
January 19, 2006 at 5:22 am
That's definitely simpler!
And congratulations - you are now a Grashopper
January 19, 2006 at 5:12 am
I don't remember if it's 10 or 20...
Instead of joining on a derived table (the one with alias M above), you might want...
January 19, 2006 at 4:13 am
Could you post sample data (preferably in a script form such that it can be directly inserted into query analyzer) along with your desired output? Then I am sure that someone...
January 19, 2006 at 2:04 am
My suggestion would be the following. If you have an index on (Year, Month), I think it is faster than David's suggestion.
SELECT F.[Year], F.[Month], SUM(F.ViewCount) AS Downloads
FROM FileViews F inner...
January 19, 2006 at 2:00 am
If I understand you correctly, I have the following suggestion:
declare @str varchar(8000)
declare @str2 varchar(8000)
select @str =
'<OL>
<LI>
<DIV align=center>Store 1151 has a USB only Dell <BR>The <U><EM><STRONG><FONT color=#ff6633>New KVM is PS2 only</FONT></STRONG></EM></U>...
January 19, 2006 at 1:33 am
Oh, I realise that you want up to 10 credit card numbers on one line. Here is a solution with 3 numbers:
declare @table table(Name varchar(10), CreditCardNo int)
insert @table select 'Arun',...
January 18, 2006 at 8:27 am
Viewing 15 posts - 136 through 150 (of 414 total)