Forum Replies Created

Viewing 15 posts - 1,321 through 1,335 (of 1,554 total)

  • RE: Card Deck Simulation

    The point with my example (and David's) was just to show how to shuffle using NEWID()

    Just create your 'deck' table with the cards you need, and then you could probably...

  • RE: Insert/Update Trigger to replace column value

    If you can modify your action, you don't need a trigger for this.

    For insert, just insert getdate() into the column, for an update, set LastUpdateDate = getdate()

    It is possible to...

  • RE: T-SQL works in QA but fails when part of a job

    In what way does it 'fail' then..? Errormessages? Nothing happens? Other things than the expected happens? Permission problems? Object not found problems?

    .. there are quite a few reasons as to what...

  • RE: Exists Vs IN

    EXISTS is a boolean expression - IN is a list.

    EXISTS returns only true or false - no data from the expression in an EXISTS clause is returned. EXISTS also stops...

  • RE: Card Deck Simulation

    An easy way to generate a 'random' sequence is to order by NEWID()

    Here's showing the principle:

    create table #deck ( card int not null )

    declare @i int

    set @i =...

  • RE: Optimising a Distributed Query

    It sounds like the entire remote table is fetched across the wire before the search is done..?

    I don't do much linked servers, so I'm not sure what causes this, I...

  • RE: Optimising a Distributed Query

    Why implement it as a function?

    What happens if you just do

    SELECT @DOB = DOB FROM <serverName>.Demographics.dbo.Demographics WHERE Patient_ID = @PID

    ..?

    /Kenneth

  • RE: Improving delete performance.

    That's what I did. Both methods produce identical query plans - and both methods also produce the same argument. Even though you write WHERE col1 BETWEEN 'x' AND...

  • RE: Improving delete performance.

    Some agreements and some disagreements

    Not equal operators by their nature never uses any indices, they always force a table scan - that's why...

  • RE: Microsoft Source Safe

    AFAIK, not out of the box.

    There are however quite a few hits if you google for "SQL Server and Visual Sourcesafe integration".

    /Kenneth

  • RE: Urgent help required in Trigger

    Some thoughts....

    You really shouldn't attempt to send mail from within the trigger - it'll only annoy your boss even more, sooner rather than later. You never want to do external...

  • RE: How convert char ddmmyyyy to date dd.mm.yyyy?

    Well, this may be a bit tricky - not to produce the format, but the ddmmyyyy is not a valid date, so you can't use any convert styles. Also, you...

  • RE: Alternative methodes ... TO AVOID CURSORS....

    I liked Joe Celkos 'SQL for smarties' - not platform specific, it's more a 'generic SQL' book - but it gives you some food for thought.

    Also, another favorite is Ken...

  • RE: Alternative methodes ... TO AVOID CURSORS....

    Well, if the trigger doesn't do anything than call an insert or update procedure, then you're stuck. With that design you're forced to cursor through each insert or update - which...

  • RE: Alternative methodes ... TO AVOID CURSORS....

    Triggers (as you have found) fire once for every update, not once for every row.

    To deal with this, the trigger should be written in a way that handles more rows...

Viewing 15 posts - 1,321 through 1,335 (of 1,554 total)