C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Get List of Columns,views,Tables,function........


Posted Date: 10 Sep 2008    Resource Type: Code Snippets    Category: SQL

Posted By: Lakhan Pal       Member Level: Gold
Rating:     Points: 10




/* Query To Get The Column Name,DataType, And Length of columns in a Table */

select column_name, data_type, character_maximum_length from information_schema.columns
where table_name = <Table Name>

/* Query to Get List of Views */
select * from information_schema.views

/* Query to Get List of Tables */
select * from information_schema.Tables

/* Query to Get List of System Tables */
select * from Sys.Objects where Type='s'


/* Query to Get List of User Tables */
select * from Sys.Objects where Type='u'

/* Query to Get List of Store Procedures */
select * from Sys.Objects where Type='p'

/* Query to Get List of Scalar Functions */
select * from Sys.Objects where Type='fn'

/* Query to Get List of Table Valued Functions */
select * from Sys.Objects where Type='tf'

/* Query to Get List of Primary Keys */
select * from Sys.Objects where Type='PK'

/* Query to Get List of Unique Keys */
select * from Sys.Objects where Type='uq'

/* Query to Get List of Forgien Keys */
select * from Sys.Objects where Type='f'

/* Query to Get List of views */
select * from Sys.Objects where Type='v'

/* Query to Get List of Triggers*/
select * from Sys.Objects where Type='tr'

/* Query to Get List of Internal Tables*/
select * from Sys.Objects where Type='it'





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Views  .  Triggers  .  Tables  .  Store Procedures  .  Primary Key  .  Functions  .  Forgien Key  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Use of new Rank() function in SQL sever 2005
Previous Resource: To find the second highest record from database
Return to Discussion Resource Index
Post New Resource
Category: SQL


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

silicone halloween mask

Contact Us    Privacy Policy    Terms Of Use