Sql Server - How to write a Stored procedure in Sql server
Stored Procedure:-Stored Procedure In Sql server can be defined as the set of logically group of sql statement which are...
2009-12-05
1,504 reads
Stored Procedure:-Stored Procedure In Sql server can be defined as the set of logically group of sql statement which are...
2009-12-05
1,504 reads
While I have been working for Red Gate Software for nearly three years, it was only until this year that...
2009-12-05
758 reads
Several months ago I received a copy of the Apress book, Pro SQL Server 2008 Administration (Amazon)by Ken Simmons (@kensimmons),...
2009-12-04
978 reads
I haven’t had to write a Question of the Day in a few months now and I have mixed feelings...
2009-12-04
430 reads
I was recently looking for some publicly available data for a demo. Many times, the complicated solutions we deliver for...
2009-12-04
386 reads
So this week I attended a preview for Visual Studio 2010. In addition to database development, I do ASP.NET development...
2009-12-04
2,138 reads
Endgadget recently had a post up about the Micron Real SSD C300 family of SATA 6Gbps SSDs that will be...
2009-12-04
707 reads
Yesterday was the first time I gave a presentation to a group of professional who knows SQL Server. I was...
2009-12-04
795 reads
My laptop died recently, actually died completely, unable to boot. The hard drive was fine, and I managed to stick...
2009-12-04
484 reads
According to this C|Net report, New York state wants someone to build wind farms in the great lakes and purchase...
2009-12-04
629 reads
By Steve Jones
It’s Prime Day. A few of my recommendations, since I want to do some...
With Fabric Mirroring, Microsoft is promoting a nice and appealing story for operational reporting...
If you’ve been watching AI roll through the data community and thinking, “this seems...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
Hi All I am trying to find 'bad' characters that users might type in....
Comments posted to this topic are about the item Extreme DAX: Take your Power...
I set up a few users on my SQL Server 2022 instance.
CREATE LOGIN User1 WITH PASSWORD = 'Demo12#1' CREATE USER User1 FOR LOGIN User1 GO CREATE LOGIN User2 WITH PASSWORD = 'Demo12#2' CREATE USER User2 FOR LOGIN User2 GO CREATE LOGIN User3 WITH PASSWORD = 'Demo12#3' CREATE USER User3 FOR LOGIN User3 GOI then created a schema that one of them owned. Under this schema, I added a table with some data.
CREATE SCHEMA MySchema AUTHORIZATION User1
GO
CREATE TABLE Myschema.MyTable(myid INT)
GO
INSERT MySchema.MyTable
(
myid
)
VALUES
(1), (2), (3)
GO
SELECT * FROM MySchema.MyTable
GO
I granted rights and verified that User2 could access this table.
GRANT SELECT ON Myschema.MyTable TO User2 GO SETUSER 'USER2' GO SELECT * FROM MySchema.MyTable GOThis worked. Now, I move this schema to a new user.
ALTER AUTHORIZATION ON SCHEMA::Myschema TO User3; GOWhat happens with this code?
SETUSER 'USER2' GO SELECT * FROM MySchema.MyTable GOSee possible answers