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
# Not only have we been adding wands, but our users have been adding new ones daily! Lets create a list of all the unique wand makers in our database. | |
db.wands.aggregate( | |
{ | |
"$group": { | |
"_id": "$maker" | |
} | |
} | |
) |
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
using (WorkflowRuntime workflowRuntime = new WorkflowRuntime()) | |
{ | |
WorkflowInstance wfi = workflowRuntime.CreateWorkflow(typeof (WorkflowActivity), parameters); | |
wfi.Start(); | |
} |
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" encoding="utf-8" ?> | |
<configuration> | |
<system.diagnostics> | |
<switches> | |
<add name="DisableWorkflowDebugging" value="true"/> | |
</switches> | |
</system.diagnostics> | |
</configuration> |
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
Create table #yourcolumndetails(DBaseName varchar(100), TableSchema varchar(50), TableName varchar(100),ColumnName varchar(100), DataType varchar(100), CharMaxLength varchar(100)) | |
EXEC sp_MSForEachDB @command1='USE [?]; | |
INSERT INTO #yourcolumndetails SELECT | |
Table_Catalog | |
,Table_Schema | |
,Table_Name | |
,Column_Name | |
,Data_Type | |
,Character_Maximum_Length |
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 static ISomeInterface GetInstance(string record) | |
{ | |
var instances = from t in Assembly.GetExecutingAssembly().GetTypes() | |
where t.GetInterfaces().Contains(typeof(ISomeInterface)) | |
&& t.GetConstructor(Type.EmptyTypes) != null | |
orderby t.Name | |
select Activator.CreateInstance(t) as ISomeInterface; | |
return (from instance in instances |
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 [master] | |
GO | |
/****** Object: StoredProcedure [dbo].[sp_SearchStoredProcedures] Script Date: 05/17/2013 08:02:05 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
if exists (select * from sysobjects where id = object_id(N'[dbo].[sp_SearchStoredProcedures]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) | |
drop procedure [dbo].[sp_SearchStoredProcedures] |
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 [master] | |
GO | |
/****** Object: StoredProcedure [dbo].[sp_FindTablesIncludeSynonyms] Script Date: 05/17/2013 08:02:05 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
if exists (select * from sysobjects where id = object_id(N'[dbo].[sp_FindTablesIncludeSynonyms]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) | |
drop procedure [dbo].[sp_FindTablesIncludeSynonyms] |
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 NOCOUNT ON | |
GO | |
PRINT 'Using Master database' | |
USE master | |
GO | |
PRINT 'Checking for the existence of this procedure' | |
IF (SELECT OBJECT_ID('dbo.sp_generate_inserts','P')) IS NOT NULL --means, the procedure already exists | |
BEGIN |
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 [master] | |
GO | |
/****** Object: StoredProcedure [dbo].[sp_FindColumnsIncludeSynonyms] Script Date: 05/17/2013 08:02:05 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
if exists (select * from sysobjects where id = object_id(N'[dbo].[sp_FindColumnsIncludeSynonyms]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) | |
drop procedure [dbo].[sp_FindColumnsIncludeSynonyms] |
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 NOCOUNT ON | |
declare @tempTable table | |
( | |
TableSchema nvarchar(256), | |
TableName nvarchar(256), | |
ColumnName sysname | |
); | |
declare @sql nvarchar(4000); | |
declare @tableSchema nvarchar(256); |
NewerOlder