Forum Replies Created

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

  • RE: Upgrade Script needed

    Of course, you could combine these 2 updates into one using a more complex case statement, but this should get you heading in the right direction.

    declare @t table (Recreate_flag bit,...

  • 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...

  • 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 =...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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? ...

  • 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...

  • 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.

  • RE: Get File Names and Path

    Look up sysfiles system table in BOL.

  • 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...

  • 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...

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