O'Reilly logo

SQL Server 2012 with PowerShell V3 Cookbook by Donabel Santos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Extracting user-defined assemblies

In this recipe, we will extract user-defined assemblies and resave these back to the filesystem as DLLs.

Getting ready

We can use the SampleDB database that we used in the previous recipe, or you can substitute this with any database that is accessible to you that has some user-defined assemblies.

How to do it...

These are the steps to extract user-defined assemblies:

  1. Open the PowerShell console application by going to Start | Accessories | Windows PowerShell | Windows PowerShell ISE.
  2. Import the SQLPS module as follows:
    #import SQL Server module
    Import-Module SQLPS -DisableNameChecking
  3. First, we will create a bcp format file. Add the following script and run:
    $VerbosePreference = "Continue" $instanceName = "KERRIGAN" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required