I am attempting to do my first temp table. I created one, but forgot to drop it. Now when I try to create it again in the query analyzer like this I get a message that says "There is already an object named '#tmpScannerInvoiceItems' in the database."
I then tried to just do this it says "Cannot drop the table '#tmpScannerInvoiceItems', because it does not exist in the system catalog."
Before trying to use the "drop table" line, I deleted the temp table from ObjectBrowser >> temppdb in the query analyzer. I think that this is were I messed up. What can I do to get this to work again?
Code:
create table dbo.#tmpScannerInvoiceItems (InvoiceItems char(6),Location char(10))
SELECT DISTINCT Invoice, Locationinto dbo.#tmpScannerInvoiceItemsFROM dbo.InvoiceItems WHERE (Qty = 1)
select * from dbo.#tmpScannerInvoiceItems order by location desc
drop table dbo.#tmpScannerInvoiceItems
I then tried to just do this it says "Cannot drop the table '#tmpScannerInvoiceItems', because it does not exist in the system catalog."
Code:
drop table dbo.#tmpScannerInvoiceItems