I am trying to pass a datatable to my procedure.
I have created a SQL Server user-defined table type as below:
CREATE TYPE dbo.DT_SimQuestionWebTemp AS TABLE
(
[id] [bigint] IDENTITY(1,1) NOT NULL,
[SimId] [bigint] NOT NULL,
[mobile] [nvarchar](25) NOT NULL,
[LevelId] [int] NULL,
[QuestionId] [int] NULL,
[Question] [nvarchar](500) NULL,
[Answer1] [nvarchar](100) NULL,
[Answer2] [nvarchar](100) NULL,
[Answer3] [nvarchar](100) NULL,
[Answer4] [nvarchar](100) NULL,
[Answer5] [nvarchar](100) NULL,
[Status] [int] NOT NULL
)
I am trying to drop the table to create again with different schema using the below syntax.
drop table DT_SimQuestionWebTemp
however I am getting an error:
Cannot drop the table 'DT_SimQuestionWebTemp', because it does not exist or you do not have permission
and I have permission to drop tables and also I am able to use the table from the stored procedure. However I am not able to drop it or select from it through a normal query.
Any idea how to see the table and drop it?