Forum Replies Created

Viewing 15 posts - 5,101 through 5,115 (of 7,505 total)

  • RE: Consolidate data files.

    For the non catalog files you can use:

    DBCC SHRINKFILE ( file_name , EMPTYFILE )

    and later on

    alter database xyz REMOVE FILE logical_file_name

    Read BOL for more...

  • RE: SQL 2005 Paging File Available Memory

    Oops, I missed the reconfigure statement.

    That's why not all config options show up.

    exec sp_configure 'show advanced options' , 1

    reconfigure

    exec sp_configure -- information (extended info activated please)

    Can you post again...

  • RE: best way to delete two million rows

    well ... a function (datediff) can be avoided just by adding

    one variable, calculating that and then have a straight comparisson

    where clause.

    This way chances of index usage will be...

  • RE: Dropping and creating new columns

    Maybe.

    If you add columns not null with an actual default value, rows will be rewritten, so in that case, yes , then the old columns will be gone.

    Otherwise no because...

  • RE: Restore a databse when in Use

    if you just want to kick everybody out user alter database

    alter database xyz set single_user with rollback immediate;

    restore database xyz

    ...

    keep in mind NOT to place a "go" in between...

  • RE: SQL 2005 Paging File Available Memory

    can you provide some more specific info ?

    OS ? (+ sp)

    SQL version + sp

    exec sp_configure 'show advanced options' , 1

    exec sp_configure -- information (extended info activated please)

    This mainly to...

  • RE: Moving SQL System databases

    did you grant all sqlservers service accounts the needed folder authorities for the new location ?

  • RE: best way to delete two million rows

    Looking good.

    Indeed the delete statement does not need the "*" :blush:

    Think DRP: start with a full db backup for this operation !

    Since this proc only has this single while loop...

  • RE: best way to delete two million rows

    DBA (3/10/2008)


    hi my plan is to run this script once, delete 2 million rows out of 20 million, then create another query to do it every 3 minutes. so...

  • RE: best way to delete two million rows

    - that may be a good option if 2M is the majority or rows in your table.

    - If not, you may want to use a while loop to just delete...

  • RE: Varchar(max) problem in SQL server 2005

    I'm sorry I've forgotten to mention just to put my code

    right before the housekeeping section (last line) of Jeffs.

    :blush:

    -- put my code overhere

    --===== Housekeeping

    DROP TABLE #Tally

  • RE: CLR and UDF

    you could start with the using the new sql2005 except join

    then unpivot the resultset

    and then check for the differences.

    remarks: datatypes will get converted to varchar(max)

    (I did put max...

  • RE: Do I need a CURSOR?

    Sergiy (3/9/2008)


    SELECT @SaleAmount = @SaleAmount * (1-Amount)

    FROM dbo.Temp_Discount

    ORDER BY OrderID

    There is a very nice must read article bij Jeff Moden regarding this construct.

    http://www.sqlservercentral.com/articles/Advanced+Querying/61716/

  • RE: upgrade from sql server 2000 to 2005

    Like Chad Slagle explained, if you can, contact a sysadmin / serveradmin to run SQLUA for you, so SQLUA can provide you the most possible info.

  • RE: Varchar(max) problem in SQL server 2005

    And the example Jeff provided only handles a variable a couple of times.

    I've added this bit, to get the data actualy in a couple of tables and

    the effect only...

Viewing 15 posts - 5,101 through 5,115 (of 7,505 total)