SQL Server Read ismore

  • yuvipoy (4/7/2014)


    Those are the existing codes.

    i need to modify them.

    Yes using dead lock will lead to incorrect reports.

    :hehe:

    I am not sure if this syntax is supported yet:

    SELECT * FROM TableName WITH (DEADLOCK)


    Sujeet Singh

  • Here is my table's sample data.

  • Here is my tables sample data.

  • Divine Flame (4/7/2014)

    I am not sure if this syntax is supported yet:

    SELECT * FROM TableName WITH (DEADLOCK)

    "DEADLOCK" is not a recognized table hints option in SQL Server.

    So which database you are telling this hint?

  • Lynn Pettis (4/7/2014)


    yuvipoy (4/7/2014)


    yes.

    inorder to hide my business process i have renamed the column.

    while pasting here i did not mention as b.column names for the columns.

    For execution plan since it is having

    Would help if you put data in your tables. Running the query against empty tables doesn't help us help you.

    yuvipoy

    Please, can you run the query against the actual production tables, take the resultant execution plan and do a find/replace over the XML to obfuscate the table names if necessary. Without the actual execution plan of the actual query which has the performance problem, we don't have a chance in hell of giving any useful assistance.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Tab_tadata.txt and plan.sqlplan.sql files are the table insert scipt and execution plans.

  • yuvipoy (4/7/2014)


    Divine Flame (4/7/2014)

    I am not sure if this syntax is supported yet:

    SELECT * FROM TableName WITH (DEADLOCK)

    "DEADLOCK" is not a recognized table hints option in SQL Server.

    So which database you are telling this hint?

    I was actually refering to your this statement:

    Yes using dead lock will lead to incorrect reports

    But no issues ;-).


    Sujeet Singh

  • Plase find tables.txt, plan.sqlplan.sql(executionplan), Tab_data.txt for inserting into tables.

    Hoping this information will help me in resolve the issue.

  • GilaMonster (4/7/2014)


    Please, can you run the query against the actual production tables, take the resultant execution plan and do a find/replace over the XML to obfuscate the table names if necessary. Without the actual execution plan of the actual query which has the performance problem, we don't have a chance in hell of giving any useful assistance.

    2 rows of data is completely inadequate to test performance on.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • yuvipoy (4/8/2014)


    Plase find tables.txt, plan.sqlplan.sql(executionplan), Tab_data.txt for inserting into tables.

    Hoping this information will help me in resolve the issue.

    In addition to what Gail said, you have been around long enough to know that you need to provide the sample data in a readily consumable format, in other words as a series of INSERT INTO statements for the tables involved.

    Also, the code you provided has some issues. One, it attempts to create a foreign key reference to TABLE4 which does not exist. Two, there are inconsistencies in the code that cause it to fail when run on a server/database using a case sensitive collation. If you define a column name as COL1 for example, you should consistently call that column COL1 through out your code regardless of the collation used on your server/database.

  • I have created insert script for tables.also added table4

    is this sufficient

  • is the information provided is sufficient

  • Last try...

    GilaMonster (4/7/2014)


    Please, can you run the query against the actual production tables, take the resultant execution plan and do a find/replace over the XML to obfuscate the table names if necessary. Without the actual execution plan of the actual query which has the performance problem, we don't have a chance in hell of giving any useful assistance.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • this is the execution plan i renamed my original tables and columns.

  • So the query, when run in production, returns 0 rows?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

You must be logged in to reply to this topic. Login to reply