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 |
|
Rita Bhatnagar
Posting Yak Master
172 Posts |
Posted - 2002-04-08 : 12:29:52
|
| I have this query and it's working fine right now.Do you think i can get in trouble by usingINFORMATION_SCHEMA.Columns. We have set of tableswhere we have same kind of structure. But the lengthof second column is not same for all the tables.CREATE PROCEDURE qryFieldSize@TableName varchar(30),@Length int outputASSet @length=0set @Length= (select Character_maximum_Length fromINFORMATION_SCHEMA.Columns Where Ordinal_Position=2 and Table_Name=@TableName)select @length |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-04-08 : 12:38:35
|
| The INFORMATION_SCHEMA views are standardized as part of the ANSI SQL definitions. They are the most reliable way to get information on columns, tables, and such because of that. They are informational only, you cannot INSERT, UPDATE, or DELETE from an INFORMATION_SCHEMA view.The system tables that SQL Server uses are different from other products, and these system tables change from version to version, so that a query might not work in a future version (you're not querying system tables directly anyway, so this won't be an issue for you) |
 |
|
|
|
|
|