First day and last day of a week
This scripts calculates the first day and the last day of a given week
2015-11-10 (first published: 2015-10-12)
1,171 reads
This scripts calculates the first day and the last day of a given week
2015-11-10 (first published: 2015-10-12)
1,171 reads
Get FirstDate and LastDate of Every month from two Dates.
Like IF we have @date1='05/02/2015' and @date2= '11/25/2015' then we will get list of first date and last date from month 5 to 11.
SELECT ID,FirstDate,LastDate,Month,Year FROM [GetFLDatelist](@date1,@date2)
2015-11-09 (first published: 2015-10-09)
1,283 reads
When you want gain exclusive access to database in order to restore database
2015-11-06 (first published: 2015-10-14)
1,948 reads
Rebuild index is expensive most time. So you don't rebuild all index blindly.
2015-11-04 (first published: 2015-10-05)
1,848 reads
The script uses dynamic SQL twice
first to get the detail about the database structure and create ddl out of it
second to execute each DDL created
2015-11-03 (first published: 2015-10-07)
977 reads
How to Paginate a query result set to keep from pulling the whole result set to the client side
2015-11-02 (first published: 2014-05-05)
3,724 reads
A set of queries which attempt to gather as much security-related information on a single database as possible.
2015-10-30 (first published: 2013-10-24)
5,715 reads
Provide list of Stored Procedures that have been changed in past 7 days.
2015-10-29 (first published: 2013-04-11)
3,592 reads
2015-10-27 (first published: 2014-07-08)
4,399 reads
2015-10-23 (first published: 2014-05-13)
3,742 reads
By Steve Jones
I recently started playing with the MCP Server for SQL Server, which is a...
If you spend your days tuning queries, managing pipelines, or keeping a production database...
I’ve been rebuilding my three-site SQL Server demo lab, and I ran into something...
Has anyone written a wrapper function (or similar) around STRING_AGG() to allow the retrieval...
Putting this here as we're currently on SQL Server 2019 installed on Windows Server...
Comments posted to this topic are about the item Never is Not the Policy
I have added a few indexes to one of my tables in SQL Server 2025:
ALTER TABLE dbo.CustomerContact
ADD CONSTRAINT PK_CustomerContact
PRIMARY KEY (CustomerID);
-- Create index on CustomerEmail
CREATE INDEX IX_CustomerContact_CustomerEmail
ON dbo.CustomerContact (CustomerEmail);
CREATE INDEX IX_CustomerContact_CustomerPhone
ON dbo.CustomerContact (phone);
I then do this to disable one index:
alter index IX_CustomerContact_CustomerPhone on dbo.CustomerContact disableI see this when I check the index status:
I decide to rebuild all indexes with this command:
ALTER INDEX ALL ON dbo.CustomerContact rebuildAfter I do this, what will I see for the index status? See possible answers