2014-07-14
1,915 reads
2014-07-14
1,915 reads
Tim Smith describes a number of ways to tell which Stored Procedures are in use, DMVs, a SQL Server Trace, and his preferred method, the Source Code and PowerShell.
2014-07-07
4,642 reads
In the grand finale to Michael Sorens' series of PowerShell one-liners, we come to the handling of data, reading it in and writing it out, whether by files; input/output streams or a database. It shows how it can be done in a variety of formats including CSV, JSON, and XML.
2014-06-19
5,763 reads
Phi Factor on how to combine PowerShell Remoting with slick Windows tools such as SQLPSX, Boxstarter and Chocolatey, to automate the development process right through to delivery.
2014-06-09
96 reads
The way to learn PowerShell is to browse and nibble, rather than to sit down to a formal five-course meal. In his continuing series on PowerShell one-liners, Michael Sorens provides Fast Food for busy professionals who want results quickly and aren't too faddy. Part 3 has as its tasty confections - Collections, Hashtables, arrays and strings.
2014-06-02
4,798 reads
Can PowerShell provide an easy way to export Excel as a CSV? Yes. Tim Smith demonstrates that whether you have multiple Excel files, or just multiple worksheets in Excel, PowerShell simplifies the process.
2014-05-21
2,831 reads
We recently faced an issue where an internal data provider began providing an incomplete or inaccurate files because it lacked the proper length (or didn't exceed a certain size). In our case, we implemented a check on the file before importing using PowerShell, here's what we did.
2014-05-15
2,501 reads
Michael Sorens aims to make PowerShell a bit easier to get going with by providing a series of collections of general-purpose one-liners to cover most of what you'll need to get useful scripting done.
2014-04-25
6,795 reads
PowerShell provides a command-line shell and scripting language (built in the .NET Framework) especially designed for administrative task automation and configuration management. Learn how to manage Windows services related to SQL Server, either on a local machine or remote machine, using PowerShell cmdlets.
2014-04-10
3,950 reads
Extracting data with header information using PowerShell
2014-04-28 (first published: 2014-04-07)
1,500 reads
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,...
By Tim Radney
As a SQL Server DBA with years of experience tuning production environments, I’ve seen...
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
Comments posted to this topic are about the item Index Fragmentation Explained: Page Splits,...
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