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
/****************************************************************************************************************************/ | |
/* Source Article: */ | |
/* http://www.sqlservercentral.com/blogs/glennberry/2009/10/29/suggested-max-memory-settings-for-sql-server-2005_2F00_2008/ */ | |
/****************************************************************************************************************************/ | |
-- Turn on advanced options | |
EXEC sp_configure'Show Advanced Options',1; | |
GO | |
RECONFIGURE; | |
GO |
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
-- StackOverflow Discussion: | |
-- http://stackoverflow.com/questions/2675168/get-the-unique-constraint-columns-list-in-tsql | |
SELECT TC.CONSTRAINT_NAME, | |
CC.COLUMN_NAME, | |
TC.TABLE_NAME | |
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC | |
INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE CC | |
ON TC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME | |
WHERE TC.CONSTRAINT_TYPE = 'Unique' | |
ORDER BY TC.Constraint_Name; |
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
--Source Discussion: https://community.spiceworks.com/topic/131997-sql-copy-field-in-to-smaller-field | |
--Author: Jason Crider - https://twitter.com/jasoncrider | |
--Get MaxLength on all columns in a table | |
DECLARE @SQL VARCHAR(MAX) | |
DECLARE @TableName sysname | |
SET @TableName = 'INSERT_TABLENAME_HERE' |
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
/// <summary> | |
/// Extension Metion to verify that a Generic List is not NULL or Empty | |
/// </summary> | |
/// <typeparam name="T">List Type</typeparam> | |
/// <param name="source"><see cref="List"/> Source</param> | |
/// <returns><see cref="bool"/> (true/false)</returns> | |
public static bool IsNullOrEmpty<T>(this List<T> source) | |
{ | |
if (source != null && source.Any()) | |
{ |
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
var Person = new function () { | |
var _firstName = null; | |
var _lastName = null; | |
// Public Properties | |
this.FirstName = { | |
get: function () { | |
return _firstName; | |
}, | |
set: function (value) { |
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
<?xml version="1.0"?> | |
<configuration> | |
<!-- Disable Inheritance --> | |
<location path="." inheritInChildApplications="false"> | |
<system.web> | |
<compilation debug="false" /> |
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
"use strict"; | |
var ACME = {}; | |
ACME.Web = {}; | |
ACME.Web.UI = {}; | |
ACME.Web.UI.Customer = function () { | |
var FirstName, LastName, FullName; | |
FullName = function () { | |
return this.FirstName + " " + this.LastName; |
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
/** | |
* Vanilla CSS 1.0.2 | |
* http://cssreset.com | |
*/ | |
body { | |
font: 9pt/1.5em sans-serif; | |
} | |
pre, code, tt { | |
font: 1em/1.5em 'Andale Mono', 'Lucida Console', monospace; | |
} |
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
--Description: Delete Duplicate Records in SQL Server Keeping only One | |
--Author: Ben Thul | |
--Source: http://stackoverflow.com/questions/6025367/t-sql-deleting-all-duplicate-rows-but-keeping-one | |
--NOTE: A common use-case is that "foo, bar" are the group identifier and "baz" is some sort of time stamp. In order to keep the latest, you'd do ORDER BY baz desc) | |
WITH cte AS ( | |
SELECT[foo], [bar], | |
row_number() OVER(PARTITION BY foo, bar ORDER BY baz) AS [rn] | |
FROM TABLE | |
) |
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
--Constants in SQL Server | |
--Since SQL Server and T-SQL doesn't support the concept of | |
--Constants, this is one example of how to mimic the functionality. | |
--Source: http://stackoverflow.com/questions/26652/is-there-a-way-to-make-a-tsql-variable-constant | |
CREATE FUNCTION fnConstant() | |
RETURNS INT | |
AS | |
BEGIN | |
RETURN 2 |