I have a (SQL Server) column which has a System Type but no Data Type (it is actually more then one) and this causes me problems when using the JDBC drivers on this column - it doesn't show up. I'm trying to understand what this means.
- Can someone explain what the difference is between System Type and Data Type?
- What does it mean that a column is missing a Data Type?
To create a Table which doesn't display a Data Type. This demands that you create a user which haven't read access to the user defined Data Types. This is how can reproduce it:
CREATE TYPE TEST_TYPE2 FROM [int] NOT NULL
GO
CREATE TABLE Customer
(
CustomerID INT IDENTITY(1,1) NOT NULL,
LastName VARCHAR(100) NOT NULL,
FirstName VARCHAR(100) NOT NULL,
ZIP TEST_TYPE2 NOT NULL
)
GO
-- Create Table without UDDT
CREATE TABLE Customer_Orig
(
CustomerID INT IDENTITY(1,1) NOT NULL,
LastName VARCHAR(100) NOT NULL,
FirstName VARCHAR(100) NOT NULL,
ZIP INT NOT NULL
)
GO
-- Create User with db_datareader to database
USE [master]
GO
CREATE LOGIN testUser WITH PASSWORD=N'THE_PASSWORD',
DEFAULT_DATABASE=[master],
CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE TEST_DATABASE
GO
CREATE USER testUser FOR LOGIN testUser
GO
USE TEST_DATABASE
GO
EXEC sp_addrolemember N'db_datareader', N'THE_PASSWORD'
GO