Forum Replies Created

Viewing 15 posts - 16 through 30 (of 32 total)

  • Reply To: Create a View with Index

    WITH SubQuery AS
    (
    SELECTjh.Company, jh.JobNum, ja.AssemblySeq, jo.OprSeq, jo.OpCode,
    CAST(CASE WHEN NOT jh.Date03 IS NULL THEN jh.Date03...
  • Reply To: Create a View with Index

    I have removed all the 'reformatting' from the Views and removed the NoLock and added the Outer Apply.

    SELECT        jh.Company, jh.JobNum...
  • Reply To: Create a View with Index

    Instead of using multiple nested views - what technique should I adopt to build my more complex views?

  • Reply To: Create a View with Index

    I also, for readability, tend to create multiple smaller SQL Views then reuse them to build larger more complex views.

    I always use NoLock as I was getting a number of...

  • Reply To: Create a View with Index

    I tend to write my code outwith the gui then when I save it as a view SQL reformats and adds the TOP(100) etc.

  • Reply To: Create a View with Index

    The first SQL snippet is the original sql.

    The second SQL snippet is the new sql.

    The third snippet is the Function.

    The JobHead table has an Index of Company, JobNum but I...

  • Reply To: Create a View with Index

    WITH SubQuery AS (SELECT        TOP (100) PERCENT jh.Company, jh.JobNum AS ParentJob, jh.JobFirm, jh.JobReleased, ja.AssemblySeq, jh.PartNum AS ParentPart, jm.MtlSeq, jm.PartNum AS...
  • Reply To: Create a View with Index

    I have created a Scalar-valued Function and called this from within my view - basically the join that I perform on the non-index fields I have removed from my Sql...

  • Reply To: Create a View with Index

    The first view holds circa 1500 records and returns circa 2200 through a second cte view.

    The data is consistently refreshed throughout the working day - eg. every 5 minutes and...

  • RE: Running Total

    Jeff:

    Thanks for the response.

    There are about 16,000 to 20,000 rows in the data set in total currently.
    I want the running total to start over on...

  • RE: Running Total

    DesNorton - Thursday, April 6, 2017 5:47 AM

    It seems you have an issue with duplicate records for PartNum, DueDate, Quantity).

    This should do...

  • RE: Running Total

    Thom A - Thursday, April 6, 2017 5:03 AM

    Always ensure you test your code before posting it. For your dates, you are...

  • RE: CTE Recursive Query

    Steve:

    Would you be available for a remote session in a couple of hours or some other time suitable for yourself - possibly a TeamViewer session.

    I can...

  • RE: CTE Recursive Query


    IF OBJECT_ID('TempDB..#mytable','U') IS NOT NULL DROP TABLE #mytable
    CREATE TABLE #mytable (
    ParentWO varchar(50),
    PProduction_Qty float,
    PQty_Complete float,
    ChildWO varchar(50),
    IssueQty int,
    Production_Qty float,
    Qty_Complete float)
    INSERT INTO...

  • RE: CTE Recursive Query

    Steve

    Unfortunately Child Work Orders will be produced and issued to more than one Parent Work Order - the thoughts behind this is that some Child Manufactured Parts are...

Viewing 15 posts - 16 through 30 (of 32 total)