Forum Replies Created

Viewing 15 posts - 31 through 45 (of 303 total)

  • RE: Insert Column Default Values

    Paul & Seth -- Thanks so much for your help!

  • RE: Insert Column Default Values

    Paul White NZ (5/3/2010)


    Goldie Graber (5/3/2010)


    Out of curiosity, what is the difference between a UDF that accesses data and a trigger that accesses data? Won't the trigger also get called...

  • RE: Insert Column Default Values

    Paul White NZ (5/1/2010)


    Garadin (4/30/2010)


    I'll admit that I scanned this, but I didn't see anyone mention a UDF as the default constraint on the column that does a lookup for...

  • RE: Insert Column Default Values

    Thanks for your help.

    This solution won't work for me, I have multiple columns with these requirements and that would cause the trigger to be very complex.

  • RE: Insert Column Default Values

    sturner (4/28/2010)


    Students that need to loose weight should have a NULL lunch period.

    :hehe::hehe:

  • RE: Insert Column Default Values

    Lowell (4/28/2010)


    but your @Student table does not allow nulls for the lunch; that is the constraint failure;:

    ,LunchPeriod INT DEFAULT(4) ...

  • RE: Insert Column Default Values

    Lowell (4/28/2010)


    i think i had to change my data; you had one class with a null lunch:

    SELECT '10-B', NULL

    which i changed so it would work; i was kind of...

  • RE: Insert Column Default Values

    sturner (4/28/2010)


    Then there are two other options:

    1) check for null and use a 3 value insert statement if it is null, else insert 4 values.

    2) select the column default value...

  • RE: Insert Column Default Values

    Lowell (4/28/2010)


    how about selecting from the @Class table?

    INSERT INTO @Student(FirstName, LastName, ClassID, LunchPeriod)

    SELECT 'John', 'Smith', @ClassID, isnull(@LunchPeriod,LunchPeriod) from @Class where ClassId = @ClassID

    I can't get this to work? When I...

  • RE: Insert Column Default Values

    I'm looking for a way to do it without hard-coding the column defaults.

    This way, if the column default changes, the new records would be correct.

  • RE: Understanding and Using APPLY (Part 1)

    Thanks for the excellent article! Clear and concise!

    Providing sample code with extra examples was a perfect way to provide more information, without cluttering the main article.

    I've never actually used APPLY...

  • RE: Splitting A String

    lmu92 (3/15/2010)


    Something like this?

    DECLARE @OutlineNumber VARCHAR(1000)

    SET @OutlineNumber= '.I.A.1.b.'

    SELECT STUFF(SUBSTRING(@OutlineNumber,1,CHARINDEX('.',@OutlineNumber,N+1)),1,1,'')

    FROM dbo.Tally

    WHERE N < LEN(@OutlineNumber)

    AND SUBSTRING(@OutlineNumber,N,1) = '.'

    The variable needs to have a...

  • RE: Return data from one list which applies to all data in a second list

    Thanks to both of you for your help!

    Paul, why do you say your second query is better?

  • RE: Calculating Moving Averages with T-SQL

    Thanks for the excellent article!

    You did a terrific job explaining a complex topic in simple terms.

    The graphical explanations were also very helpful.

    I will be passing this one on as...

  • RE: Generating Unique Name

    Thanks for your help.

    I will do the performance testing when I have some free time, and post the results up here.

Viewing 15 posts - 31 through 45 (of 303 total)