Forum Replies Created

Viewing 15 posts - 526 through 540 (of 898 total)

  • RE: Stored Procedure

    -----------------------------------------------------------------------------------------------

    USP_Check_For_Blanks 'name'

    ------------------------------------------------------------------------------------------

    Are you using this script to call your SP?

    If "Yes", then you are passing a non-blank parameter and the updates will be executed and no results will be displayed

    Try...

  • RE: case statement

    ranuganti (5/10/2012)


    so how should we use this statement without returning 2 records

    select

    case when Void = 0 then SUM(weight) end AS totalweight

    from test

    when i use this i get

    result as:

    total...

  • RE: case statement

    Duplicate post. Please post your replies here.

    http://www.sqlservercentral.com/Forums/FindPost1297770.aspx

  • RE: case statement

    This seems to be a very simple issue, but people are having difficulty because they don't have enough information to solve it

    It would be better if you post some sample...

  • RE: Delete Duplicates

    vani_r14 (5/8/2012)


    Hi all

    Is there a way to check for the existence of a row and then delete another row based on the value of the row checked earlier.

    e.g. In...

  • RE: Triggers

    I think you can use an INSTEAD OF trigger for this purpose

    Never had to use it myself though:-)

  • RE: Get related fields from record containing MAX()

    pdanes (5/9/2012)


    In fact, looking at (and running) your code just now, it illustrates exactly that duplicate issue - Column B has two instances of the MAX value of 4, and...

  • RE: Select records from huge nos. of data

    Do you have any indexes on the "TR_Activity" table?

    A clustered index on "ActivityId" will be helpfull

    Also, you can try creating a clustered index in column "ROWNUM" in table "@TEMPTABLE"

    Post the...

  • RE: sql discu

    asranantha (5/6/2012)


    Hi Friends , whever i load data from one table to another table data load

    suppose table1 data like id , name ,sal

    1 , ravi , 1200

    2 , vebal...

  • RE: sum operation

    Hope this helps

    SELECTProductId, SizeId, SUM( Quantity * CASE WHEN Process = 1 THEN -1 ELSE 1 END ) Total

    FROMProductTrack

    GROUP BY ProductId, SizeId

  • RE: Help with code for a SQL Newbie :-)

    Just some small changes to Anthony's code.

    You probably need this

    declare @table table (policytransactionid int, policynumber int, sessionid int, policystatus int)

    insert into @table VALUES (1,1234,1,10), (2,1234,5,10),(3,1234,9,10),(4,1234,10,3),(5,5678,89,10)

    ;with cte as

    (

    select

    ROW_NUMBER() OVER (PARTITION BY...

  • RE: Cluster Index in Inculude Column

    ESAT ERKEC (5/2/2012)


    /*

    The Query Processor estimates that implementing the following index could improve the query cost by 99.9906%.

    */

    /*

    USE [DB]

    GO

    CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>]

    ON [dbo].[TBL] ([STOCKREF],[INVENNO],[DATE_])

    INCLUDE ([LOGICALREF])

    GO

    */

    SQL Server...

  • RE: Pivot table problems

    Matthew Cushing (4/30/2012)


    Okay, that's not fair. I tried that before I posted all of this and got a syntax error.

    I think that solved it, thanks man!

    It happens sometimes:-)

    Glad to...

  • RE: Pivot table problems

    Try changing nra_tax_country to MAX( nra_tax_country ) and see if it works

  • RE: Create New Records Into Same Table

    Try this

    INSERT INTO mytable

    ([Area],[Employee No_],[Date]

    SELECT

    [Area],[Employee No_],[Date]= DATEADD (dd,N,[Date]) -- Replace the...

Viewing 15 posts - 526 through 540 (of 898 total)