Forum Replies Created

Viewing 15 posts - 961 through 975 (of 1,217 total)

  • RE: Conditional Query

    Hi,

    since COUNT(column_name) counts only values that are not NULL, and the CASE statement stops executing as soon as it hits TRUE, you could rephrase the query along these lines (I...

  • RE: SQL2K and Kerio Personal Firewall - access violation??

    I have Kerio, but not on the same PC with SQL Server, so I don't know what settings are necessary to avoid this problem, but it should be possible. If...

  • RE: Nested Sql Query

    Hmmm... I looked once more at your original query, and I think - if I understand correctly what you want to achieve - there are several things that would profit from a...

  • RE: Nested Sql Query

    If you want to find records that have no connection to any single of the other tables, you have to use AND NOT EXISTS (instead of OR). Your query above...

  • RE: Calling stored procedure from another stored procedure

    Well... to be even more precise, what Remi wrote is a select from table-valued function. What I wrote before was meant as a call of scalar function

  • RE: how to rewrite this qurey

    I don't understand that part about from/to dates much, but the statement with COUNT should probably be :

    case count(DISTINCT aview_posting_location.posting_location_id)

    However, I'm suspicious of the (select site_name ...) inside the same CASE,...

  • RE: Calling stored procedure from another stored procedure

    If you want to use it this way (inside a SELECT statement), you have to create a UDF (user defined function), not a procedure. However, functions have some limitations, so...

  • RE: Diff between SET and SELECT

    dougjjj,

    it may depend on some setting, but on my server what you say is true only if the SELECT statement does not return any row. If it does, and the column contains...

  • RE: Conditional Query

    It is as noeld said... You can use the inner part of the query (derived table) to see better what happens and how the counts are evaluated:

    SELECT tp.TableParentID, count(*) as total,...

  • RE: Conditional Query

    Hi, this is just summing up what Carl and Sergiy presented and it works correctly when tested on a sample data (I used the values from Ray's post). You didn't mention status of...

  • RE: Query Help

    Hello,

    I'm back from vacation... and it looks that there still is one question pending. OK... I'd strongly suggest to use both startDate and endDate. This should allow you to use...

  • RE: Query Help

    Vacation begins in the afternoon, so I can make one more post 🙂 Well, it seems that I understood correctly, at least on this small sample my query returns required results.

    create...

  • RE: Query Help

    I didn't create your tables, so this is absolutely untested... but I think something similar should work, if I correctly understood your question and description of data. If there are...

  • RE: Speeding up deletes on a large table

    Another possibility:

    You can create a job to delete some 100.000 rows and schedule it to run every few minutes (depending on how long it takes to complete). I recently deleted...

  • RE: Query Help - Mulitple inserts

    Well, if you have 256 separate values that have to be inserted always (is that so? For each Org_ID you insert 256 rows into the table with always the same...

Viewing 15 posts - 961 through 975 (of 1,217 total)