Another variant that will give you the name is:
use mydatabase
go
select top 1 name, len(name) from sysobjects where type = 'U' order by len(name) desc
go
. . . Tom
Tom Zeblisky
Reuters
"Kamlesh A.
Sancheti" To: Meg Hardy <[Email Address Removed] "SQLDBA
<k.[Email Address Removed] (E-mail)" <[Email Address Removed]
ilent.com> cc:
Subject: RE: List all tables
05/16/2002
08:45 AM Header: Internal Use Only
Hi,
Use the query mentioned below
Select max(len(name)) from sysobjects where type = 'u'
This query will list down the max length of the user defined
table name.
Regards
Kamlesh
-----Original Message-----
From: Meg Hardy [mailto:[Email Address Removed] Thursday, May 16, 2002 3:36 PM
To: SQLDBA (E-mail)
Subject: List all tables
Hi There,
I am trying to write a script (or find an SP) that will list all the
tables
in my database (so that i can find out what is the longest tablename).
I
cant seem to find anything on BOL about it, do any of you out there know
of
anything?
Thanks!
Meg
**********************************************************************
DISCLAIMER
Any opinions expressed in this email are those of the individual and not
necessarily of Mondial Assistance (UK) Ltd. This email and any files
transmitted with it, including replies and forwarded copies (which may
contain alterations) subsequently transmitted from the Company, are
confidential and solely for the use of the intended recipient. If you
are not the intended recipient or the person responsible for delivering
to the intended recipient, be advised that you have received this email
in error and that any use is strictly prohibited.
If you have received this email in error please notify the IT support
desk by telephone on +44 (0)208 2393984 or via email to
[Email Address Removed] including a copy of this message.
Please then delete this email and destroy any copies of it. Thank you.
Mondial Assistance (UK) Ltd
Mondial House
102 George Street
Croydon
CR9 1AJ
Mondial Assistance (UK) Ltd Registered in England No.1710361
Registered office as above
**********************************************************************
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: mssqldba-[Email Address Removed] additional commands, e-mail: mssqldba-[Email Address Removed] Visit our Internet site at http://www.reuters.com
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Reuters Ltd.
MS Sql Server LazyDBA home page