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 |
OldMySQLUser
Constraint Violating Yak Guru
301 Posts |
Posted - 2008-12-02 : 06:36:32
|
How can I print out all the tables in a database so that each is on a separate line?I have:use myDatabaseexecute sp_MSforeachtable 'PRINT ''?'''but I am not sure how to add the CR/LF |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-12-02 : 06:48:56
|
The PRINT command takes care of that! E 12°55'05.63"N 56°04'39.26" |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-12-02 : 06:50:09
|
Or you want a resultset with the table names?SELECT QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)FROM INFORMATION_SCHEMA.TABLES E 12°55'05.63"N 56°04'39.26" |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-02 : 06:56:28
|
if you want to exclude views,SELECT QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)FROM INFORMATION_SCHEMA.TABLESWHERE TABLE_TYPE='BASE TABLE' |
|
|
|
|
|