Forum Replies Created

Viewing 15 posts - 3,856 through 3,870 (of 4,034 total)

  • RE: Missing sequence number

    SwePeso (8/25/2010)


    DECLARE@Sample TABLE

    (

    ID INT NOT NULL

    )

    INSERT@Sample

    SELECT 1 UNION ALL

    SELECT 2 UNION ALL

    SELECT 3 UNION ALL

    SELECT 4 UNION ALL

    SELECT 6 UNION ALL

    SELECT 7 UNION ALL

    SELECT 9 UNION ALL

    SELECT11

    -- Get the missing...

  • RE: Concatinate the String with in single row

    The Stuff() formula is used to get rid of the extra comma.

    Drew

  • RE: Advanced string search.....

    I've never used full-text search, but I think that it has the capabilities that you are looking for. It's certainly a good place to start.

    Drew

  • RE: Julian Date Conversion Function Issue

    Shorter is not always simpler. If you're going for shortest, then this is much more elegant.

    SELECT DateAdd(Day

    , Substring(@Source, 5, 3) - 1

    ...

  • RE: Julian Date Conversion Function Issue

    You're returning a varchar field. Is there some reason that you don't want to return a datetime field?

    When you assign your datetime field to your varchar field, you don't...

  • RE: Problem with a join.....

    Just because environment_key is the only field that the three have in common doesn't mean that's the field that you want to join on. All of my tables have...

  • RE: Feeding different parameters to a variable

    Chris Morris-439714 (8/18/2010)


    WHERE PartitionSize IN (1, Seq*2, Seq*2-1) -- < changed 3rd param here

    Cheers

    ChrisM

    This makes it seem like 1 is a special case when it's actually an exemplar of...

  • RE: problem in select query

    khurram sultan (8/19/2010)


    SELECT

    Tb_item.Item_part_number ,

    Tb_item.item_description,

    (SELECT TOP 1 ISNULL(Stock, 0) FROM Tb_Item_Cost_Ledger WHERE (ItemId = Tb_Item.CoA_ID) AND (Vdate <= '20100101') ORDER BY Vdate DESC) as Stock

    FROM ...

  • RE: sql trigger using cte - need help

    Eugene Elutin (8/17/2010)


    Could you please advise how many records you are expecting to be inserted into this table at-once (eg. using INSERT ... SELECT...type of queries).

    Will it be one-by-one...

  • RE: sql trigger using cte - need help

    In looking over your trigger again, I noticed a couple of things. Since you declare your variable as varchar, it only holds the last value when you set the...

  • RE: stopping index generation

    teutales (8/16/2010)


    Why do you want to not update an index during a batch?

    because of duration... I thought this is a big brake...

    thank you all for your replies!!!!

    Your cursor is more...

  • RE: Sql Query to extract the data.. Need Help...

    There are a couple of options.

    CASE 1: Left outer join

    SELECT DISTINCT e.EmpID, e.Name, CASE WHEN sub.EmpID Is NULL THEN 'N' ELSE 'Y' END AS Manager_Status

    FROM Employee AS e

    LEFT OUTER...

  • RE: sql trigger using cte - need help

    Your assignment statement is in the wrong place. Your statement should be

    WITH CTE AS (....)

    SELECT @MyVal = ( SELECT .... FROM CTE .... )

    Also, the query you are using...

  • RE: optimise avoid using loop

    His function already returns the CustomerCode, so he can join on that instead of rewriting the function.

    UPDATE TR

    SET Amount_Lastest = FGA.AmountFinal

    FROM #TempResults ...

  • RE: Create #Temp Table using While Loop Instead of Cursor

    It's really not clear what you are trying to accomplish. Are you trying to replicate the Information_Schema.Columns view? How about providing sample data and expected results as recommended...

Viewing 15 posts - 3,856 through 3,870 (of 4,034 total)