Forum Replies Created

Viewing 15 posts - 1,156 through 1,170 (of 1,315 total)

  • RE: delete all constraints for a table

    A quick way to get EM to generate a script with all the DROP CONSTRAINT commands is to go in to Design mode and insert a field somewhere (not at the...

  • RE: Another Removing Duplicates Problem

    My favorite technique for removing duplicates, at least for larger data sets, is to use CREATE UNIQUE INDEX ... WITH IGNORE_DUP_KEY.

    You can use ORDER BY when filling the table to...

  • RE: copy a table over to a linked server by ''''SELECT ...INTO''''

    The alias doesn't work.  There is no way to execute SELECT INTO server.db..tbl.

    If you want to copy a table from server A to server B, you could connect to server...

  • RE: Database comparison

    The quick answer is to get SQL Compare or a similar tool.

    Another solution is to use Enterprise Manager to script both databases to a file, and run the files through...

  • RE: Windows API Calls

    Why couldn't you put the RAR command in an Execute Process task?  The step would not be complete until RAR finished.

  • RE: Replication for trigger data

    Instead of using replication (for this table), you could put code in the trigger to copy any new rows to a table on the subscriber.

    In a FOR INSERT, UPDATE trigger:

      ...

  • RE: Counting NULLs

    You are correct, we're running SP3.  Although the Microsoft bug description doesn't seem to explain why "SELECT <nonkey field> FROM Table WHERE KeyField IS NULL" doesn't work (the bug only mentions aggregate functions),...

  • RE: Counting NULLs

    This is on a 2-CPU (hyperthreaded) server.

    With MAXDOP=1, I get the correct result for SELECT COUNT(*) ... IS NULL (1.6 million).  With MAXDOP=2,3, or 4 I get various numbers in...

  • RE: group by minutes help

    It rounds instead of truncates.  You can make it work the way you want by subtracting 30 seconds.

    Select

    cast(dateadd(s,-30,'2005-05-02 14:56:52.493') as smalldatetime)

    , cast (dateadd(s,-30,'2005-05-02 14:57:03.447') as smalldatetime)

    , convert(varchar(16),'2005-05-02 14:56:52.493',20)

    , convert(varchar(16),'2005-05-02...

  • RE: Returning info up to space?

    If any rows do not have spaces, it will object to LEFT(string, -1).

    You could use 

    IF CHARINDEX(' ', @myval)>0 select LEFT(@myval, CHARINDEX(' ', @myval))

    ELSE select ''

     

  • RE: Counting NULLs

    As stated initially, I have run DBCC CHECKDB and CHECKTABLE with no errors found.  I have also both reindexed and drop/created the secondary index.

    An execution plan that involves an index...

  • RE: group by minutes help

    If you use CAST(rcv_dt as smalldatetime) it will group by minutes without resorting to string manipulation.

  • RE: Counting NULLs

    Note that all queries use "IS NULL" and "IS NOT NULL", never "=NULL" or "<>NULL".

    And I can assure you that none of the fields contain the character string 'NULL'

     

  • RE: Pivot Report

    I agree that pivoting on the client might be better.  You might be able to do something elegant with XSLT.

    But if you are determined to get the report you asked...

  • RE: Moving Database based on a VB application

    If you can't find the connection properties in a DSN, INI file, or anywhere else, there may still be hope.

    If you copy the database to another server (must have the...

Viewing 15 posts - 1,156 through 1,170 (of 1,315 total)