SQLTeam.com | Weblogs | Forums

Table invalid after created

i access my db from another PC in my home network, works normally, but i have created a new table:

USE [CASA]
GO
 
/****** Object:  Table [dbo].[ITEM]    Script Date: 11/17/2022 09:18:37 ******/
SET ANSI_NULLS ON
GO
 
SET QUOTED_IDENTIFIER ON
GO
 
CREATE TABLE [dbo].[ITEM](
    [IDITEM_VINHOS] [int] NOT NULL,
    [ID] [int] NOT NULL,
    [DTHORA] [datetime] NULL,
 CONSTRAINT [PK_ITEM] PRIMARY KEY CLUSTERED 
(
    [IDITEM] 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

a simple select give the error "invalid object name.

select * from [Alan-PC\SQL].[CASA].[dbo].[ITEM] 

Is

select * from [dbo].[ITEM]

working?

SELECT @@SERVERNAME AS 'Server Name'

will give you the correct servername, the database looks fine. Hopes it helps.

@@SERVERNAME (Transact-SQL) - SQL Server | Microsoft Learn