Forum Replies Created

Viewing 15 posts - 1,681 through 1,695 (of 2,894 total)

  • RE: paramatize case statement?

    Why not just use LEFT JOIN?

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: If proc1 calls procB, can proc1 complete without waiting for procB?

    I agree that Service Broker would allow you to call procs asynchronously from within a proc. However, personally, if I would have the same needs, I would do it from...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: decimal to char

    google CAST or CONVERT

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: decimal to char

    use CAST or CONVERT function

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: CASE Statement problem

    SUM(CASE WHEN Status = 'RG' THEN 1 ELSE 0 END) AS CountRGStatus

    SUM(CASE WHEN Status = 'GS' THEN 1 ELSE 0 END) AS CountGSStatus

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Can you have a non-aggregate field?

    Check it here:

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: SQL to get all Days in the month in Group by even with Zero values

    As I don't have a crystal ball or magic mirror, I cannot see what you are doing without you posting complete query and tables DDL. It doesn't matter how good...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: SQL to get all Days in the month in Group by even with Zero values

    kotharibij (4/26/2012)


    Thank you Eugene.

    Both my SQL and yours (very interesting SQL), gives the same result.

    Day RegTotal

    116

    4121

    532

    636

    737

    836

    933

    1046

    1145

    I thought of a calendar table but...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Stored procedure sorting - possible?

    Which input parameter you want to use to define the order? Which column should it apply to?

    You can do something like:

    ORDER BY (CASE WHEN SomeColumn = @HigherPriorityValue THEN 1...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: paramatize case statement?

    Without knowing what your tables are and what your full query is, the maximum what I can come up with:

    SELECT t.ApprovalID

    ,u.UserName ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Quering with "google-style" operators

    Then tell your customer he cannot have the "google-style" search as their IT prohibits it.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: split string separated by special character .

    select replace(left(val, charindex('^',val)),'^','') as LeftPart

    ,replace(substring(val, charindex('^',val), len(val)),'^','') as RightPart

    from...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Quering with "google-style" operators

    ...

    Unfortunately, Full Text Search is not an option - for some weird reason, it's not allowed in our corporate servers. Neither dynamic sql.

    ...

    The closest to "google-style" search in SQL is...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: SQL to get all Days in the month in Group by even with Zero values

    The best option is to create and use CalendarTable, but you can do it by:

    select convert(integer,DATENAME(day,m.MonthDay)) as Day, count(*) as RegTotal

    from (SELECT DATEADD(DAY,ROW_NUMBER() OVER (ORDER BY (SELECT NULL))-1,'20120401') as MonthDay

    ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Replacement for Cursors

    vinu512 (4/26/2012)


    Thanks Eugene.

    As simple it may be....but that was what I was looking for. 😎

    The key in using CURSORS (or loops, which are no much difference to cursors), as in...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 1,681 through 1,695 (of 2,894 total)