This file contains hidden or 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 * | |
FROM sys.columns | |
WHERE object_id = OBJECT_ID(N'[dbo].[Person]') | |
AND name = 'ColumnName' | |
) | |
ALTER TABLE dbo.Person | |
ADD ColumnName VARCHAR(64) |
This file contains hidden or 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 STATISTICS IO ON; | |
SET STATISTICS TIME ON; |
This file contains hidden or 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 @tableName VARCHAR(256); | |
SET @tableName = 'dbo.ct_pstor'; | |
SELECT name AS Stats, | |
STATS_DATE(object_id, stats_id) AS LastStatsUpdate | |
FROM sys.stats | |
WHERE object_id = OBJECT_ID(@tableName) | |
and left(name,4)!='_WA_'; |
This file contains hidden or 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 * FROM sys.indexes WHERE object_id = object_id('schema.tablename') AND NAME ='indexname') | |
DROP INDEX indexname ON SCHEMA.tablename; |
This file contains hidden or 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 Invoke-SQL { | |
param( | |
[string] $dataSource = $(throw "Please specify a datasource."), | |
[string] $database = $(throw "Please specify a database."), | |
[string] $sqlCommand = $(throw "Please specify a query.") | |
) | |
$connectionString = "Data Source=$dataSource; " + | |
"Integrated Security=SSPI; " + | |
"Initial Catalog=$database" |
This file contains hidden or 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 | |
ROW_NUMBER() OVER (ORDER BY ct_id) AS row_num, | |
ROW_NUMBER() OVER (PARTITION BY source_id ORDER BY ct_id) AS partitioned_row_num, | |
RANK() OVER (ORDER BY ct_id) AS row_num, | |
RANK() OVER (PARTITION BY source_id ORDER BY ct_id) AS partitioned_row_num | |
FROM | |
ct_pstor |
This file contains hidden or 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
find: | |
({........-....-....-....-............}) | |
replace: | |
\L$1 |
This file contains hidden or 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
update-package Newtonsoft.Json -reinstall |
This file contains hidden or 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
@Html.DropDownListFor(model => model.Status, Status.GetValues(typeof(Status)).Cast<Status>().Select(v => new SelectListItem | |
{ | |
Text = WebAdministration.Classes.Helpers.SplitCamelCase(v.ToString()), | |
Value = ((int)v).ToString() | |
}).ToList(), new { @class = "form-control" }) | |
/// <summary> | |
/// Takes a camel case string and splits it | |
/// </summary> |
This file contains hidden or 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
$.ajax({ | |
contentType: 'application/json', | |
dataType: 'html', | |
type: 'GET', | |
async: true, | |
cache: false, | |
url: url, | |
success: function(result) { | |
}, | |
error: function() { |