Create Table Permission denied in database tempdb

so when executed, this he got error
-------------------------
USE TempDB
Go
Create table A(ID Int) ---ERR
BUT HE CAN Execute
CREATE TABLE #A(ID INT)
i checked that user guest was enabled in TempDB. but then what could be the problem.................
Solution:
In this scenario , where we have to give users access to only TempDB, we have to give him rights to Create Table in TempDB.
Grant Create Table To Public/Sheetal
Now he is able to create temp permanent tables means
Create table A(id int)
--there is syntactically no difference between these A and #A
But in case of A, we can refrence in another database in anoter session.
Select * from tempdb..A
Hope this helps!................................
No comments:
Post a Comment