How to Retrieve the Structure of DataBase
-
Hello. I want to retreive the structure of database... Rquirement is : when i select the table name, it should give the details of tables like the columns it contains, rows etc in which database it is present et c
Aswini
SQL ~ Execute this T-SQL to get the columns of your table..
SELECT column_name FROM information_schema.columns WHERE table_name = @table_name AND table_schema = @owner_name ORDER BY ordinal_position
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) "Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
-
Hello. I want to retreive the structure of database... Rquirement is : when i select the table name, it should give the details of tables like the columns it contains, rows etc in which database it is present et c
Aswini
there are few system stored procs that returns the inforamtion about the database objects. take a look at those.
sp_databases sp_tables sp_columns
- Regards -
JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.