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.full_name as table_name, c.column_name, case when c.system_type_id = 127 then 9223372036854775808/2 else 2147483648/2 end as seed_value | |
from sys_columns c | |
inner join sys_tables t on t.full_name = c.full_name | |
where c.is_identity = 1 and t.is_replicated = 1 | |
order by t.full_name | |
select 'DBCC CHECKIDENT(''' + t.full_name + ''', reseed, ' + cast(cast(2147483648/2 as int) as varchar) + ')' as reseed_command | |
,t.full_name as table_name, c.column_name, cast(2147483648/2 as int) seed_value | |
from sys_columns c | |
inner join sys_tables t on t.full_name = c.full_name |
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
// Evil if: | |
if (x == 1) { | |
if (x == 1.1) { | |
print("lorem ipsum 1.1") | |
} | |
else if (x == 1.2) { | |
print ("lorem ipsum 1.2") | |
} | |
else if (x == 1.3) { |
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
# Open IIS from command line | |
C:\Windows\system32>cd inetsrv | |
C:\Windows\System32\inetsrv>%systemroot%\system32\inetsrv\iis.msc | |
# Start and stop application pool | |
C:\Windows\System32\inetsrv>appcmd stop apppool /apppool.name:lorem-ipsum | |
"lorem-ipsum" successfully stopped | |
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
// This: | |
item.PickupId = (item.PickupId == null) ? headerRecord.PickupId : item.PickupId; | |
// Is the same as this: | |
if(item.PickupId == null) { | |
item.PickupId = headerRecord.PickupId | |
} else { |
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 @today datetime | |
set @today = CAST(convert(varchar, GETDATE(), 101) as datetime) | |
select | |
j.name as job_name, | |
run_datetime = CONVERT(DATETIME, RTRIM(run_date)) + | |
(run_time * 9 + run_time % 10000 * 6 + run_time % 100 * 10) / 216e4, | |
run_duration = RIGHT('000000' + CONVERT(varchar(6), run_duration), 6), * | |
from msdb..sysjobhistory h | |
inner join msdb..sysjobs j |
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
int n = 15; | |
for (int i = 1; i < n; i++) { | |
var button = GetButton(i); | |
buttton.Image = new Bitmap(@"..\..\Resources\DateButtons\" + buttton.Tag + ".png"); | |
} | |
private Button GetButton(int number) { | |
// this code gets and returns the button especified by number from its container. | |
} |
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
int myData = 20; | |
if(IsInTable(tableName: "A", data: myData)) { | |
print("data found in table A"); | |
} | |
else if (IsInTable(tableName: "B", data: myData)) { | |
print("data found in table B"); | |
} | |
else if (IsInTable(tableName: "C", data: myData)) { | |
print("data found in table C"); |
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
<pre class="brush:js; toolbar:false; auto-links:false;"> | |
$.ajax({ | |
url: "/Home/Index", | |
data: { email: email, username: username, etc: etc }, | |
success: function (data) { | |
debugger; // remove debugger before check-in. | |
$("#somelabel").text(data.SomeText); | |
}, | |
type: "POST", | |
dataType: 'json' |
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
CREATE TABLE [Clients] | |
( | |
ClientID int NOT NULL IDENTITY(1,1) CONSTRAINT [PK_Clients] PRIMARY KEY, | |
ServiceCode varchar(50) NOT NULL, | |
CONSTRAINT [UN_Clients_Unique] UNIQUE (ClientID, ServiceCode) | |
... | |
) |
NewerOlder