Quality and Speed of SQL Query [closed] - sql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I want to know how much first query effect to speed of query or server
Consider we have 50K request during one minute .
First query:
SELECT CONVERT(NUMERIC(13,1), ROUND(width, 1, 1)) FROM Home
.
And for second query we use round on client side, it means combination of client and server side
SELECT width FROM Home

You could use a tool such as SQL Query Stress to put a load on your server. This will allow you to simulate as many users as you want to execute the query as many times as you like;
http://www.sqlstress.com/
You could then use a tool such as Brent Ozar's fantastic sp_AskBrent to get some important metrics out of the system.
https://www.brentozar.com/askbrent/
Ultimately it's going to be down to you to see how your server performs in each instance and make a decision on which route to go down.

Related

How to delay all queries for a specified timespan? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I'd like to delay all the queries I receive in my test database for a specified amount of time. My intent in doing this is to test the "loading" feature in my program. I do not want to alter my queries though! WAITFOR doesn't work for me. If possible, the ideal would be to delay all the queries of a specific connection.
Summarizing: I'd like to delay all the queries of my database via some kind of configuration.
How to do that in SQL Server?
To the best of my knowledge, this is not an out-of-the-box feature.
Most people who want to test their data access code write specific test cases to do that. Again, there are lots of different scenarios; the closest to what you describe would be to capture all the requests going to your server, and then write a harness to replay those queries under test conditions.
Is it really needed? And is there a way to put a delay on the code level? I mean do something like this before the database request.
Thread.Sleep(milliseconds);

How to go about scraping and writing a script for an Oracle database [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
My manager has asked me to write a program that pulls data from a database that I have access to (it's an Oracle database and I'm using SQL developer). The idea is to get the data they want and put into an excel sheet in a way they would like. I haven't really wrote scripts before nor have I ever wrote a scraper, I was wondering what the first step is here and what resources I should use to get started? I have a couple of weeks to do this but I don't really know where to start.
I would start with an SQL query to find the data your manager wants. If you got the right result on screen, just right-click into the query result, select 'Export', and format= Excel...

Get estimated execution time during design phase [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am going to develop some business logic. During requirement phase, I need to provide SLA.
Business always want everything in less than second. Some time it is very frustatung also.They are not bothered about complexity.
My DB is SQL server 2012 and transaction DB.
Is there any formula which will take number of tables, columns etc and provide estimate?
No, you won't be able to get an execution time. Not only do the # of tables/joins factor in, but how much data is returned, network speed, load on the server, and many other factors. What you can get is a Query plan. SQL Server generates a query plan for every query it executes. And the execution plan will give you a "cost" value that you can use as a VERY general guideline about the query's performance. Check out these two links for more information...
1) this is a good StackOverflow question/answer.
2) sys.dm_exec_query_plan

Apply Database Changes after edit SQL Server [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a DataBase SQL , I did some changes in tables and datatype of this data base
but this data base contains data
I used a select Insert statement from the old database to the new one after edit
Is it the best way to bring he data to the new database or I can use better way ??
It depends why you are doing it and when.
If you are doing this as a one off process on your development machine and there is only a small number of simple tables then this approach will be fine
If you are doing it for a larger number of tables, need it to be re-runnable or want a GUI then use SSIS or "SQL Server Import and Export Wizard". It's easy to use.

Store a temporary table and update it every hour [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have never done this before, and I'm not sure if it is possible. Basically, I have a big query that takes around 1-2 minutes to run. What I'd like to do is:
automatically execute and put result into a table every hour.
My webpage will then query against the temporary table instead, which should be quicker.
I am looking for the steps to do this like. First, create a stored procedure. Second, setup somewhere to run the store procedure automatically. I'm not sure how to proceed — can you suggest how?
SQL server supports running scheduled jobs. You can look here.
http://technet.microsoft.com/en-us/library/ms190268%28v=sql.100%29.aspx
Also check this question, it should give you
a very good idea of the steps you need to take.
How to run a stored procedure in sql server every hour?