Question

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!

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top