Forum Replies Created

Viewing 15 posts - 151 through 165 (of 268 total)

  • RE: Question re Check Contraints

    YOu should be able to do it by creating a VIEW ...WITH CHECK as described here:

  • RE: sql command

    Luis Cazares (5/9/2014)


    What would happen if someone sets the value of ZoneName to

    '; DELETE TABLE IPPOOL;

    Don't try this on a production environment.

    You might want to read about SQL Injection to...

  • RE: sql command

    Try adding an equals sign at the end of the first string.

  • RE: Max of Row Number Logic

    I'm not sure this will always give you what you want. It may not even give the same answer on subsequent runs. The reason is that your ORDER...

  • RE: Cumulative sum of previous rows

    Here's a version using a CTE for an easy-to-read implimenation:

    ;with d as (

    select netInventoryQty, demandID, d.itemID, i.inventoryQty,

    SUM(orderQty) OVER ( PARTITION BY d.itemID ORDER BY demandid ) AS 'cumQty'

    from demand d

    join...

  • RE: Data Type conversion

    e.g.

    select cast(stuff('02-16-2014-03:52:03', 11, 1, ' ') as datetime)

  • RE: Deleting records from a large table

    skaggs.andrew (5/8/2014)


    When I tested without an index, it took longer to delete the records. I created an index with the column I have in my where clause, but its...

  • RE: Deleting records from a large table

    Have you checked the execution plan to see it contains scans?

    You could disable or drop the indices then rebuild them after the delete operation. You could add a NC...

  • RE: Poor Man (dev) Version Control

    That looks like an approach to audit changes. Is it full source-control? That is, can I, using your idea, see who changed what specifically (not just that...

  • RE: Case statement with <> condition

    Sean Lange (5/7/2014)


    gbritton1 (5/7/2014)


    Sean Lange (5/7/2014)


    How about this?

    SELECT [Columns]

    FROM Test1 T1

    INNER JOIN Test2 T2 ON T1.ID = T2.ID

    WHERE CASE @p_flag

    WHEN 1 THEN moveFlag = 26

    ELSE moveFlag > 26 OR moveFlag...

  • RE: Case statement with <> condition

    Sean Lange (5/7/2014)


    How about this?

    SELECT [Columns]

    FROM Test1 T1

    INNER JOIN Test2 T2 ON T1.ID = T2.ID

    WHERE CASE @p_flag

    WHEN 1 THEN moveFlag = 26

    ELSE moveFlag > 26 OR moveFlag < 26

    END

    how...

  • RE: ssrs with rectangle cuases first page to be blank

    Is the rectangle at position (0,0) ?

  • RE: Slow self join

    Some other things to consider:

    1. Do you have indices on the join columns? (MWID, [Org Eenheid Code], BEGINDATUM)

    2. If you have an index on BEGINDATUM, the expression

    DATEPART(ISO_WEEK,A.BEGINDATUM)= DATEPART(ISO_WEEK,B.BEGINDATUM)

    will stop...

  • RE: Current year begin and end dates

    andrew gothard (5/6/2014)


    Personally for things like this, I prefer a DateDim / Calendar table - apart from the fact this makes the SQL CLeaner, and you only have to do...

  • RE: Pull the string inside the stored procedure definition

    I mean that the following WHERE clauses are equivalent:

    1. No space

    WHERE a=b

    2. Some spaces

    WHERE a = b

    3. Some...

Viewing 15 posts - 151 through 165 (of 268 total)