Skip to main content
added 15 characters in body; edited title; deleted 1 characters in body
Source Link
marc_s
  • 759.9k
  • 186
  • 1.4k
  • 1.5k

Retrieving SQL Server: retrieving data type length MSSQL

I am writing a basic DBMS package and I am trying to retrieve the column length. This is the query I am using to retrieve the infomation:

"SELECTSELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH   FROM INFORMATION_SCHEMA.Columns where WHERE TABLE_NAME = 'testVariables'"'testVariables' 

This works fine, no issues except for CHARACTER_MAXIMUM_LENGTH returns -1 all the time, When I use SQL managment toolsManagement Studio it says the column length is 16...

Any ideas?

Cheers, Joel

Retrieving data type length MSSQL

I am writing a basic DBMS package and I am trying to retrieve the column length. This is the query I am using to retrieve the infomation:

"SELECT COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH FROM INFORMATION_SCHEMA.Columns where TABLE_NAME = 'testVariables'" 

This works fine, no issues except for CHARACTER_MAXIMUM_LENGTH returns -1 all the time, When I use SQL managment tools it says the column length is 16...

Any ideas?

Cheers, Joel

SQL Server: retrieving data type length

I am writing a basic DBMS package and I am trying to retrieve the column length. This is the query I am using to retrieve the infomation:

SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH   FROM INFORMATION_SCHEMA.Columns  WHERE TABLE_NAME = 'testVariables' 

This works fine, no issues except for CHARACTER_MAXIMUM_LENGTH returns -1 all the time, When I use SQL Management Studio it says the column length is 16...

Any ideas?

Cheers, Joel

Source Link
JHarley1
  • 2.1k
  • 6
  • 25
  • 36

Retrieving data type length MSSQL

I am writing a basic DBMS package and I am trying to retrieve the column length. This is the query I am using to retrieve the infomation:

"SELECT COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH FROM INFORMATION_SCHEMA.Columns where TABLE_NAME = 'testVariables'" 

This works fine, no issues except for CHARACTER_MAXIMUM_LENGTH returns -1 all the time, When I use SQL managment tools it says the column length is 16...

Any ideas?

Cheers, Joel