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.
Author |
Topic |
jhaney
Starting Member
33 Posts |
Posted - 2012-01-12 : 15:10:39
|
I need to figure out how I can sample all of the tables in a database that I inherited. Unfortunately there is not data dictionary or documentation avaiable. Basically I woiuld like to select the top 10 or 20 rows from every table and or view in the database. Thanks for your help with this. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
X002548
Not Just a Number
15586 Posts |
|
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2012-01-12 : 18:26:32
|
same from sys.tablesselect 'select top 20 * from ' + name from sys.tables |
 |
|
jhaney
Starting Member
33 Posts |
Posted - 2012-01-13 : 07:25:08
|
Do I need to type out all of the table neames? Or will this select all of them? Thanks |
 |
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2012-01-13 : 08:08:21
|
sys.tables does not include views does it? I know that information_schema.tables does...If you run the code that tara gave you, it should give you what you wanted.http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
|
|