This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN TRANSACTION; | |
BEGIN TRY | |
-- ADD SQL QUERIES HERE | |
END TRY | |
BEGIN CATCH | |
SELECT | |
ERROR_NUMBER() AS ErrorNumber | |
,ERROR_SEVERITY() AS ErrorSeverity | |
,ERROR_STATE() AS ErrorState |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Re Index | |
EXEC sp_MSforeachtable "dbcc dbreindex('?', '')" | |
-- Update Stats | |
--EXEC sp_updatestats | |
-- or | |
EXEC sp_MSforeachtable "UPDATE STATISTICS ? WITH FULLSCAN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT OBJECT_NAME(ind.OBJECT_ID) AS TableName, | |
ind.name AS IndexName, | |
indexstats.index_type_desc AS IndexType, | |
indexstats.avg_fragmentation_in_percent , | |
CONCAT('ALTER INDEX [', ind.name, '] ON [', OBJECT_NAME(ind.OBJECT_ID), '] REBUILD') | |
FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, NULL) indexstats | |
INNER JOIN sys.indexes ind | |
ON ind.object_id = indexstats.object_id | |
AND ind.index_id = indexstats.index_id | |
WHERE indexstats.avg_fragmentation_in_percent > 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<httpRedirect enabled="true" destination="https://www.domainname.com$S$Q" exactDestination="true" httpResponseStatus="Permanent" /> | |
</system.webServer> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// This method will return a string with spaces inserted before the capitals (excluding the first character). | |
/// So, "ThisIsAString" will become "This Is A String" (hopefully) | |
/// </summary> | |
/// <param name="s">The string that you want to be nicely formatted</param> | |
/// <returns></returns> | |
public static string InsertSpaceBeforeCapitals(string s) | |
{ | |
char[] tmpTitleArr = s.ToCharArray(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tap on the Windows-key to go to the start screen interface if you are not already there. | |
Type gpedit.msc and select the first result from the list. | |
This opens the Local Group Policy Editor. | |
Navigate to the following folder: Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > SkyDrive | |
Locate "Prevent the usage of SkyDrive for file storage" and double-click on the entry. | |
Switch its state from "not configured" to "enabled" and click ok. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Try this: | |
git rm -r --cached . | |
git add . | |
git commit -am "Remove ignored files" | |
Remove all items from index. | |
git rm -r -f --cached . | |
Rebuild index. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM TABLE | |
where datetime >= Convert(datetime, '2014-01-17 00:00:01', 120) | |
AND datetime <= Convert(datetime, '2014-01-17 23:59:01', 120) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE master | |
GO | |
ALTER DATABASE YourDatabaseName | |
SET OFFLINE WITH ROLLBACK IMMEDIATE | |
GO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Simple table grid style:*/ | |
table.gridtable { | |
font-family: verdana,arial,sans-serif; | |
font-size:11px; | |
color:#333333; | |
border-width: 1px; | |
border-color: #666666; | |
border-collapse: collapse; | |
} |