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
SET NOCOUNT ON; | |
-- Declare local variables | |
DECLARE @NumberOfLoops AS int = (select count(*)/50000 from [Staging_Task]); | |
DECLARE @CurrentLoop AS int = 0 | |
WHILE @CurrentLoop < @NumberOfLoops | |
BEGIN |
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 | |
t.NAME AS TableName, | |
i.name as indexName, | |
sum(p.rows) as RowCounts, | |
sum(a.total_pages) as TotalPages, | |
sum(a.used_pages) as UsedPages, | |
sum(a.data_pages) as DataPages, | |
(sum(a.total_pages) * 8) / 1024 as TotalSpaceMB, | |
(sum(a.used_pages) * 8) / 1024 as UsedSpaceMB, | |
(sum(a.data_pages) * 8) / 1024 as DataSpaceMB |
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
-- Note: replace UserPrivilegeLevel = 3 with UserIsGlobalAdministrator = 1 for K9 and lower. | |
-- Sanitize Settings | |
UPDATE CMS_SettingsKey SET KeyValue = NULL WHERE KeyName in ( | |
'CMSAdminEmailAddress', -- Clear the Administrator email | |
'CMSUsePasswordPolicy', -- Clear the password policy | |
'CMSUseSSLForAdministrationInterface', -- Clear 'SSL for administration interface' | |
'CMSScreenLockEnabled', -- Clear screen lock feature | |
'CMSSMTPServer', -- Clear sending e-mails | |
'CMSDisableDebug' -- Clear 'Disable debugging' |
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
WITH cteHead (session_id,request_id,wait_type,wait_resource,last_wait_type, | |
is_user_process,request_cpu_time,request_logical_reads,request_reads, | |
request_writes,wait_time,blocking_session_id,memory_usage, | |
session_cpu_time,session_reads, session_writes,session_logical_reads, | |
percent_complete,est_completion_time,request_start_time,request_status, | |
command,plan_handle,sql_handle, statement_start_offset,statement_end_offset, | |
most_recent_sql_handle,session_status,group_id, query_hash,query_plan_hash) | |
AS | |
(SELECT sess.session_id, req.request_id, | |
LEFT (ISNULL (req.wait_type, ''), 50) AS 'wait_type', |
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
[user] | |
email = your_email | |
name = your_username | |
[alias] | |
# view your global git config Aliases from CLI | |
aliases = config --get-regexp '^alias\\.' | |
# git clone | |
cl = !git clone | |
# Git shallow clone for large repos | |
clq= !git clone --depth=1 |
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
<rewrite> | |
<rules> | |
<rule name="RedirectWwwToNonWww" stopProcessing="false"> | |
<match url="(.*)" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false"> | |
<add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" /> | |
</conditions> | |
<action type="Redirect" url="https://{C:2}{REQUEST_URI}" redirectType="Permanent" /> | |
</rule> | |
<rule name="Remove trailing slash" stopProcessing="true"> |
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
DECLARE @UName varchar(50) | |
DECLARE @PW varchar(50) | |
DECLARE @SQL varchar(400) | |
SET @UName='connection-string-user' | |
SET @PW='password' | |
SET @SQL='DROP USER IF EXISTS ['+@UName+'];'+ | |
' CREATE USER ['+@UName+'] WITH PASSWORD = '''+@PW+''', DEFAULT_SCHEMA = dbo;'+ | |
' GRANT VIEW DEFINITION TO ['+@UName+'];'+ | |
' EXEC sp_addrolemember ''db_owner'', '''+@UName+''';'+ | |
' ALTER ROLE db_owner ADD MEMBER ['+@UName+'];' |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication1 | |
{ | |
public static class Program | |
{ |
OlderNewer