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)
 where can I find the index of a function in my DB

Author  Topic 

asafg
Starting Member

39 Posts

Posted - 2009-01-08 : 03:47:52
Hi I cant find the index of a function

the order of the functions is not by name - its by some type of index that im looking for.

SELECT sc.name, sc.colid
FROM
myDB.dbo.SYSCOLUMNS sc
INNER JOIN
(
SELECT * FROM myDB.dbo.SYSOBJECTS
WHERE name = 'myTable'
) so ON sc.ID=so.ID
ORDER BY COLID

this one gives me the index of columns in a table - need the same for functions...

Thanks

raky
Aged Yak Warrior

767 Posts

Posted - 2009-01-08 : 04:05:48
Hi,

R u trying to find the objectid of a particular function ?? If so

u can use this

select name,object_id from sys.objects where type = 'fn' and name = 'functionname'
Go to Top of Page

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-01-08 : 04:12:30
select * from sys.objects where type = 'fn' order by modify_Date desc
Go to Top of Page

asafg
Starting Member

39 Posts

Posted - 2009-01-08 : 04:37:39
thanks raky no

Nageswar9 - I'm using Microsoft SQL management studio with 2005 - I guess you are using earlier version-
I want to have a select query that gives me a list of functions exactly in the order displayed in the management studio
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2009-01-08 : 04:45:55
quote:
Originally posted by asafg

thanks raky no

Nageswar9 - I'm using Microsoft SQL management studio with 2005 - I guess you are using earlier version-
I want to have a select query that gives me a list of functions exactly in the order displayed in the management studio



Hi use this

If u want in the same way as displayed in the management studio

select name,object_id from sys.objects where type = 'fn' order by name
Go to Top of Page

asafg
Starting Member

39 Posts

Posted - 2009-01-08 : 04:52:13
Thanks Raky - I didn't notice it is ordered by name :P
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2009-01-08 : 05:03:45
quote:
Originally posted by asafg

Thanks Raky - I didn't notice it is ordered by name :P



welcome....
Go to Top of Page
   

- Advertisement -