A Generic Histogram Generator for SQL Server
Histograms help people analyze large amounts of data, whether you display them as tables or as charts. This article shows you how to do both.
2008-07-16
3,216 reads
Histograms help people analyze large amounts of data, whether you display them as tables or as charts. This article shows you how to do both.
2008-07-16
3,216 reads
One thing you may need to do is dynamically return a set amount of rows based on user input. This could be for a search function, reports, dropdown lists or whatever. Instead of hard coding a set value you would like to pass in a variable that will then determine the number of rows to return. How can this be done with T-SQL?
2008-07-16
4,539 reads
When databases suddenly stop working, it can be for a number of different reasons. Human error plays a large part, of course, and the DBA needs to know what these various humans are up to. DDL triggers can help alert the DBA to unauthorized tampering with a production system, of course, but DDL triggers can't tell you everything. At some point, you will need to implement your own checks. Randy certainly reached that point!
2008-07-15
2,971 reads
Table locking hints provide developers much tighter control of their transactions. Look at the benefits and disadvantages of using the NOLOCK and READPAST table hints in SQL Server
2008-07-15
5,492 reads
I need to write a function to determine if particular year is a leap year (i.e. February contains 29 days rather than 28 days). I know that there are various rules for calculating leap years. Is there an easy way to figure this out? Can you provide an example or two to validate various years?
2008-07-14
5,755 reads
Michael David discusses how XQuery was designed from the ground up to process hierarchical XML data, but it is still missing capabilities that a hierarchical query processor product should have and did have originally.
2008-07-14
2,422 reads
Join BI Architect Bill Pearson in an introduction to the intrinsic MEMBER_KEY property. In hands-on exercises, we gain exposure to the use of the property in generating simple lists, as well as datasets to support report parameter picklists.
2008-07-11
2,077 reads
The Microsoft Jet 4.0 relational database engine utilizes character sorting tables when creating and querying field indexes made up of character data. Two Microsoft Windows APIs are generally utilized for this functionality:
2008-07-11
3,944 reads
Part 2 in this upgrade series lists the steps to point application traffic at a transition server while the primary cluster is rebuilt to Windows Server 2003 and SQL Server 2005.
2008-07-10
2,511 reads
If you use the new data types in SQL Server 2008, and your front-end application uses .NET 2, you may hit difficulties. András explains why and how...
2008-07-10
3,445 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