My random rumblings

Something of everything and nothing at all

MS SQL EXEC into table

Use the following if you need to use the output of a stored procedure.

declare @t table(vbuNo bigint, thirdPartyId int, username varchar(512))

 

insert into @t

    exec proc_GetAVMVehicles

 

select distinct VbuNo from @t order by VbuNo

Strong Named PowerShell Type

Example on how to add a strongly typed Type in PowerShell

 

$Source = @"

using System;

 

public class SomeClass

{

public string SomeMethod

{

return "The result";

}

}

"@

 

$keyFile = "$((Get-Item -Path '.\' -Verbose).FullName)\deploy.snk"

$compilerParameters = New-Object System.CodeDom.Compiler.CompilerParameters

$compilerParameters.CompilerOptions = "/keyfile:$keyFile"

$compilerParameters.ReferencedAssemblies.Add("System.dll")

Add-Type -TypeDefinition $Source -Language CSharp -CompilerParameters $compilerParameters