sp_executesql Is Not Faster Than an Ad Hoc Query
This requires an immediate caveat. You should absolutely be using sp_executesql over any type of non-parameterized execution of T-SQL. You...
2016-11-07
1,204 reads
This requires an immediate caveat. You should absolutely be using sp_executesql over any type of non-parameterized execution of T-SQL. You...
2016-11-07
1,204 reads
I recently wrote an introductory post about the importance of statistics. I just received a reinforcement on how important they...
2016-11-10 (first published: 2016-11-03)
1,228 reads
A performance tuning tip I saw recently said, “Views don’t perform as well as stored procedures.”
<sigh>
Let’s break this down, just...
2016-11-09 (first published: 2016-11-01)
3,723 reads
The things you read on the internet, for example, “don’t use a sub-query because that hurts performance.”
Truly?
Where do people get...
2016-10-24
1,525 reads
SQL Cruise offers a number of unique opportunities for everyone involved, including speakers and sponsors. I’ve written before, severaltimes, about...
2016-10-28 (first published: 2016-10-18)
1,143 reads
I read all the time how SELECT * hurts performance. I even see where people have said that you just have...
2016-10-25 (first published: 2016-10-17)
4,419 reads
Busy, busy, busy.
A lot of the work around PASS currently is getting ready for Summit. I’m prepping my part in the...
2016-10-11
441 reads
This is post #10 supporting Tim Ford’s (b|t) initiative on #iwanttohelp, #entrylevel. Read about it here.
When you send a query to your...
2016-10-19 (first published: 2016-10-10)
2,087 reads
No one reads blogs any more.
Twitter is dying.
Facebook is broken.
LinkedIn? Please.
G+. Is that even on any more?
Where do we go...
2016-10-05
485 reads
SQL Server is a deep and complex product. There’s always more to learn. For example, I had never heard of...
2016-10-13 (first published: 2016-10-03)
1,807 reads
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...
By Arun Sirpal
Not every production incident is a database in RECOVERY_PENDING or a corrupted event (like...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
WhatsApp:0817-866-887 Jl. Ahmad Yani No.31, Pattunuang, Kec. Wajo, Kota Makassar, Sulawesi Selatan 90174 (@bcakcumakassar)
Hi All I am trying to find 'bad' characters that users might type in....
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