Forum Replies Created

Viewing 15 posts - 1,111 through 1,125 (of 1,315 total)

  • RE: Master DB restore

    Another technique would be to restart SQL Server with trace flag 3608, which prevents recovery of any database other than master.  This would give you a chance to fix the file locations in...

  • RE: Determining User and System Databases

    If you can't assume the default distribution database was used, the distribution databases are listed in msdb..MSdistributiondbs.  You could use:

    SELECT name FROM master.dbo.sysdatabases WHERE dbid <= 4

    UNION ALL SELECT name FROM...

  • RE: Stripping Out Quotes

    The most likely reason (in my opinion) trailing blanks are ignored in comparisons is that you have fixed-length character fields.  If you're comparing a char(10) to a char(12) (or to...

  • RE: Stripping Out Quotes

    The first quote is from the topic "Comparison Search Conditions"

    The '' = ' ' issue can be found under "sp_dbcmptlevel" or "Empty Strings (Level 2)"

    ANSI_PADDING is discussed under "Setting Database...

  • RE: Stripping Out Quotes

    From BOL:

    Trailing blanks are ignored in comparisons in non-Unicode data; for example, these are equivalent:

    WHERE au_lname = 'White'WHERE au_lname = 'White 'WHERE au_lname = 'White' + SPACE(1)
    and "If the compatibility...
  • RE: Alias Name in Where Conditions

    You can use a subquery to define the aliases if you don't want to re-type the expression in other places.  This is not a correlated subquery that would affect performance,...

  • RE: INSERT INTO... EXEC() against linked server

    Assuming Distributed Transaction Controller service is running on both machines, there still may be configuration issues.  Permissions may be denied at various stages, such as a firewall blocking port 135...

  • RE: Stripping Out Quotes

    Remi, I'm disappointed you don't have a set-based solution!

    This version replaces individual characters with one SELECT.  It will only find single characters, but...

  • RE: How to identify the amount of space currently in use for a given data file when multiple data files exist for a file group

    You can use DBCC SHRINKFILE (<filename or fileid>, <current size in MB>, NOTRUNCATE) to get the EstimatedPages value without tying up the server.  If I read BOL correctly this command...

  • RE: Unable to recover space from log file

    There are a few missing details, such as the recovery mode, whether there is any other database activity, and what your tolerance is for data loss.

    If the DB is not logged...

  • RE: How to identify the amount of space currently in use for a given data file when multiple data files exist for a file group

    You could use DBCC SHRINKFILE with TRUNCATEONLY, or specify the current file size, to have it execute quickly and return the UsedPages and EstimatedPages values for the file.

    The only other...

  • RE: Slow Query

    Execution plan for "select cycleName from tbl_Cycle where dateClosed is null and deleted = 0" with an index on (dateClosed, deleted, cycleName) and [deleted] is a bit:

    ----------------------------------------------------------------------------------------------

      |--Index Seek(OBJECT: ([Sandbox].[dbo].[tbl_Cycle].[IX_tbl_Cycle]),...

  • RE: Slow Query

    Bit columns can be indexed.  They're not very selective, but they can be useful in compound covering indexes.

    It might be true that the Convert([deleted]) = 0 expression in the execution...

  • RE: SQL Server Agent Question

    Definately no Domain Admin service accounts, but you shouldn't use a local system account either.  The proxy account will get the agent job to run but there are many other functions (mail, replication,...

  • RE: Unable to recover space from log file

    No, he's suggesting with added emphasis that you make a backup (full or log) INSTEAD OF truncating.  Forget that the NO LOG ! TRUNCATE options exist.  These are...

Viewing 15 posts - 1,111 through 1,125 (of 1,315 total)