SQL Server Management Studio: Invalid Columns

Julio Bello 221 Reputation points
2021-05-21T01:23:12.623+00:00

Hi, Everybody!

Can anyone PLEASE enlighten me as to WHY SQL Server Management Studio (v17.4) would flag the following columns as invalid?... The ones with the squiggly red underlines?

98386-select-top-1000-trackingdataid.png

Please see table definition below…

USE [TrackingService]  
GO  
  
/****** Object:  Table [dbo].[TrackingData]    Script Date: 5/20/2021 8:51:16 PM ******/  
SET ANSI_NULLS ON  
GO  
  
SET QUOTED_IDENTIFIER ON  
GO  
  
CREATE TABLE [dbo].[TrackingData](  
       [TrackingDataID] [bigint] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,  
       [Carrier] [nvarchar](10) NULL,  
       [EventCode] [nvarchar](10) NULL,  
       [EventDescription] [nvarchar](50) NULL,  
       [EventDateTimeUTC] [datetime] NULL,  
       [EventCity] [nvarchar](50) NULL,  
       [EventCountryCode] [nvarchar](2) NULL,  
       [EventCountry] [nvarchar](50) NULL,  
       [Mailbag] [nvarchar](50) NULL,  
       [FreightForwarder] [nvarchar](50) NULL,  
       [Hawb] [nvarchar](50) NULL,  
       [Mawb] [nvarchar](50) NULL,  
       [ItemID] [nvarchar](20) NULL,  
       [CustomerItemID] [nvarchar](20) NULL,  
       [DestinationCity] [nvarchar](50) NULL,  
       [DestinationState] [nvarchar](50) NULL,  
       [DestinationZip] [nvarchar](50) NULL,  
       [DestinationCountryCode] [nvarchar](50) NULL,  
       [DestinationCountry] [nvarchar](50) NULL,  
       [CustomerNumber] [char](10) NULL,  
       [ClientNumber] [nvarchar](20) NULL,  
       [ClientName] [nvarchar](50) NULL,  
       [MsiTrackingID] [nvarchar](20) NULL,  
       [VendorTrackingID] [nvarchar](20) NULL,  
       [FinalCarrierTrackingID] [nvarchar](20) NULL,  
       [FinalCarrierVendor] [nvarchar](50) NULL,  
       [FileID] [char](13) NULL,  
       [SendOutDateUTC] [datetime] NULL,  
       [CreatedDataTimeUTC] [datetime] NOT NULL,  
       [LgTrackID] [nvarchar](20) NULL,  
       [CaTrackID] [nvarchar](20) NULL,  
       [Bc] [nvarchar](50) NULL,  
CONSTRAINT [PK_TrackingData] PRIMARY KEY CLUSTERED   
(  
       [TrackingDataID] ASC  
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]  
) ON [PRIMARY]  
GO  
SQL Server Integration Services
Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
SQL Server | Other
{count} votes

1 answer

Sort by: Most helpful
  1. MelissaMa-msft 24,246 Reputation points Moderator
    2021-05-21T01:31:58.563+00:00

    Hi @Julio Bello ,

    Welcome to Microsoft Q&A!

    We have to refresh our cache after we create new tables/add columns/ new views and so on.

    You could try with Keyboard shortcut: Ctrl + Shift + R

    Or, using the menu: Edit -> IntelliSense -> Refresh Local Cache.

    I tested it in my own environment and it worked.

    Best regards,
    Melissa


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.