PC Review


Reply
Thread Tools Rate Thread

dynamic columns in CLR table-valued-function

 
 
Frank Uray
Guest
Posts: n/a
 
      8th Oct 2008
Hi all

I think this question was discused quite often before.
But maybe some "good-brain" has a great idea ... :-)))

I have a DataSet with "unknown" columns.

The CLR Function should work like the normal TVF:
ALTER FUNCTION [dbo].[fncTest] ()
RETURNS TABLE
AS
RETURN
(SELECT * FROM sys.objects)

Any ideas or comments on that ??

Thanks and best regards
Frank Uray
 
Reply With Quote
 
 
 
 
Ciaran O''Donnell
Guest
Posts: n/a
 
      8th Oct 2008
There isnt a lot of information in your question to base an answer on. What
exactly is it you are trying to acheive and why do you want to use a SQLCLR
function to achieve it.?

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com


"Frank Uray" wrote:

> Hi all
>
> I think this question was discused quite often before.
> But maybe some "good-brain" has a great idea ... :-)))
>
> I have a DataSet with "unknown" columns.
>
> The CLR Function should work like the normal TVF:
> ALTER FUNCTION [dbo].[fncTest] ()
> RETURNS TABLE
> AS
> RETURN
> (SELECT * FROM sys.objects)
>
> Any ideas or comments on that ??
>
> Thanks and best regards
> Frank Uray

 
Reply With Quote
 
Duggi
Guest
Posts: n/a
 
      8th Oct 2008
On Oct 8, 8:26*am, Frank Uray <FrankU...@discussions.microsoft.com>
wrote:
> Hi all
>
> I think this question was discused quite often before.
> But maybe some "good-brain" has a great idea ... :-)))
>
> I have a DataSet with "unknown" columns.
>
> The CLR Function should work like the normal TVF:
> ALTER FUNCTION [dbo].[fncTest] ()
> RETURNS TABLE
> AS
> RETURN
> (SELECT * FROM sys.objects)
>
> Any ideas or comments on that ??
>
> Thanks and best regards
> Frank Uray


I think DataSet contains tables and table contains rows.

Please correct me if I am wrong.

-Cnu
 
Reply With Quote
 
Frank Uray
Guest
Posts: n/a
 
      8th Oct 2008
Hello

Maybe my question was not clear.

The goal is to create a SQL Function like:
SELECT *
FROM SqlFunction ('C:\temp\test.csv')

This function should give the .csv table based back.

The problem is:
Of corse, it is easy to create in the CLR a DataSet
with all the rows and columns.
But there is now way to have a CLR Function
with dynamic columns because I dont know
what columns are in the .csv.

I did it alrady with a SQL Procedure,
but in the case I always have to select
like: SELECT * FROM openquery(servername, 'EXEC TheStoredProcedure').

I hope this is more explaining.

Best regards
Frank


> "Frank Uray" wrote:
>
> > Hi all
> >
> > I think this question was discused quite often before.
> > But maybe some "good-brain" has a great idea ... :-)))
> >
> > I have a DataSet with "unknown" columns.
> >
> > The CLR Function should work like the normal TVF:
> > ALTER FUNCTION [dbo].[fncTest] ()
> > RETURNS TABLE
> > AS
> > RETURN
> > (SELECT * FROM sys.objects)
> >
> > Any ideas or comments on that ??
> >
> > Thanks and best regards
> > Frank Uray

 
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 a table-valued function of a linked SQL Server database Markus Eßmayr Microsoft Access External Data 2 30th Oct 2008 03:07 PM
Using a table-valued function of a linked SQL Server database Markus Eßmayr Microsoft Access 3 30th Oct 2008 03:07 PM
Using a table-valued function of a linked SQL Server database Markus Eßmayr Microsoft Access Queries 2 30th Oct 2008 03:07 PM
Calling a Table Valued MSSQL Function from C# Abhishek Srivastava Microsoft C# .NET 1 9th Oct 2003 02:43 PM
Calling a Table Valued MSSQL Function from C# Abhishek Srivastava Microsoft ADO .NET 0 9th Oct 2003 07:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:16 PM.