Forum Replies Created

Viewing 15 posts - 1 through 15 (of 21 total)

  • RE: Date encrytion

    Rough guess based on what you described above.

    Step 1: Generate a random number between 1 and 10000

    Step 2: Output random number in step 1 + DATEDIFF(DAY, '1/1/1800', dateColumnInTable).

    If they're doing...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: Importing a web service XML document into SQL stored procedure

    This is probably more a job for SSIS than for stored procs.

    Calling a web service in SSIS is pretty easy (there's a task for it), and you should be able...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: Outer Joins on Composite Keys using Join Syntax in the From Clause (ANSI SQL:1992)

    select

    ccp.part_id,

    ccp.warehouse_id,

    ccp.count_freq,

    ccp.last_count_date,

    pl.qty

    from

    cycle_count_part ccp LEFT JOIN part_location pl ON ccp.part_id = pl.part_id AND ccp.warehouse_id = pl.warehouse_id

    where pl.part_id IS NOT NULL

    AND

    ccp.warehouse_id in ('GSS_PROD','AIRCRAFT_PROD')

     

    ...sorry for the bad formatting.


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: C#2005 and ADO.NET 2.0 - Saving multiple table rows in a single transaction

    High level overview of how to do this (we do this a lot in our application).

    Use a sproc that takes an XML parameter.

    Wrap the parent and child updates into XML

    Have...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: Offset inside the queries

    If you're trying to implement paging (which it sounds like you're doing), have a look at: http://qa.sqlservercentral.com/columnists/jSebastian/3181.asp

    It has seveal links to ways to accomplish paging, including front and back...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: Using XQuery and looping thru XML data questions.

    It's still eating your XML, but assuming it looks like:

    <TestCaseID>12345</TestCaseID>

    <TestCaseID>12346</TestCaseID>

    You can use:

    INSERT INTO <table> (field) SELECT T.T.value('.[1]', 'INT') FROM @XML.nodes('/TestCaseID') AS T(T)

    Should do what you're trying to do without a...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: T-SQL Help

    Mmmm... One of those having tricks can solve this.

    SELECT

        Pole_ID

    FROM

        XX

    GROUP BY

        Pole_ID

    HAVING

       COUNT(*) = SUM(CASE WHEN Date IS NULL THEN 0 ELSE 1 END)

    Note that...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: XSLT Transformation

    Interesting...

    I used the:

    <xsl:for-each select="/Report/table1/Detail_Collection/Detail">

    syntax in XML Notepad against the XML you posted, and everything worked fine, once I removed the reference to the XML schema (https://corepm.acme.com, since that doesn't...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: XSLT Transformation

    Can't check this right now, but I'm pretty sure you need to either change the

    <xsl:template match="/">

    to


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: DB size after index deletion has not been changed?

    I've sometimes run into this issue when scrubbing our production DB for the developers. You may need to do an index rebuild on the affected tables to see a space...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: optimization of XML string query

    The syntax for these is a painfully awkward, but it works.

    You may need to change this slightly based on the actual layout of...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: optimization of XML string query

    Couple ideas, not being sure what you're trying to do.

    If you're doing the statement in a loop, it's probably bad, as the xml.nodes will parse the entire XML set each...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: If an error occurs in a SP, does it get returned as a parameter?

    Best bet for this is to run profiler against the DB and trigger the error in the front end, if you can (not sure where your web server/DB are). Profiler...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: Couldn''''t grab the data I want. Please Help.

    You need to do left joins into the Prod and Loc tables:

    SELECT test.TestID, ISNULL(location.LocationName, '-'), INULL(product.ProductName, '-')

    FROM Test as test

    INNER JOIN ProdLoc AS prodLoc ON test.ProdLocID = prodLoc.ProdLocID

    LEFT JOIN Product AS...


    Greg Walker
    DBA, ExpenseWatch.com

  • RE: Performance issue with XML

    I've seen the same issue when looking at query plans. I think this has to do with the 10,000 row assumption thing on working tables.

    If you run profiler against these...


    Greg Walker
    DBA, ExpenseWatch.com

Viewing 15 posts - 1 through 15 (of 21 total)