Forum Replies Created

Viewing 15 posts - 5,626 through 5,640 (of 7,164 total)

  • RE: Handle NULLs

    Revenant (7/6/2011)


    opc.three (7/6/2011)


    ...even with the nested loops introduced by the CTE I just posted I am not sure I would choose the cursor method you posted over them

    Yes, RBAR...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: List all indexes on an instance

    kingrudedog (7/6/2011)


    "Be careful of index usage stats, it only shows indexes that have been used in some way since the last time the instance was restarted, the database closed/re-opened or...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Handle NULLs

    Revenant (7/6/2011)


    Yes, you could select individual columns, UNION them, GROUP them (which would remove nulls), and pivot them back into four columns. That would be uglier than the RBAR...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Handle NULLs

    I think he was asking why you don't refactor your tables. Your comment is where I was headed. Here is what I came up with:

    IF EXISTS ( SELECT *

    ...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Looking for a good source control system...

    Cool. Thanks for posting back. It's nice to hear the direction after the questions are answered and a decision is made 🙂

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Duplicate key error when inserting into a table that has no records!!! Please help!

    There is no security table in your sample script :ermm:

    No matter though. Here is your insert reformatted:

    -- insert statement

    INSERT INTO VimasProFast1

    SELECT...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Using a value from a previous row to decrement a value in the current row

    Here is the fastest known method:

    http://www.sqlservercentral.com/articles/T-SQL/68467/%5B/url%5D

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Looking for a good source control system...

    I have used all three you mentioned and IMHO TFS is the best fit for you mainly because of the development environment integration it offers into BIDS and the testing...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: pipe Delimited

    You could continue to use SSIS but change your source to a query like this:

    SELECT *,

    NULL AS LastColumn

    FROM ...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: deadlock graph

    Which jdbc driver are you using? And can you post the code for the temporary stored proc?

    (@P0 bigint, @P1 datetime)EXEC Test_db1.dbo.sp_CreateDynamic @P0, @P1

    </curious>

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: upload files & default column value

    It sounds like you want to know the row in the database that corresponds to the first line in the file, and the second, and so on. To do that...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Calculating metric distributions

    greg.bull (7/6/2011)


    Not really, it wouldn't be a problem when plotting as a visualisation.

    I only asked because if you are not interested in pulling a complete set of deciles from SQL...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Xref table with missing elements

    Uggh...I thought about this a few different ways, maybe normalizing your Xref table a bit more, maybe running different queries based on inputs that would only join to a subset...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: SSIS bit Fields? True/False vs 0/1

    Another tricky (not intuitive) thing with Booleans in SSIS when coming from T-SQL is that you do not need to do any equality test. Consider something that looks like this:

    @IsHoliday...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Help with dynamic sql in sp

    See if something like this works for you:

    CREATE TABLE #tmp (errorcount INT) ;

    DECLARE @sql NVARCHAR(MAX) ;

    SET @sql = 'select 1 as errorcount;'

    INSERT INTO #tmp

    ...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 15 posts - 5,626 through 5,640 (of 7,164 total)