TBSupport
asked on
Looking for an Object in a SQL Database
Hello:
I'm trying to look for an object in a SQL database. I cannot tell if the object is a table, view, or stored procedure.
Is there a "select" script or something along those lines that I can run, to look for this object?
I'd rather not run anything that's going to create another object in SQL, unless doing so is easy and will not do any harm.
Thanks!
TBSupport
I'm trying to look for an object in a SQL database. I cannot tell if the object is a table, view, or stored procedure.
Is there a "select" script or something along those lines that I can run, to look for this object?
I'd rather not run anything that's going to create another object in SQL, unless doing so is easy and will not do any harm.
Thanks!
TBSupport
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
why not use this free tool from Red Gate: http://www.red-gate.com/products/sql-development/sql-search/
It will not only find the object but also all the references to it.
It will not only find the object but also all the references to it.
ASKER
Hello:
SQL is not pulling up any records, for this object, even though it exists according to a separate stored procedure.
Could it be an alias or something that I need to look for?
Thanks!
TBSupport
SQL is not pulling up any records, for this object, even though it exists according to a separate stored procedure.
Could it be an alias or something that I need to look for?
Thanks!
TBSupport
ASKER
Hello:
I just found out that it's a user defined function. How do I find it and the programming behind it?
TBSupport
I just found out that it's a user defined function. How do I find it and the programming behind it?
TBSupport
In SSMS, expand your database, than expand programmability, than Functions and you will find your UDF under one of the folder (depending on the type of UDF). You will then be able to right-click on it and select Modify to see the code behind
I just found out that it's a user defined functionUDFs should be returned by my query. How did you found out?
ASKER
Hi Vitor:
I believe that I right-clicked on the stored proc and viewed its dependencies, to find out.
TBSupport
I believe that I right-clicked on the stored proc and viewed its dependencies, to find out.
TBSupport
Good catch.
I usually don't use SSMS options so I didn't even know that option exists. I'm an old fashion guy that likes to type SQL commands :)
I usually don't use SSMS options so I didn't even know that option exists. I'm an old fashion guy that likes to type SQL commands :)
ASKER
Me, too! :)
TBSupport
TBSupport
You can use:
EXEC sp_helptext 'name'
to get the text for objects that have text.
You can use:
EXEC sp_help 'name'
to get info about any object in the db.
EXEC sp_helptext 'name'
to get the text for objects that have text.
You can use:
EXEC sp_help 'name'
to get info about any object in the db.
You can use this query
select * from sys.objects where name = 'Your Value'
and the column type_desc will let you know it is a table or proc etc.