Forum Replies Created

Viewing 15 posts - 6,796 through 6,810 (of 7,187 total)

  • RE: T-SQL basic Query

    Mark

    This uses the undocumented (and unsupported) stored procedure sp_MSforeachdb:

    sp_MSforeachdb

    'use ?

    exec sp_helpfile'

    John

  • RE: Update in batches

    Jeff

    When I used the word "truncate", I was assuming that the original poster will make the correct choice as to whether to back up the log, or just truncate it. ...

  • RE: Update in batches

    Yes, but if you create a job to truncate the log every minute (for example), or to truncate it when it gets to 60% full, then at least you have a...

  • RE: Multiple Keyword search

    Darren

    I recommend that you read this before proceeding, so that you are aware of any pitfalls of whatever method you choose.

    http://www.sommarskog.se/dynamic_sql.html

    John

     

  • RE: UPDATE on table to INNER JOIN with same table.

    Something like this?

    WHERE ins1.createdate IN

     (SELECT createdate FROM tbl_NSP_Inspection

      WHERE InspectionUID @InspectionUID )

    I'm afraid I can't help you on the SQL CE side of things.

    John

  • RE: Problems dropping a table in Query Analyzer

    William

    Is Daily_Transactions the name of the database?

    DROP TABLE Daily_Transactions.dbo.hist

    John

  • RE: Splitting database into seperate files

    The two filegroups would have to be on separate physical disks for there to be any performance improvement.  I've never analysed it, but I would think if you're pulling a...

  • RE: UPDATE on table to INNER JOIN with same table.

    Trystan

    Almost right.  Take the table name out of the first line to leave just the alias:

    UPDATE INS1

    SET INS1.IsLastOfDay 0

    FROM tbl_NSP_Inspection INS1 

    INNER JOIN tbl_NSP_Inspection INS2 

    ON INS1.InspectionUID 

  • RE: Splitting database into seperate files

    Gail

    We have our tables on one filegroup and non-clustered indexes on another.  While this may not provide the best performance in every case, it is a satisfactory generic solution and...

  • RE: Multiple Keyword search

    You should be aware that if you use dynamic SQL in your stored procedure, it will be executed in the security context of the user running the stored procedure, and...

  • RE: Unable to Update

    Oooh - I don't know.  Send it to your favourite good cause.

    Seriously, though - happy to help.

    John

  • RE: Unable to Update

    Not tested, but something like this should work.

    John

    UPDATE t

    SET t.lst_upd_ts c.lst_upd_ts

    FROM Tbl_Dates_Convert c JOIN Table_Dates2 t

    ON t.TS c.TS

  • RE: Advice needed to persuade customer to use sensible practices

    Rob

    I agree that it does seem a daft way of doing, but you don't need to have everybody having sysadmin access.  Just delete the BUILTIN\ADMINISTRATORS user (or whatever it's called...

  • RE: restore all databases, including system dbs, on one server to another

    Kathleen

    OK, so you can either copy the model database files to the default location before you start SQL Server, or you can start SQL Server with the -T3608 flag and...

  • RE: Help with difficult Query

    SQL Server implicitly converts the string into a datetime value.

    If you are trying to plug in the values in the way you show in your "Test it out" section, then...

Viewing 15 posts - 6,796 through 6,810 (of 7,187 total)