Forum Replies Created

Viewing 15 posts - 7,876 through 7,890 (of 13,460 total)

  • RE: View with many tables and poor performance

    maybe thinking outside of the box can help;

    show us the original working query, and explain what you wanted to do that spawned the query you posted; might be a simpler...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL Select causes 100% CPU

    nick 13424 (3/23/2011)


    I just check the table and followup is a datetime column.

    Thank You

    ok if it is a datetime, isn't this selecting a date that is between , say...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL Select causes 100% CPU

    well, as an example of the OR, something like this might help...the three queries might be faster seperately than together...you'd have to test:

    SELECT [STUFF] FROM [...]

    WHERE (dbo.Notes.Completed = 0)...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL Select causes 100% CPU

    looking again, it looks like you have some fields that are varchar, but storing dates in them, hence your conversions.

    can you convert the columns to real datetime fields instead?

    if not,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL Select causes 100% CPU

    well, i can point to a few things that you might take under consideration:

    If you use LIKE '%..., it's a guaranteed table scan...that means every rows gotta be analyzed. that...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: View with many tables and poor performance

    at a glance? you should replace the queries with TWO CTE's

    you are joining the same tables over and over again (search for "_1" int e statement provided for examples)

    as...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Hierarchical List of All tables

    the # levels returned by any of our queries for hierarchys above can be more than the number of actual queries needed to delete from a parent table....it's very...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Linked Server problem

    Ray synonyms are Per Object, with an object being a Table, typically;

    so you need a synonym for each object coming from the linked server.

    so you create say , 4 synonyms...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Query Plans. Any way to store, retrieve, and execute?

    KermitTheRock (3/23/2011)


    Yeah, I know it sounds crazy that I want to "avoid" optimization. But if the data and tables and query have not changed from one day to the next,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Hierarchical List of All tables

    ok see if this is even close to what you are looking for;

    i'm assuming you need to generate the delete statements because you know a certain key must be deleted...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Hierarchical List of All tables

    you can build your tree based on the foreign keys, but the decision on what to do with rows of data containing FK references is still a business decision. Once...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: link server

    Tara the other person could be mapped to a remote user that has full access, and everyone else's connection made with no context; that way, everyone EXCEPT the people i've...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Monitoring databases

    ok answering my own question, I definitely do not want the serverproperty;

    what i foudn that since one of the first things SQL does on startup is create a new tempdb,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Monitoring databases

    ok I'm poking around trying to find what might be the most accurate server start time; I'm not sure the first date i find in the DMV's would be perfect..i'd...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Monitoring databases

    Based on that blog by Aaron, I put the script below together.

    My only issue is whether i'm using the right date for when the server was restarted...i was just assuming...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 7,876 through 7,890 (of 13,460 total)