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
EXEC sys.sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE | |
GO | |
EXEC sys.sp_configure N'max server memory (MB)', N'2000' | |
GO | |
RECONFIGURE WITH OVERRIDE | |
GO | |
EXEC sys.sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE | |
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
SELECT | |
t1.resource_type, | |
t1.resource_database_id, | |
t1.resource_associated_entity_id, | |
t1.request_mode, | |
t1.request_session_id, | |
t2.blocking_session_id, | |
o1.name 'object name', | |
o1.type_desc 'object descr', | |
p1.partition_id 'partition id', |
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
WITH CTE (Colum1, Colum2, DuplicateCount) | |
AS | |
( | |
SELECT Colum1, Colum2, ROW_NUMBER() | |
OVER(PARTITION BY Colum1, Colum2 ORDER BY Colum1) AS DuplicateCount | |
FROM MyTable | |
WHERE Colum1 = 1 AND Colum2 IS NOT NULL | |
) | |
SELECT * FROM CTE | |
WHERE DuplicateCount > 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
----Force database into single user Mode | |
ALTER DATABASE db_name | |
SET SINGLE_USER WITH | |
ROLLBACK IMMEDIATE | |
----Restore Database | |
RESTORE DATABASE db_name | |
FROM DISK = 'D:\db_name.bak' | |
WITH REPLACE, | |
MOVE 'db_name' TO 'D:\SQLServer\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\db_name.mdf', |
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 MyDb | |
ALTER DATABASE MyDb SET RECOVERY SIMPLE | |
go | |
DBCC SHRINKFILE(MyDb) | |
DBCC SHRINKFILE(MyDb_log) | |
go | |
EXEC sp_helpdb MyDb | |
go | |
ALTER DATABASE MyDb SET RECOVERY FULL | |
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
dbcc freeproccache | |
go | |
dbcc dropcleanbuffers | |
go | |
DECLARE @a DATETIME, @b DATETIME | |
SET @a = CURRENT_TIMESTAMP | |
-- QUERY BIT | |
select * from | |
(select Row_Number() over (order by Id) as RowIndex |
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
public partial class App : Application | |
{ | |
protected override void OnStartup(StartupEventArgs e) | |
{ | |
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly; | |
} | |
} |
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 lastScreen = this.GetScreenFromRect(lastRect); | |
var newScreen = this.GetScreenFromRect(newRect); | |
if (!lastScreen.Bounds.Equals(newScreen.Bounds)) | |
{ | |
var x = (newRect.Left - newScreen.Bounds.X) + lastScreen.Bounds.X; | |
var y = (newRect.Top - newScreen.Bounds.Y) + lastScreen.Bounds.Y; | |
var width = newRect.Right - newRect.Left; | |
var height = newRect.Bottom - newRect.Top; | |
Window32API.MoveWindow(this.hWnd, x, y, width, height, 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
FullFileName = %1% | |
SplitPath, FullFileName, name, dir, ext, noext, drive | |
FileGetSize, Size, %FullFileName% | |
if (Size = 0) | |
{ | |
FileAppend, /* New File */, %FullFileName% | |
; HACK, zero byte files sadly default to the internal lister | |
} | |
SEND ^r | |
SEND %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
{"_index":"mpdreamz","_type":"blogs","_id":"10", "_source" : { | |
"id": 10, | |
"title": "YuwlQyGBD", | |
"body": "BQFSBpwAflRTUBoBESibOuMvCRnOjgIFjNqEbSsaRdUyOsOUOFcjldwHekqkchrzCLkGLJaLAiJLZoGkCsadDzUFrIArCHykLVVCiHIEfQIdTKHqDFhJGNvDrePdjjjSJzZeSDBvJvynQrmGAKnWaoDXaRLDsFVwhPtuKDxZDmalPiMZRICyVmSvVBeAsyCDZBFAXswWnntNosiRfLmjdxAvxXyIZWHFJwLoCLcZMFlitEhDTmVGLtAcbkDaTnWQFneRguptJmWxmscsQUpNbbTqVJMsicgZIUCFAPXZxCxZWdPIiljzyjPEtNVWhWKhFxORPwRAxpqyDuTsTekWShBzfyMnTASARPTZOySmTIcISrAzTDdCmoOYvpMRJEGwWPGoauDvlydJESgNxntqXPodAUezLbcpBFLdkmzZZHRolfuc", | |
"author": { | |
"firstName": "", | |
"lastName": "Holiman", | |
"dateOfBirth": "\/Date(-62135596800000+0100)\/", | |
"id": 0 | |
} |