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
 General SQL Server Forums
 New to SQL Server Programming
 Return Data Set from function

Author  Topic 

ds12will
Starting Member

21 Posts

Posted - 2009-11-05 : 10:21:01
Hello, I'm really new

When using a function, how do I use that function against a whole data set as opposed to just one data entity?

For example:
SELECT dbo.Timezone_Conversion('CST', 'GMT', WHERE DATA SELECT GOES, 0)

Data set (there are 10,000+ rows):
date_start
2004-09-24 10:07:00.000
2004-10-01 12:08:00.000
2004-10-13 13:20:00.000
2003-01-08 09:25:00.000
2004-08-23 00:23:00.000
2004-09-10 13:22:00.000
2004-09-24 10:07:00.000


how do I run function against that whole data set as opposed to just 1 peice of data?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-05 : 10:25:08
Do you mean this?
select
dbo.Timezone_Conversion('CST', 'GMT', date_start, 0)
from your_table


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-11-05 : 10:25:46
SELECT dbo.Timezone_Conversion('CST', 'GMT',date_start,0)
from dataset

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -