Forum Replies Created

Viewing 15 posts - 16 through 30 (of 50 total)

  • RE: Long, complicated problem (SQL Svr 7)

    "Is there any reason you need to check each company_id separately?"

    Actually, I will be checking their company_name instead, as there's no direct link at the company level between the CRM...

  • RE: Long, complicated problem (SQL Svr 7)

    The SPROC usp_Check_CRM_WEB_errors will be a set based solution, like this?

    CREATE PROC usp_Check_CRM_WEB_errors

    @comp_id

    AS

    SELECT crm.row_id

    FROM #CRM_table crm

    LEFT OUTER JOIN #WEB_table web

    ON crm.row_id = web.row_id

    WHERE crm.company_id <> web.company_id

    OR crm.prod_type <> web.prod_typ

    ...

  • RE: Long, complicated problem (SQL Svr 7)

    Yes! Yes! We're getting closer... Let me first try to make up some sample data:

    if object_ID('tempdb..#CRM_table') is not null drop table #CRM_table

    CREATE TABLE #CRM_table (company_id INT, row_id INT, prod_type...

  • RE: Long, complicated problem (SQL Svr 7)

    Thursday, Aug. 14th, I was in the middle of rewriting the query as Calvin suggested when suddenly, VOOooooommmmm... ... the power went out! Now I moved to NYC in...

  • RE: Long, complicated problem (SQL Svr 7)

    NPeeters is mostly right. The web table has 1 row per product, the crm table also has 1 row per product HOWEVER... there are many different categories of products....

  • RE: Long, complicated problem (SQL Svr 7)

    OK, the problem is performance... the script takes more than 7 minutes to run in my testing environment! I obviously can't have that run as a job on the...

  • RE: Long, complicated problem (SQL Svr 7)

     
    

    /* This script search for all companies that have a new product pending Data Quality check/approval.
    ** Inside those companies, we want to compare each and...
  • RE: Using IF in a SELECT statement?

    Nope, can't put that in a SELECT statement.

    This is what I'm doing:

    SELECT account_id, bill_contact, bill_address

    FROM account

    This is what I want:

    SELECT account_id, bill_contact, bill_address,

    (IF bill_method = 'CC' THEN (SELECT CC_Number,...

  • RE: datatypes

    BTW, why are you using text data type for an "id" column? I think as a rule, you should shy away from using text data type in most columns!...

  • RE: MCDBA tests

    check out http://www.cramsession.com/

    also check out an earlier thread on this forum ... "Need helpful advice"

  • RE: Is Steve Jones Really Steve Jones?

    😀 hahaha... that guy is probably better known as the cool guy in "Mummy" and "Mummy Returns" (First movie far better than 2nd one, though the 2nd one shows a...

  • RE: Comparing specific rows in 2 tables

    OK, I'm finally done w/ it. The previous solution using WHERE t1.col1 <> t2.col1 OR t1.col2 <> t2.col2... is not good. In that SELECT statement, I'll be listing...

  • RE: Data converted to Excel file

    I think you can still use DTS, here's how:

    open DTS wizard, choose export data,

    pick source (possible problem here w/ login & permission)

    pick destination (Excel and save to user's network folder?)

    pick...

  • RE: AVG # of cases created per DAY

    Thanks David and SJTerrill!

    Yes, that implicit/explicit aggregate is quite confusing. I did some similar thing yesterday as I said in my question: "SELECT AVG(NumberOfCases) FROM **Something** GROUP BY MonthName,...

  • RE: How to set Proc Arg to default to today?

    According to BOL: "The CREATE PROCEDURE statement cannot be combined with other Transact-SQL statements in a single batch."

    So I guess you can't combine GETDATE() with CREATE PROC. May be...

Viewing 15 posts - 16 through 30 (of 50 total)