I am at a complete loss.
I have a database which is working fine on another machine. Several machines, actually. I used the tasks to script the entire DB (no data) so I could set it up on my new laptop. I have done this several times, never had a problem.
Here is the table definition script for one table:
/****** Object: Table [dbo].[UUT_RESULT] Script Date: 2022-07-05 18.12.41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UUT_RESULT](
[ID] [uniqueidentifier] NOT NULL,
[STATION_ID] [varchar](255) NULL,
[BATCH_SERIAL_NUMBER] [varchar](255) NULL,
[TEST_SOCKET_INDEX] [bigint] NULL,
[UUT_SERIAL_NUMBER] [varchar](255) NULL,
[USER_LOGIN_NAME] [varchar](255) NULL,
[START_DATE_TIME] [datetime] NULL,
[EXECUTION_TIME] [float] NULL,
[UUT_STATUS] [varchar](32) NULL,
[UUT_ERROR_CODE] [bigint] NULL,
[UUT_ERROR_MESSAGE] [varchar](255) NULL,
[PART_NUMBER] [varchar](255) NULL,
[TSR_FILE_NAME] [varchar](255) NULL,
[TSR_FILE_ID] [varchar](64) NULL,
[TSR_FILE_CLOSED] [bit] NULL,
[testName] [varchar](255) NULL,
[productionFlag] [bit] NULL,
[runTag] [varchar](255) NULL,
[testSystemPn] [varchar](32) NULL,
[testSwPn] [varchar](32) NULL,
[seqFileName] [varchar](255) NULL,
[fixtureId] [varchar](255) NULL,
[lot] [varchar](32) NULL,
[reportPrefix] [varchar](255) NULL,
[note] [varchar](max) NULL,
[tsReportName] [varchar](255) NULL,
[productionStage] [int] NULL,
[retest] [bit] NULL,
[failure_parameter] [varchar](255) NULL,
CONSTRAINT [UUT_RESULT_CONSTRAINT] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
This seems to have created perfectly correctly. And all those columns are listed in the tree on the left in SSMS.
Before any data was in there, I queried the tale with SELECT * and received back an empty set with all the columns.
Then I rant this insert...
INSERT INTO [UUT_RESULT]
(
[ID],
[STATION_ID],
[BATCH_SERIAL_NUMBER],
[TEST_SOCKET_INDEX],
[UUT_SERIAL_NUMBER],
[USER_LOGIN_NAME],
[START_DATE_TIME],
[EXECUTION_TIME],
[UUT_STATUS],
[UUT_ERROR_CODE],
[UUT_ERROR_MESSAGE],
[PART_NUMBER],
[TSR_FILE_NAME],
[TSR_FILE_ID],
[TSR_FILE_CLOSED],
[testName],
[productionFlag],
[runTag],
[testSystemPn],
[testSwPn],
[seqFileName],
[fixtureId],
[lot],
[reportPrefix],
[note],
[tsReportName],[productionStage],[retest],[failure_parameter])
VALUES
('5859E391-00D2-11ED-9D7B-00802F303F4B','ATE-3TX','',-1,'1209414900018','administrator','Jul 10 2022 9:28:49:000PM',1.655454089000000e+002,'Passed',0,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
And I got an error that the last three columns did not exist:
Msg 207, Level 16, State 1, Line 3
Invalid column name 'productionStage'.
Msg 207, Level 16, State 1, Line 3
Invalid column name 'retest'.
Msg 207, Level 16, State 1, Line 3
Invalid column name 'failure_parameter'.
AND When I query * again, they are not there any more!
- They are listed in the tree on the left
- They are created if I script the table creation
- They were there when I did the initial query (I have restarted the DB service)
- SSMS is underlining them as if they don't exist
- I have reconnected, restarted SSMS, etc.
What is going on here?!!