How to Expand a Range of Dates into Rows using a SQL Server Numbers Table
In this article we look at different T-SQL code examples that can help you build a range of date rows based on a starting and ending date.
2020-07-28
In this article we look at different T-SQL code examples that can help you build a range of date rows based on a starting and ending date.
2020-07-28
This webinar will cover how to use SQL Server plan guides and the query store to fix problematic queries and ways to improve query performance.
2020-07-14
Learn how to configure SQL Server and Windows to allow others to connect to an instance remotely.
2020-01-06
137,567 reads
In this tip we look at how to change specific parts of a date such as the Year, Month or Day for data stored in a SQL Server table.
2019-12-17
Steve highlights a few items from a busy Microsoft and SQL Server news week.
2019-11-09
235 reads
Learn how you can create a SQL Server instance in the Google Cloud Platform.
2019-09-26
3,923 reads
2019-09-14
301 reads
The technologies that we see in other data platform products sometimes flow to SQL Server.
2019-06-20
257 reads
When you build a VM for SQL Server in Amazon EC2, Azure VMs, or Google Compute Engine, it’s all too easy to overlook the CPU speeds that you’re getting. Brent Ozar explains when to stop and check the VM type you used when building this VM.
2019-05-24
1,077 reads
SQL Server contains many built-in views and functions that can be used to understand what is going on “under the hood,” and security is no exception. In this article, Robert Sheldon explains the security related catalogue views, dynamic management views, and system functions.
2019-05-20
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