Forum Replies Created

Viewing 15 posts - 136 through 150 (of 414 total)

  • RE: Stored Proc help - check for existing record and update if exists else insert new

    Alternatively:

    update statement goes here

    if @@ROWCOUNT = 0  -- i.e if no rows were updated

       insert statement goes here

  • RE: String Parse

    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...

  • RE: Returning Complicated Computed Column from a SP

    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

  • RE: strip HTML tages

    Thanks, I will give it a try...

  • RE: T-SQL HELP

    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...

  • RE: strip HTML tages

    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...

  • RE: T-SQL HELP

    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...

  • RE: T-SQL HELP

    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)...

  • RE: strip HTML tages

    <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 &lt; 0, display error.</b>Else continue.<br>

     

    Rob has presented a simple and straightforward solution, which...

  • RE: The Last Three Months (Year and Month Only)

    That's definitely simpler!

    And congratulations - you are now a Grashopper

  • RE: The Last Three Months (Year and Month Only)

    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...

  • RE: Help Needed

    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...

  • RE: The Last Three Months (Year and Month Only)

    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...

  • RE: strip HTML tages

    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>...

  • RE: Result needed in a specific format

    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',...

Viewing 15 posts - 136 through 150 (of 414 total)