0

My Table structure is like this

    CREATE TABLE [dbo].[tdnResetTickets](
    [ResetID] [int] IDENTITY(1,1) NOT NULL,
    [userName] [varchar](200) NULL,
    [tokenHash] [nvarchar](200) NULL,
    [expirationDate] [datetime] NULL,
    [tokenUsed] [bit] NULL,
    [tokenType] [bit] NULL,
 CONSTRAINT [PK_tdnResetTickets] PRIMARY KEY CLUSTERED 
(
    [ResetID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

And I want to update a column in that table. My query is like this

UPDATE [dbo].[tdnResetTicket] SET [tokenUsed] = 0  WHERE ResetID =1

And it throws an error

    Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.tdnResetTicket'.

Can anyone point out what I am doing wrong here?

1
  • Are you selecting the right database? Commented Dec 13, 2016 at 7:48

3 Answers 3

2
UPDATE [dbo].[tdnResetTickets] SET [tokenUsed] = 0  WHERE ResetID =1

The Table is tdnResetTickets with s and Update Query is tdnResetTicket

Sign up to request clarification or add additional context in comments.

Comments

2

The Table is tdnResetTickets with s and Update Query is tdnResetTicket

Correct Code:

UPDATE [dbo].[tdnResetTickets] SET [tokenUsed] = 0  WHERE ResetID =1

Comments

-1

Table name is incorrect in update statement.

UPDATE [dbo].[tdnResetTickets] SET [tokenUsed] = 0 WHERE ResetID =1

2 Comments

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review
UPDATE [dbo].[tdnResetTickets] SET [tokenUsed] = 0 WHERE ResetID =1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.