Forum Replies Created

Viewing 15 posts - 751 through 765 (of 920 total)

  • RE: How insert durning an update if no Record can be updated?

    This is usually done in a pattern of code that looks something like:

     

    if exists (select 1 from sometable where primarykey = values you have available)

        BEGIN

              update the row here,...


    And then again, I might be wrong ...
    David Webb

  • RE: The Bulb Man

    Hmmmmmm...

    You didn't mention the ceiling composition.  How about, climb onto the table, saw through the ceiling and climb out?

     

    Stand behind the cold-blooded lawyer until the cobra bit Sadam Hussein (since...


    And then again, I might be wrong ...
    David Webb

  • RE: The Bulb Man

    Why is that not logical?  Light bulbs exhibit characteristic behaviors, one of which is giving off light, and one is giving off heat. Any property of a lit bulb should...


    And then again, I might be wrong ...
    David Webb

  • RE: Query over 2 columns

    Both columns are datetime data type?  Could you post the table DDL and some sample data from the table? 


    And then again, I might be wrong ...
    David Webb

  • RE: Trapping errors while truncating a table

    Do a count(*), or some other potentially more efficient but predictable operation which returns a rowcount after the truncate.  If you have rows, the truncate failed and you can raise...


    And then again, I might be wrong ...
    David Webb

  • RE: minus statement

    select * from customer

    where customer_id not in (select customer_id

    from customerequipment)

     

    will give you customers who have no customerequipment records.  Reverse the tables in the FROM clauses to get the...


    And then again, I might be wrong ...
    David Webb

  • RE: bcp Utility

    Just a guess, because I'm not at a place to try it out, but the UNCname may need quotes.


    And then again, I might be wrong ...
    David Webb

  • RE: trans log backup weirdness...

    How are you backing this up?  If you're appending, the backup file will continue to grow. 


    And then again, I might be wrong ...
    David Webb

  • RE: Newbie "Must declare variable" question

    The 'GO' after the PRINT may be your problem.  I'd bet the server is executing everything above it as one batch and everything below it as another (that's the purpose...


    And then again, I might be wrong ...
    David Webb

  • RE: Backing up database depnding on records

    You could build views that join data across databases, thereby making multiple databases look like one, but I can't help believing that there's something seriously wrong here.  What is the...


    And then again, I might be wrong ...
    David Webb

  • RE: dynamic sql

    You might want to add a space in front of the ORDER BY to make sure it doesn't run into the id.


    And then again, I might be wrong ...
    David Webb

  • RE: Backing up database depnding on records

    The standard database backup commands pick up the whole database or a whole filegroup.  You could create an empty database and selectively put structures and data into it programatically based...


    And then again, I might be wrong ...
    David Webb

  • RE: How to increment a varchar?

    This Base64 encode and decode was posted here a while ago.  It might have something you can use.

    http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=1520

     


    And then again, I might be wrong ...
    David Webb

  • RE: Data Retrival from two Tables

    How 'bout ...

    select db1.column1 from database1.dbo.table1 db1 

    where db1.column1 not in (select db2.column1 from

    database2.dbo.table2 db2) 


    And then again, I might be wrong ...
    David Webb

  • RE: query to find out last date of the previous month

    Very nice!  That's so slick!


    And then again, I might be wrong ...
    David Webb

Viewing 15 posts - 751 through 765 (of 920 total)