Forum Replies Created

Viewing 15 posts - 3,916 through 3,930 (of 4,087 total)

  • 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...

  • RE: Updating 2 rows in table B based on 1 row from table A

    ziedkallel (8/12/2010)


    Actually the descriptions table is created from scratch based on some (simple) business rules. I'm hoping I can rely on those business rules to do the joint. Here is...

  • RE: Convert a weird character string

    Try CASTing it as varbinary(max).

    You might also want to check that the collations on the two databases match. Different collations can treat the same character differently.

    Drew

  • RE: deploy database change to ms sql server

    The basic idea is that you check whether an object already exists. If it doesn't you add it.

    IF NOT EXISTS (

    SELECT *

    ...

  • RE: Financial Year Query

    All you have to do is add/subtract the appropriate amount to adjust the beginning of your fiscal year to Jan. 1. In your case, subtracting three months (or adding...

  • RE: Help needed to generate an XML Structured output file

    A couple of things. In order for us to help you with your problem, the sample data has to be representative of your live data. Since it's obvious...

  • RE: how to unescape

    Web browsers unescape the characters for you. In order to display the escaped characters, you have to escape the ampersands that are produced by your query.

    col1(No column name)

    1<A>, <B>,...

  • RE: how to do this without a cursor?

    I'll go one step further. Your OrderID and LineID should either be int (highly recommended) or at least padded with zeros to get a consistent length. Otherwise when...

  • RE: Outputting XML to file with extended characters html encoded?

    It sounds like your original query was treating your XML data as string data. There are a number of ways that you can correct this, but since you didn't...

Viewing 15 posts - 3,916 through 3,930 (of 4,087 total)