Using a function to parse/return the Nth field of a delimited column
A useful SQL function to parse a single string with delimited values for the "N"th occurrence
2009-11-06 (first published: 2009-10-15)
1,443 reads
A useful SQL function to parse a single string with delimited values for the "N"th occurrence
2009-11-06 (first published: 2009-10-15)
1,443 reads
There are times when maintenance plan is too simple to do the job, and SSIS is unreachable for you. Here is a simple stored procedure to help you.
2009-11-05 (first published: 2009-10-09)
1,549 reads
Retrieve consecutive records from the table based the value difference
2009-11-04 (first published: 2009-10-06)
949 reads
2009-11-03 (first published: 2009-10-06)
1,946 reads
This will generate a rollback procedure for any table with CDC enabled for all columns
2009-11-02 (first published: 2009-10-08)
1,048 reads
In development enviornment we always get the modifications in tables from developers.As far as my concern writing scripts is tedious work for us. I hope below script will help you.
2009-10-30 (first published: 2009-10-01)
1,349 reads
When creating XML messages for Service Broker or other applications use this simple method to build a validation XSD.
2009-10-28 (first published: 2009-10-06)
1,517 reads
Reports summaries, in 3 levels of detail, connections, running requests, open transactions + cursors, and blocking. Provides query text + plan for the piggiest running request of each group.
2009-10-26 (first published: 2008-09-18)
6,039 reads
2009-10-21 (first published: 2009-10-01)
2,303 reads
Searches for tables who's names contain the search string. Gives Aggregate Size, Rows, Index, and Column information as well.
2009-10-20 (first published: 2008-11-04)
897 reads
By Arun Sirpal
Not every production incident is a database in RECOVERY_PENDING or a corrupted event (like...
It is Friday, the queries are running, and nobody is watching the bill. That...
By Steve Jones
Annabel retired from Redgate Software this week. Across most of my career at Redgate,...
Comments posted to this topic are about the item Extreme DAX: Take your Power...
Comments posted to this topic are about the item What is the Cloud?
Comments posted to this topic are about the item Changing the Schema
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