SqlShare.com Logo
 
Skip Navigation Links
Home
Video List
Events
Classes
About Us
Login / Register
Subscribe RSS Feed 

Idera SQL Check

Get The Definition of a SQL Object Using Object_Definition

The Object_Definition function is easy to use, just pass in an object id and you get back the text of the stored procedure, trigger, function, or check constraint that you need to examine. Don't happen to remember the object id? We'll show you how to combine the Object_ID function with Object_Definition to get the answer fast!

Duration:
2 mins 16 secs
Skill Level:
100
Rating:
4.20 out of 5
Publish Date:
November 28, 2010
Get The Definition of a SQL Object Using Object_Definition You must be logged in to view this video.  
Bookmark and Share
 
1=Poor, 3=Good, 5=Excellent

About the Author

Image of Andy Warren
Andy Warren is a software trainer focusing on SQL Server, a member of the PASS Board of Directors, and a principal in this site - SQLShare.com.

References



Comments
anand on 12/1/2010
Ver good insight into day to day usage functions.

Jamshid Nouri on 12/1/2010
excellent

Joyce Scarlatelli on 12/1/2010
I wish there was a way to do a copy/paste of his example

Rosa on 12/1/2010
the functions didnt work on at least one of my objects when i tested it.

6361C28F3B on 12/1/2010
no audio

Nilesh on 12/1/2010
nice

Nilesh on 12/1/2010
nice

Nilesh on 12/1/2010
nice

Bridget on 12/1/2010
couldn't read output pane due to font size

Rod on 12/1/2010
I never knew about the object_id() function, nor the object_definition() function. Thanks!

Brent Wells on 12/1/2010
I like it

7727CACFEB on 12/1/2010
short and concise

Kenneth Wymore on 12/1/2010
Nice! Good to know

Kenneth Wymore on 12/1/2010
I tried it out on a large stored proc and it only returned the first 10 lines and quit part way through a section of comments. Are there known limitations to what definitions this will work on?

Steve Jones on 12/1/2010
Short, sweet, a nice trick that's quicker than using the object explorer in most cases.

Kenneth Wymore on 12/1/2010
Nevermind on my second comment. Appears that my text output options were set to show a limited number of data. I tried it with column output and it gave the full definition.

Dana on 12/1/2010
Can't think of a use for this.

John on 12/1/2010
Nice to know, but why wouldn't you simply right click and open object as modify in a new window??????

John on 12/1/2010
Nice to know, but why wouldn't you simply right click and open object as modify in a new window??????

Can it be used on a linked server?

Larry Fox on 12/1/2010
How can I get the object defn for a Table or View?

Margie on 12/2/2010
Really couldn't read the txt out put but good information all the same

kollu on 12/2/2010
sp_helptext is more useful than OBJECT_DEF if u know OBJECT Name , if u dontknow object name tats a diff case but generally w know name .

kalapala baburao on 12/4/2010
good

Olu on 12/7/2010
Very Good - but the volume was too low

ravi on 4/17/2011
nice

Maurice Ivory on 6/17/2011
This one was cool, but now I don't any use for this code.

MohanD on 12/10/2011
Good one



Must Be Logged In
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions