Forum Replies Created

Viewing 15 posts - 1,231 through 1,245 (of 4,080 total)

  • RE: problem with CTE

    I will add, for those who are interested, this table supports a dynamic form-builder application. Users create their own custom forms with any number of custom fields of string,...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: problem with CTE

    Can you even change the EAV to use type SQL_VARIANT?

    declare @testFieldType table(fieldId int, code varchar(20))

    declare @testDocDataFieldValues table(fieldId int, fieldvalue SQL_VARIANT)

    insert into @testFieldType values (1, 'fieldTypeNumeric')

    insert into @testFieldType values (2, 'fieldTypeString')

    insert...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: how to use if-else condition in store procedure with insert,update,delete,reader with example

    What is "reader" ??

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    Congratulations, Gianluca 😀

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: deduplication

    ROW_NUMBER() is an EXCELLENT way of identifying dups and getting rid of all but one.

    Good job.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: De-normalize or index?

    pdanes2 (12/19/2010)


    I only looked at this briefly but I'd say the WHERE clause is totally unnecessary. Unless someone messed with the server-wide settings, NULLs won't join anyway.

    Hmm, yes, I...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: INSERT performance on indexed files

    I have this huge table. The SELECT perfromance is very bad. So I was thinking to add more indexes, which of course will affect INSERT perfromance. So I was just...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: De-normalize or index?

    I wonder, might it be worthwhile for the initial load to create separate Boolean fields whose values corresponds to the results of such queries? That is, one Boolean field...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: random records

    Here is an example of pulling 20 random rows from a million row table.

    Note to Jeff Moden: It may not be "Nasty Fast" but it's "Wicked Quick" 😀

    Had...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: random records

    Using ORDER BY NEWID() with huge files is slow, because of the sort time.

    Generating TOP (X) WHERE (random number test) is fast, but tends to skew towards the front of...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Row and column values comparison

    Anytime you don't know the tables in advance, you will have to use dynamic SQL to get there. Either way, you may find the Cross Apply easier...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    You tell 'em, Steve !!!

    I wander in here for the first time in a month and get bombarded with utterly useful technical information.

    Now I know how...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Row and column values comparison

    Sorry for the delay, I was working at my paying job. 😉

    This should work for you too if you are running SQL2008.

    In production, you should consider indexing...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: USING VARIABLES in PARAMETERS

    Put a PRINT @sql statement right before EXEC sp_ExecuteSQL and lets see what values you are passing.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: UPDATE multiple rows

    You can use a WHERE clause with an UPDATE statement in T-SQL.

    UPDATE Table

    SET database_name = db_name()

    WHERE database_name IS NULL

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 1,231 through 1,245 (of 4,080 total)