tags:

views:

38

answers:

1

Hi gang,

I'm new to Visual Studio's T4 template engine, and I'm wondering how I can use COM objects to build templates. Specifically, SQL-DMO (to generate classes from stored procedures on a SQL 2000 server, SNO is not an option).

Have any of you guys done this? Any tips?

<#@ import namespace="SQLDMO" #>

is not working.

Thanks!

A: 

You can use SMO 2008 with SQL Server 2000 (download here).

In order to use a COM object, you need to reference its primary interop assembly with use <#@ assembly #> directive first. If the assembly is not available, you can generate it with tlbimp.

Oleg Sych