Skip to content

Instantly share code, notes, and snippets.

@dalenewman
dalenewman / transformalize-provider-bogus.xml
Created March 2, 2018 13:45
a transformalize arrangement demonstrating the bogus provider
<cfg name="Bogus">
<connections>
<add name="input" provider="bogus" seed="1" />
</connections>
<entities>
<add name="Contact" size="5">
<fields>
<add name="Identity" type="int" />
ALTER DATABASE MyDatabase
SET ALLOW_SNAPSHOT_ISOLATION ON
ALTER DATABASE MyDatabase
SET READ_COMMITTED_SNAPSHOT ON
USE master
GO
-- you have to start procedure name with sp_ to make it global
CREATE PROCEDURE sp_log
@Message NVARCHAR(512),
@RowCount INT = null OUTPUT,
@Delimiter NCHAR(1) = N' ',
@PadChar NCHAR(1) = N'-'
AS
@dalenewman
dalenewman / SolrNetExtensions.cs
Created August 12, 2015 15:27
An Extension Method for SolrNet to stream CSV data from SOLR
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using HttpWebAdapters;
using SolrNet;
using SolrNet.Commands.Parameters;
using SolrNet.Impl;
@dalenewman
dalenewman / Set Statistics On and Off
Last active August 29, 2015 14:24
Checking Performance Statistics on Query - Microsoft SQL Server
SET STATISTICS IO ON;
SET STATISTICS TIME ON;
SET STATISTICS XML ON;
/* your query here */
SET STATISTICS IO OFF;
SET STATISTICS TIME OFF;
SET STATISTICS XML OFF;
@dalenewman
dalenewman / gist:6377911
Last active August 16, 2023 15:08
A T-SQL stored procedure for moving an index from one file group to another. The original script was found at http://blogs.msdn.com/b/ramoji/archive/2008/09/26/how-to-move-existing-indexes-from-one-filegroup-to-another.aspx and updated according to responses found on the same page.
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MoveIndexToFileGroup]') AND type in (N'P', N'PC'))
BEGIN
DROP PROCEDURE [dbo].[MoveIndexToFileGroup]
END
GO
CREATE PROC [dbo].[MoveIndexToFileGroup] (
@DBName sysname,
@SchemaName sysname = 'dbo',
@ObjectNameList Varchar(Max),