Forum Replies Created

Viewing 15 posts - 49,021 through 49,035 (of 49,571 total)

  • RE: Need to copy a block of records within same table

    It means that you have a primary key on the table, a constraint that forces all values in a column to be unique.

    Since you tried to insert duplicate values...

  • RE: Need to copy a block of records within same table

    Insert into Service (GroupNo,ServiceCode,ServiceName,SystemNo,Upload,ControlNo)

    SELECT 6,ServiceCode,ServiceName,SystemNo,Upload,ControlNo

    FROM Service

    WHERE GroupNo=1

    The select takes all the records in Service that have a GroupNo of 1 (Where...)

    The constant in the select clause (SELECT 6, ...) means...

  • RE: SQL Efficiency Help

    Why? Sum ignores nulls. It will add up non-null values. The isnull around the sum is just incase the entire column is null or there are no records. That's the...

  • RE: Nested values in a table

    Yes, and you have to join it as meny times as there are levels in the nesting.

    Just a warning. It's not going to run fast. I'd recomend that you...

  • RE: Nested values in a table

    I think this will work. I've only done it 3 levels deep, but the principle's there and you should be able to extend it to as many levels as you...

  • RE: Nested values in a table

    Hmmm, that's going to be one messy query.

    Let me think about this....

  • RE: SQL Efficiency Help

    Sum ignores nulls. If you sum a column that contains nulls, you'll get the total of the non-null values and a warning saying null values were eliminated due to aggregation.

    The...

  • RE: Nested values in a table

    Ok, a bit better.

    so...

    z  a

    x  z

    y  x

    if I ask x, I'll get a

    if I ask y, I'll also get a

    Is that right?

    Is there any limit on how deep...

  • RE: Nested values in a table

    How do you define 'latest'? Do you have a date or timestamp somewhere in there or some other way to order the records?

    If the table has

    y  a

    x  a

    x  y

    a  c

    y ...

  • RE: Blocking on a heavily updated table

    Can you post the table structure please, columns, constraints, current indexes. also if possible, the update statements that run.

    Thanks

  • RE: data types default values

    Why two columns? Tis a much better design to have a single column that stores the current datetime.

    Getdate retuns the current date and time to an accuracy of 3 ms....

  • RE: Security of the database

    Remove builtin\Administrators from the sysadmin role. Make sure that you have another admin account before you do that. Make sure that the sa login has a strong password.

    It won't stop him from...

  • RE: Splitting database into seperate files

    I wouldn't personally think more than about 10-20% from just splitting the files. Now if you're moving to faster disks as well, you'll get an increase from that as well.

    We're...

  • RE: Splitting database into seperate files

    It depends on whether the data required for the join is in memory or on disk. If both tables are in memory, then there will be no gain (because no...

  • RE: Splitting database into seperate files

    I forgot to mention, we've currently got three filegroups, clustered indexes in 1, nonclusters in the second and some of the tables text images in the third and we're looking...

Viewing 15 posts - 49,021 through 49,035 (of 49,571 total)