|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to get the defined size of nvarchar column (that of CREATE TABLE)?Is it possible to use SQL statement to determine the predefined
size (that was set during CREATE TABLE) of a nvarchar column? -- Regards, Pedestrian, Penang. Message posted via SQLMonster.com http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200608/1 Query INFORMATION_SCHEMA.COLUMNS.CHARACTER_MAXIMUM_LENGTH. For the
storage length see CHARACTER_OCTET_LENGTH. There is also syscolumns, or if using SQL Server 2005 sys.columns, but the INFORMATION_SCHEMA are more friendly and not so likely to change. Roy Harvey Beacon Falls, CT On Sat, 26 Aug 2006 00:05:06 GMT, "pedestrian via SQLMonster.com" <u16758@uwe> wrote: Show quote >Is it possible to use SQL statement to determine the predefined >size (that was set during CREATE TABLE) of a nvarchar column? For both SQL 2000 and SQL 2005, this should point you in a direction you want:
USE Northwind GO SELECT TABLE_NAME , COLUMN_NAME , IS_NULLABLE , DATA_TYPE , CHARACTER_MAXIMUM_LENGTH , NUMERIC_PRECISION , NUMERIC_SCALE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Employees' ORDER BY TABLE_NAME , ORDINAL_POSITION Choose only the characteristics you need from the above. -- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "pedestrian via SQLMonster.com" <u16758@uwe> wrote in message news:6551d7b38223f@uwe... > Is it possible to use SQL statement to determine the predefined > size (that was set during CREATE TABLE) of a nvarchar column? > > -- > Regards, > Pedestrian, Penang. > > Message posted via SQLMonster.com > http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200608/1 > Thanks Roy and Arnie for valuable answer....
-- Regards, Pedestrian, Penang. Message posted via SQLMonster.com http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200608/1 |
|||||||||||||||||||||||