Forum Replies Created

Viewing 15 posts - 2,941 through 2,955 (of 3,232 total)

  • RE: 3 tables, one query?

    The only way to make this work with one statement would be to use dynamic SQL; however, this does not mean, that from a maintenance perspective, that it would be...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: Help deleting rows in a table

    INSERT INTO t1 (CustID, CustType)

    SELECT t2.CustID,

     t2.CustType

    FROM t2

     LEFT JOIN t1

     ON t1.CustID = t2.CustID and t1.CustType = t2.CustType

    WHERE t1.CustID IS NULL and t1.CustType IS NULL

    DELETE t1

    FROM t1

     LEFT JOIN t2

     ON t1.CustID =...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: 3 tables, one query?

    All of the solutions suggested will work based off of what you've posted as your requirements.  Why do you think you need to have it all in one statement?  You...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: Help deleting rows in a table

    I had the tables in my where clause transposed. 

    DELETE table1 FROM table1 t1

       LEFT JOIN table2 t2

       ON t1.custid = t2.custid

    WHERE t2.custid IS NULL and t1.custtype = 'Employee'

    If table...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: 3 tables, one query?

    You've got a few options here, all of which will work.  First, you can create dynamic SQL, which should be your last resort.  Second, you can create separate SELECT statements, one...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: difference..between PK and UK

    They both ensure that no duplicate values can be entered into a column (or set of columns), but there are differences in how they should be used.  See UNIQUE Constraints...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: Help deleting rows in a table

    You need an outer join on table1 and table2 using custID.  Try this:

    DELETE table1 FROM table1 t1

       LEFT JOIN table2 t2

       ON t1.custid = t2.custid

    WHERE t1.custid IS NULL and t2.custtype...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: Stored Procedure OPENXML Deletes Help

    This thread has been posted in 2 places. 

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=21&messageid=271326&post=true

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: OpenXML Deletes

    I do not have XML experience with T-SQL, but from what I can tell, you should be able to join your XML doc and treat it like a table, correct? ...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: Registring Local SQL server (SQL 2000)

    I think the installation message regarding your OS is telling you all you need to know.  SQL Server will not install on your OS.  It appears that the OS version...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: Get File Names and Path

    Books On-Line (SQL Server Help files).  Yes, you will be able to use the sysfiles table in dynamic SQL.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: Get File Names and Path

    Look up sysfiles system table in BOL.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: Cross Tab Query

    select sCallDate as 'Date',

     SUM(Case sProject when 'A' then dHours else 0 end) as 'Project A',

     SUM(Case sProject when 'B' then dHours else 0 end) as 'Project B',

     SUM(Case sProject when 'C' then...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: Problems with long stored proc with transaction

    Are you getting errors in your SQL Server logs?  Have you run profiler/perfmon while this is happening?  I would guess that the process gets to a point to where it...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • RE: How to remove multiple spaces in a varchar?

    REPLACE(@wordlist,'  ',' ') will replace double spaces with single spaces.  You may need to do this in a loop and check for the condition where no double spaces exist as...

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

Viewing 15 posts - 2,941 through 2,955 (of 3,232 total)