Forum Replies Created

Viewing 15 posts - 4,771 through 4,785 (of 6,036 total)

  • RE: Cannot use column aliases in "Group By" clause?

    It's clear example of hardcoded business logic.

    Wrong by definition.

    This is the core of your problem, not ANSI standad or its implementation in MS SQL.

    _____________
    Code for TallyGenerator

  • RE: Cannot use column aliases in "Group By" clause?

    Russians use to get stuck with this kind of questions after 2nd bottle of vodka.

    What you've got today?

    Yes, this is it, and...

    _____________
    Code for TallyGenerator

  • RE: SQL syntax

    > We were asked how to do this in MS SQL Server,

    What makes Edwin's suggession extremely "useful".

    > Until you are willing to post all your code as I did,...

    _____________
    Code for TallyGenerator

  • RE: HELP WITH A SIMPLE STORED PROCEDURE

    It's good to read manual time to time. At least when you are in trouble.

    See BOL:

    ORDER BY 1 means "order by 1st column in the query".

    ORDER BY 2 means "order...

    _____________
    Code for TallyGenerator

  • RE: Speeding up a huge delete

    During DELETE only LOG file is growing. So, this may lead to situation when DB run out of space.

    So, you need to shrink it just not to allow to grow.

    .mdf...

    _____________
    Code for TallyGenerator

  • RE: SQL syntax

    > No, I don't remind myself of my own kids.

    You should. Because (quote) "they look for things and don't see them when it is right in front of them."

    Does syntax...

    _____________
    Code for TallyGenerator

  • RE: Speeding up a huge delete

    And for SHRINKDATABASE specify you need to shrink LOG file only.

    Then you can run it not only off hours. It will methodically delete records by small portions and let everybody work...

    _____________
    Code for TallyGenerator

  • RE: Speeding up a huge delete

    Looks like you need to add into the loop 2 statements before WAITFOR:

    BACKUP LOG WITH TRUNCATE_ONLY

    DBCC SHRINKDATABASE

    Sounds terrible, but it seems to be the only exit from this dead end.

    It's...

    _____________
    Code for TallyGenerator

  • RE: SQL syntax

    WHERE?

    Select * From Table

    Where Date(timestamp_column) >= DateAdd(Day, 1, DateAdd(Month, -1, Convert(Char(10), GetDate(), 120)))

    Where is it "RIGHT HERE"?

    Don't yourself remind you of your kids ?

    _____________
    Code for TallyGenerator

  • RE: SQL syntax

    Sorry to disappoint you, but your test is not right.

    1st, Edwin's query was this:

    Select * From Table

    Where Date(timestamp_column) >= DateAdd(Day, 1, DateAdd(Month, -1,...

    _____________
    Code for TallyGenerator

  • RE: SQL syntax

    You requested query for records with date FROM month ago TO moth ago + 1 day. You've got it.

    Than you changed request - dates FROM month ago TO ... no...

    _____________
    Code for TallyGenerator

  • RE: SQL syntax

    I did respond.

    And respond was complete.

    What you have found missing in that response?

    _____________
    Code for TallyGenerator

  • RE: Embedded Objects in an image column

    If it's an image it's not a link by definition. Everything going into image_column is an image, not link. Even if that image is just displaying picture of a link.

    Easiest...

    _____________
    Code for TallyGenerator

  • RE: Embedded Objects in an image column

    Actually embedding photos  is what image datatype is about.

    If you don't want them to embed photos then just remove image column and replace it with nvarchar(255) one. They gonna store links...

    _____________
    Code for TallyGenerator

  • RE: Function with Cursor

    Yeah, you're bloody right. Terrible thing.

    Try this:

    Select Country

    FROM CarrierRates.dbo.International R

    WHERE R.Country_Cd = SUBSTRING(@ANI, 1, LEN(R.Country_CD))

    AND R.City_Cd = SUBSTRING(@ANI, LEN(R.Country_CD)+1, LEN(R.City_Cd))

    If you have computed column for...

    _____________
    Code for TallyGenerator

Viewing 15 posts - 4,771 through 4,785 (of 6,036 total)