Determine Users with Permission on an Object
This script will walk the hierarchical chain of users and roles to find users with permissions on an object.
2009-03-24 (first published: 2009-02-18)
1,591 reads
This script will walk the hierarchical chain of users and roles to find users with permissions on an object.
2009-03-24 (first published: 2009-02-18)
1,591 reads
Often the RAND() function is predictable based on the seed. This stored procedure generates a pretty good random integer because the seed itself is quite unpredictable. You can’t put this in a UDF since it is indeterminate due to the RAND and GETDATE() functions used.
2006-09-15 (first published: 2006-09-06)
602 reads
Stored procedure to return the list of columns of the primary key for a table. The name of the column for the result set is the name of the primary key for the table.
2006-09-14 (first published: 2006-09-07)
689 reads
One of the neatest T-SQL enhancements in SQL Server 2005 is the ROW_NUMBER() function. New author Charles Hawkins brings us an explanation of how you can use this function along with a Common Table Expression to remove duplicate data.
2006-02-07
13,166 reads
You don't have to try and decipher what instance you are running. The extended stored procedure xp_instance_regread does all the functionality of xp_regread and automatically knows which instance in the registry it should look at.
2003-06-06
1,039 reads
By Steve Jones
I looked at row_number() in a previous post. Now I want to build on...
Recently I received a cry for help over Teams. The issue was that an...
By davebem
I was the principal author of this SIOS whitepaper, which describes how to build...
Hi - I'm looking for advice regarding the best & quickest way to establish...
Hello. I am looking for a tool Data cleansing/conversion, was recommended HPE any...
I have a query that runs in a job to check on orphaned users....
I have this data in a SQL Server 2022 table:
player yearid team HR Alex Rodriguez 2012 NYY 18 Alex Rodriguez 2013 NYY 7 Alex Rodriguez 2014 NYY NULL Alex Rodriguez 2015 NYY 12 Alex Rodriguez 2016 NYY 9If I run this code, what are the results returned in the hrgrowth column?
SELECT player , yearid , hr , hr - LAG (hr, 1, 0) IGNORE NULLS OVER (ORDER BY yearid) AS hrgrowth FROM dbo.playerstats;See possible answers