Forum Replies Created

Viewing 15 posts - 2,941 through 2,955 (of 5,502 total)

  • RE: Replace Not in subquery with a self join

    I don't think you'd need the DISTINCT in your NOT IN clause. It won't matter anyway if there'd be more than one row returned per id. This would eliminate a...

  • RE: xml and sql sp

    You define an XML parameter in your sproc and send your parameter list as a valid xml string.

    In the sproc you transform the xml data into either a relational table...

  • RE: Are the posted questions getting worse?

    CirquedeSQLeil (8/26/2010)


    Should I stay or should I go now?

    If you go there will be trouble. An’ if you stay it will be double.

    So, in order to minimize trouble: RUN, Jason,...

  • RE: Aging Calculation for Items, Based on Status

    Something like the following code?

    (Side note: untested due to the lack of ready to use sample data)

    SELECT Part,DATEDIFF(dd,MAX(DATE),'20100810') AS age

    FROM Inv_Warehouse

    WHERE Status IN('InHouse', 'Delivered', 'Returned')

    GROUP BY Part

  • RE: Issue with nodes()

    Not if you also need to know the value of the AppId attribute and not as long as your pkg nodes are not nested within a root node.

    If you don't...

  • RE: How to Pivot using T-SQL

    Please have a look at the CrossTab article referenced in my signature for an alternative way.

    The CrossTab method will also make it a lot easier to return dynamic yearmonth columns...

  • RE: Import XML into SQL table shema

    Let's assume you have the file stored as c:\Temp\SSC.txt.

    Then you could use the following code (assuming you'd like to store the data in a xml column):

    /*

    CREATE TABLE T (IntCol int,...

  • RE: Issue with nodes()

    Here's an example of what I think Wayne is talking about:

    DECLARE @xml XML

    SET @xml=

    '<requests AppId="1">

    <pkg attribute1="a" attribute2="w"/>

    <pkg attribute1="b" attribute2="x"/>

    <pkg attribute1="c" attribute2="y"/>

    <pkg attribute1="d" attribute2="z"/>

    </requests>'

    /*-- or, alternatively

    SET @xml=

    '<pkg attribute1="a" attribute2="w" AppId="2"/>

    <pkg attribute1="b"...

  • RE: Plzz help me in replacing the cursor with Normal Sql Statements

    @mike-2: The quirky update method should not be used on joined tables. See Jeff's revised article[/url] for details.

    Other than that: as just confirmed the target system is SS2K5. No need...

  • RE: Plzz help me in replacing the cursor with Normal Sql Statements

    Now it starts to get confusing...

    You posted in a SS2K forum.

    When Jeff mentioned it regarding Mike's solution you didn't reply to clarify.

    And now you're posting a query that won't work...

  • RE: Plzz help me in replacing the cursor with Normal Sql Statements

    Jeff Moden (8/24/2010)


    ... I could take a look at it.

    So would do others (like me) πŸ™‚

    We might be able to find a solution without using joined tables when performing the...

  • RE: Pivot Query

    Why don't you use the "old-fashioned" CASE statement?

    SELECT

    SiteID,

    ServDate,

    SUM(CASE WHEN Meal=1 THEN FreeCnt ELSE 0 END) as Meal1FreeCnt,

    SUM(CASE WHEN Meal=1 THEN Reduced ELSE 0 END) as Meal1Reduced,

    SUM(CASE WHEN Meal=1...

  • RE: @@Rowcount for multiple statements

    @@ROWCOUNT will return the affected rows based on the statement before @@ROWCOUNT.

    You don't have to look for batch terminator.

    Other than that, yes, you'd have to look for each statement where...

  • RE: Performance problem.

    I would start running a profiler trace on "SQL batch starting/complete" to see if the duration of the statements will increase over time and which statement that would be.

  • RE: if Tempdb is full? what we have to do

    It depends.

    Is the system still able to run? If not, what error message do you get?

    When was the last transaction log backup? Is there any schedule for log backups? If...

Viewing 15 posts - 2,941 through 2,955 (of 5,502 total)