We use optional cookies to improve your experience on our websites, such as through social media connections, and to display personalized advertising based on your online activity. If you reject optional cookies, only cookies necessary to provide you the services will be used. You may change your...
I have a large database. I removed almost half of the data/rows. Now i need to reduce the size of the database file as I need more disk space for the database file.What should I do in details please.Thanks.All replies (3)
How to calculate Median in SQL Server Nothing earth-shattering here, I was just helping out a colleague with this so I thought I'd post up the example I gave him. -- sample table: create table People ( Person varchar(1) primary key, City varchar(10), Age int ) go -- with some ...
SQL Server does not have a specific function to calculate mode. However, there are several workarounds to find the mode of the given data set in SQL Server. Let us see one of the workarounds which I am using for my projects. Create table and data set For this illustration, to start ...
Here is one another simple way to calculate median using the PERCENTILE_CONT function introduced in SQL Server 2012.
Step 1: Calculate the total number of days between a date range In this step, we use the DAY interval within the DATEDIFF function to determine the number of days between two dates. The output of this calculation is stored in the @TotDays variable, as shown in Script 3. 1 2 3 4 ...
But now if you want to change this example to calculate a different first day of the week like “First Tuesday of the Week” you can change the set command above to “set DATEFIRST 2”. First Day of the Year Now I use the year interval (yy) to display the first day of the year....
Indexes are not just another type of database object, because they can be also considered as a query performance optimization method, if they are created and used properly. In this article, the focus will be on how to monitor SQL Server indexes size. ...
stopping you making some up. It might not be super realistic, but it gives us something to ...
Determine the space that is currently used intempdbby using thesp_spaceusedstored procedure. Then, calculate the percentage of free space that is left for use as a parameter toDBCC SHRINKDATABASE. This calculation is based on the desired database size. ...