Forum Replies Created

Viewing 15 posts - 496 through 510 (of 1,217 total)

  • RE: Removing the Sum & group by

    I have verified the code now on a few examples.

    The code I posted originally only works correctly if there is one single row in table @times.

    The newer code -...

  • RE: Removing the Sum & group by

    Dave,

    I'm pretty sure I got it in my code.. it isn't lack of parentheses, the original code is all wrong. Don't read the original code, read the description... as I...

  • RE: Removing the Sum & group by

    Actually, one more thing - in case you need to display all rows:

    LEFT JOIN @times t ON t.totime >= s.fromtime AND t.fromtime < s.totime

    will do the trick.

  • RE: Removing the Sum & group by

    The result is incorrect because both join conditions and CASE are incorrect. This could work... Sorry, but I don't have time enough to think about better solution so I just corrected...

  • RE: Views referencing views (problem)

    No I haven't seen that... could you post the view definitions? I don't think we can look for a solution if we have no idea what the views do.

  • RE: Group Data

    Hi oren,

    FYI, Ten Centuries is a "title" (depends basically on number of posts - e.g. it says "Newbie" at your posts, because you only posted a few times), user name can...

  • RE: Show only First Cccurrence

    It shouldn't be that bad... Try this:

    /*test data*/

    create table #alert (Alert_id int identity, response_code varchar(10), [name] varchar(50), create_date datetime, acknowledged bit)

    INSERT INTO #alert (response_code, [name], create_date, acknowledged) VALUES ('RIR','Cameron Co.','20050805',0)

    INSERT...

  • RE: way over my head

    I absolutely agree with that... it is the same as if I would start to design a commercial application in VB based on my knowledge of Basic from ZX-81 and Atari. I can understand great...

  • RE: way over my head

    Hello,

    i think it would really help if you can post the table DDL (CREATE TABLE .... ) for at least one table as an example.. with a few rows of...

  • RE: raiseerror and transactions

    Depends on error severity. Some errors automatically rollback a transaction, some don't. If you want to be sure, you have to use RAISERROR, or IF condition ROLLBACK TRAN.

    I only know the...

  • RE: Number format

    Yes, you have to convert the number to character data type.

    Depending on the type of output you may find it useful to add LTRIM to the conversion suggested by Jeff, to...

  • RE: case with join

    Yes, you can use variables and dynamic SQL... but in this case I would say "unfortunately you can". If you need to resort to such approach, something is wrong with...

  • RE: data load from on table to another

    Hi Srinidhi,

    you are already receiving responses in the original topic where you mentioned the same question.

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=326295&p=2

    And I agree with Gila that there is little use trying to rewrite the...

  • RE: if condition inside selects?!!

    I'm not sure I understand the question correctly...

    Why would you want to do this : "if @var3 is NULL, keep the column value NULL, else put @var3 in it"?...

  • RE: Dynamic SQL. How to use it for all databases

    Hello,

    there is an undocumented procedure sp_MSforeachdb which can be used to perform a task on all databases. I have never needed that, so I can't tell for sure whether it can...

Viewing 15 posts - 496 through 510 (of 1,217 total)