Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Pass Column Name in CLR

Author  Topic 

javaguy5
Starting Member

9 Posts

Posted - 2008-07-18 : 21:40:06
Can someone help me with the syntax to pass a column name into a CLR function using visual basics. I know how to do it with the quotename in a sql stored procedure but the same syntax is not working in the CommandText code of the CLR in VB.net

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-19 : 01:42:46
You can grab the column names from the INFORMATION_SCHEMA view COLUMNS.

SELECT TABLE_NAME, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE ...

Now it's just a result set, so you can pass the information to your CLR object like any other data.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -