PC Review


Reply
Thread Tools Rate Thread

CLR integration and User Defined functions in SQL Server 2005

 
 
=?Utf-8?B?c2Fu?=
Guest
Posts: n/a
 
      19th Jul 2005
Hi,

I wanted to find out how one can get the query (the actual SQL statement) in
a TVF that is calling the said TVF?

Example:
select * from SOME_TVF() where blah...

SOME_TVF()
{

// Something like......
string query = GetCallingQuery()

//now query = "select * from SOME_TVF() where blah..."

}

Thanks,
Sandeep
 
Reply With Quote
 
 
 
 
Sahil Malik [MVP]
Guest
Posts: n/a
 
      19th Jul 2005
San,

A TVF comprises of two methods -

a) One that returns you an enumerator
b) Second that splits the enumerated rows into columns.

In order to find the SQL Query inside, simply decompile the TVF assembly
using Lutz Roeder's reflector. Note that it might not be a query, or maybe
not that straightforward, but you will be able to tell that once you look at
the decompiled code.


- Sahil Malik [MVP]
Upcoming ADO.NET 2.0 book - http://tinyurl.com/9bync
----------------------------------------------------------------------------
---------------

"san" <(E-Mail Removed)> wrote in message
news:3E1EAC72-47D7-4283-90DA-(E-Mail Removed)...
> Hi,
>
> I wanted to find out how one can get the query (the actual SQL statement)

in
> a TVF that is calling the said TVF?
>
> Example:
> select * from SOME_TVF() where blah...
>
> SOME_TVF()
> {
>
> // Something like......
> string query = GetCallingQuery()
>
> //now query = "select * from SOME_TVF() where blah..."
>
> }
>
> Thanks,
> Sandeep



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using User-defined Functions in VB.net 2005 NoviceProgramer Microsoft ADO .NET 0 13th Feb 2007 01:28 PM
Import SQL Server User-Defined Functions into Access 2002 =?Utf-8?B?Sm9zaA==?= Microsoft Access 6 27th Sep 2006 05:37 PM
[OT] User-Defined string Functions MS SQL Server 2005 T-SQL C# CLR =?Utf-8?B?SWdvciBOaWtpZm9yb3Y=?= Microsoft C# .NET 1 6th Jul 2006 04:20 PM
[OT] User-Defined string Functions MS SQL Server 2005 T-SQL CLR C# =?Utf-8?B?SWdvciBOaWtpZm9yb3Y=?= Microsoft C# .NET 0 11th Apr 2006 05:07 PM
Show user-defined comments for user-defined functions vinesh Microsoft VB .NET 2 2nd Nov 2004 01:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:52 AM.