Forum Replies Created

Viewing 15 posts - 49,621 through 49,635 (of 59,078 total)

  • RE: How to design an optional unique constraint

    Stephanie Giovannini (6/26/2008)


    I always remember that unique constraints allow nulls, but forget that they only allow one null (assuming the constraint is on just one column).

    I have a table in...

  • RE: What to do when your natural key is broken.

    Matt Miller (6/26/2008)


    Hmm... sounds to me that you have a much bigger issue than a design disagreement.

    A natural key that will end up with duplicates is no longer a...

  • RE: Executing Queries by Fetching them from a textptr

    Also be aware that neither of those will handle the TEXT datatype. What you might want to look into is the undocumented sp_execresultset...

    If you're using SQL Server 2005, lemme...

  • RE: Throttling database processes?

    The real problem is that you're using the same table for OLTP and Batch processing. Load the data into a separate table (staging table), process it, the transfer the...

  • RE: A question about selects.

    Jeff Moden (6/26/2008)


    Michael Earl (6/26/2008)


    You can use *= and =* for outer joins when putting joins in the WHERE clause. This is the old ANSI standard for join syntax....

  • RE: A question about selects.

    Michael Earl (6/26/2008)


    You can use *= and =* for outer joins when putting joins in the WHERE clause. This is the old ANSI standard for join syntax. Using...

  • RE: Compare 2 tables

    GSquared (6/26/2008)


    You can always build a set of left outer joins between the two tables. That'll give you which exact column was modified.

    Something like:

    select t1.Col1

    from dbo.Table1 t1

    left outer join...

  • RE: Inserting row with Procedure

    That's what the OP is trying to avoid, Gus... OP wants the temp table to size itself and it's columns like it would using a SELECT/INTO except the OP wants...

  • RE: How to get the list of dates between two dates usind sql query?

    schuppe (6/26/2008)


    create table testtable (startdate datetime, enddate datetime)

    insert into testtable values(getdate(), dateadd(day, 5, getdate()));

    with test (startdate, enddate) as

    (select startdate, enddate from testtable

    union all

    select dateadd(day, 1, test.startdate), test.enddate...

  • RE: How to get the list of dates between two dates usind sql query?

    Michael Earl (6/26/2008)


    Search for "Tally Table" on this site and you will find some articles by Jeff about how to do this. He's a pretty smart guy and his...

  • RE: Making duplicates unique

    GSquared (6/26/2008)


    For 2000, take a look at Jeff Moden's Running Totals article on this site. You should be able to use a variation on that. Bit more complex...

  • RE: Sample Data Required

    In that same vein...

    DROP TABLE JBMTest

    GO

    --===== Create and populate a 1,000,000 row test table.

    -- Column "RowNum" has a range of 1 to 1,000,000 unique numbers

    ...

  • RE: Grouping GROUP BY subtotals

    First, the warning about nulls is just that... a warning to let you know that some rows had nulls and they were ignored. You can suppress that message with...

  • RE: Need Some Queries

    Heh... rowcount can be wrong in sysindexes unless you run the correct DBCC command to update them... that's a hint... look it up in Books Online.

Viewing 15 posts - 49,621 through 49,635 (of 59,078 total)