Forum Replies Created

Viewing 15 posts - 15,331 through 15,345 (of 15,376 total)

  • RE: datetime - 1/1/1900 treated as blank??

    I think the confusion is that sql converts '' to 1/1/1900. If you need to use this date and also have "blank" try inserting null instead of ''. If this...

  • RE: Need help displaying data

    Basically, I would write a cursor to loop through all the rows. Do a control break type logic such that you stick the AccountName in a variable. Start by initializing...

  • RE: Need help displaying data

    Upgrade to 2005. 😛

    You are probably going to have to do this row-by-row. :sick:

    I can probably find some time later today to come up with a rough idea if you...

  • RE: Copy non-system tables to development databse

    There is certainly a better way to do this but you could probably use the

    sys.tables where create_date > @LastSyncDate or modify_date > @LastSyncDate

    to get a list of tables.

    Then...

  • RE: Copy non-system tables to development databse

    Are you saying the structure of your production databases changes daily? :w00t: That sounds a little scary. Maybe you should look into something like doing a backup of prod and...

  • RE: When to store a FK or just the text

    Yes it is very normal (even normalized :-P) to have several foreign key relationships to any given table. If you have time I would defintely recommend catching up on some...

  • RE: Delete trigger

    At a glance I don't see anything wrong with this trigger. The record in the original table is not really gone yet. It is in the middle of a transaction...

  • RE: When to store a FK or just the text

    These should be foreign keys. Think of hard it will be if you store the program name in multiple tables and the name of the program changes. :w00t: What if...

  • RE: Need help displaying data

    JacekO (4/16/2009)


    My solution has a simpler execution plan and lower query cost so it might perform faster. But of course both them work and it's your call. 🙂

    I agree....

  • RE: Need help displaying data

    Try this and this if this gets you what you want. I included my create and insert scripts too. 😉

    create table Account

    (

    Accountname varchar(50),

    Booknumber int,

    Bookname varchar(50)

    )

    insert account select 'StoreOne',...

  • RE: Question relating to TSQL Case WHEN

    Glad that worked for you. Let me know if you need some more help on it and I will see what I can do. 😀

  • RE: Question relating to TSQL Case WHEN

    I tweaked your code a little bit more. I removed the in because it was checking for a single value and removed the statusid check at the end. I think...

  • RE: Question relating to TSQL Case WHEN

    Actually, when i was looking again at your code the case statement has only 1 valid path. You are filtering out every value for StatusID except what is in

  • RE: Question relating to TSQL Case WHEN

    Can you post the create scripts, some sample data and the desired output? That way we are on the same page. It sounds like the case is exactly what you...

  • RE: Question relating to TSQL Case WHEN

    Are you just trying to select this info? If so then just take the alias of the columns.

    Try this.

    CASE (a.statusdetail)

    WHEN NULL THEN 9

    ELSE 11

    END as StatusID

Viewing 15 posts - 15,331 through 15,345 (of 15,376 total)