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
REM stop the IIS App Pool | |
%windir%\system32\inetsrv\appcmd stop apppool /apppool.name:DefaultAppPool | |
REM start the IIS App Pool | |
%windir%\system32\inetsrv\appcmd start apppool /apppool.name:DefaultAppPool |
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
-- it comes from this great post: http://sqlperformance.com/2012/07/t-sql-queries/split-strings | |
-- this way turns out not to be very efficient | |
CREATE FUNCTION dbo.SplitStrings_XML | |
( | |
@List NVARCHAR(MAX), | |
@Delimiter NVARCHAR(255) | |
) | |
RETURNS TABLE | |
WITH SCHEMABINDING | |
AS |
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
IF EXISTS ( SELECT 1 FROM sys.procedures WHERE name = 'spGenerateSqlStatement' ) | |
DROP PROCEDURE spGenerateSqlStatement | |
GO | |
CREATE PROCEDURE spGenerateSqlStatement | |
@TableName VARCHAR(256) | |
AS | |
-- TEST: spGenerateSqlStatement 'Message' | |
DECLARE @SqlStmt VARCHAR(MAX) | |
DECLARE @Fields VARCHAR(MAX) | |
DECLARE @Params VARCHAR(MAX) |
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
# usage: StartAppPool.ps1 -AppPoolName DefaultAppPool | |
# set-executionpolicy remotesigned | |
# Document of WebAdministration: | |
# https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/ee790599(v%3dtechnet.10) | |
# multiple parameters sample: param([string]$paramA,[string]$paramB) | |
param([string]$AppPoolName) | |
if ([string]::IsNullOrEmpty($AppPoolName)) | |
{ |
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
# usage: StopAppPool.ps1 -AppPoolName DefaultAppPool | |
# set-executionpolicy remotesigned | |
# Document of WebAdministration: | |
# https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/ee790599(v%3dtechnet.10) | |
# multiple parameters sample: param([string]$paramA,[string]$paramB) | |
param([string]$AppPoolName) | |
if ([string]::IsNullOrEmpty($AppPoolName)) | |
{ |
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
git fetch origin -np | |
$BranchesToDelete = New-Object -TypeName System.Collections.Generic.List[string] | |
$BranchList = (git branch -vv) | |
foreach ($Branch in $BranchList) { | |
if ($Branch.ToString().Contains(": gone]")) { | |
$BranchesToDelete.Add($Branch.ToString().TrimStart().Split(' ')[0]) | |
} | |
} |
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
ALTER FUNCTION [dbo].[fnGetCSharpTypeNameFromSQLTypeName] | |
( | |
@SQLTypeName NVARCHAR(64) | |
, @IsNullable BIT | |
) | |
RETURNS NVARCHAR(64) | |
AS | |
-- TEST: SELECT dbo.fnGetCSharpTypeNameFromSQLTypeName('MONEY', 1) | |
BEGIN | |
DECLARE @Result NVARCHAR(64) |
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
$(function () { | |
var prm = Sys.WebForms.PageRequestManager.getInstance(); | |
if (prm != null) { | |
prm.add_endRequest(function (sender, e) { | |
/* | |
if (sender._postBackSettings.panelsToUpdate != null) { | |
DisplayCurrentTime(); | |
} | |
*/ | |
// invoke whatever functions |
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
ALTER PROCEDURE [dbo].[spGenerateEntity] | |
@TableName AS NVARCHAR(128), | |
@NewDateTypes AS BIT = 0 | |
AS | |
SELECT CASE WHEN COLUMN_NAME = TABLE_NAME + 'Id' THEN '[Column("' + COLUMN_NAME + '")] | |
public ' ELSE 'public ' END | |
+ CASE DATA_TYPE WHEN 'int' THEN 'int' | |
WHEN 'money' THEN 'decimal' | |
WHEN 'varchar' THEN 'string' | |
WHEN 'datetime' THEN 'DateTime' |
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.*, PK.COLUMN_NAME | |
INTO #Tables | |
FROM INFORMATION_SCHEMA.TABLES T | |
INNER JOIN ( | |
SELECT TABLE_NAME, COLUMN_NAME | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE COLUMNPROPERTY(OBJECT_ID(TABLE_NAME), COLUMN_NAME, 'IsIdentity') = 1 | |
) PK ON PK.TABLE_NAME = T.TABLE_NAME | |
WHERE T.TABLE_TYPE = 'BASE TABLE' | |
AND T.TABLE_NAME NOT IN ( |
OlderNewer