Forum Replies Created

Viewing 15 posts - 211 through 225 (of 542 total)

  • RE: Build query by using function

    In this case using "case" is the best way.  However, for more complex resolutions this would just be another table that holds the integer value and a corresponding value, which...

    Signature is NULL

  • RE: Left pad field

    And to bum Chad's a little more:

    reverse(cast(reverse(REPLICATE('0', 5) + @value) as varchar(5)))

     

    Signature is NULL

  • RE: VB function to SQL UDFunction - Working Days

    There is a set based way to do this, but first you need to set up a common SQL table called "Sequence":

     

    CREATE TABLE [Sequence] (

     [SequenceID] [int] IDENTITY (1, 1) NOT...

    Signature is NULL

  • RE: Question regarding Sql server 2000 column names and aliases

    I don't understand, why don't you just use the following?

    select '<MDS>'

    select  1 as TAG,

              0 as parent,

              Q1.MedicationID as [M!1!MID],

              Q1.PatientID as [M!1!MName]

    from Medication Q1

    WHERE  Q1.MedicationID = @MedicationID

    FOR...

    Signature is NULL

  • RE: Better way to Update only those values changed?

    Just doing the audit will suffice thou I do believe. Because you condition should be ON UPDATE for the table. Then you can compare changes over a period of time...

    Signature is NULL

  • RE: Better way to Update only those values changed?

    The problem with IF UPDATE is that it cannot determine if the value actually changed only that the value was explicitly set.

    True...an additional check is needed

    If Update(Col1)

    BEGIN

     Insert  Audit (ColID, Value)

     Select...

    Signature is NULL

  • RE: Better way to Update only those values changed?

    Whatever works for you.  In triggers you also have the option of testing groups by using:

    IF UPDATE (column1) OR IF UPDATE (column2)

    Triggers can be really tricky, but they are useful if...

    Signature is NULL

  • RE: Its not a good idea to have metadata in the name!

    6) You look really stupid when you use a "tbl-" prefix in a language that has only one data structure.  Likewise "vw-" looks stupid since the user is not supposed...

    Signature is NULL

  • RE: Better way to Update only those values changed?

    There are certain times I want to trigger something when the actual value changes, but not when the value is updated to itself.  For example, we have a web application...

    Signature is NULL

  • RE: Sorting with Varchar Field

    May I add this to my site, so the users can decide for themselves which one to use?

    Sure, feel free to post it, but I think the patindex method is...

    Signature is NULL

  • RE: Sorting with Varchar Field

    Yoda's advice is wise and illustrates the real problem, in that your column is an aggregate of two values.

    Frank, love the pattern searching for this.  My only gripe is that...

    Signature is NULL

  • RE: The insult before Christmas

    Nobody makes fun of how we dress at my work, although they do complain about the smell sometimes (not about me, I take a sponge bath every month whether I...

    Signature is NULL

  • RE: white spaces being filled in char(N) type field

    if you must use char and the spaces are giving you grief, you can use a "rtrim" function:

    select rtrim(cast('1' as char(5)))

    Signature is NULL

  • RE: Comparing like data types for performance reasons

    I have seen problems when using implicit casting.  casting the 1 as a bit can be done explicitely (as in example 2) or implicitely (as in example 1).  Implicit casting...

    Signature is NULL

  • RE: Indexed Views

    Quote: "Excellent article, however, I'm sure the value of indexed views can be communicated just as effectively without preaching to us about denormalization...which seems to be the author's real...

    Signature is NULL

Viewing 15 posts - 211 through 225 (of 542 total)