Posts Tagged ‘SQL Server’

TSQL: Create SQL Logins using certificates and asymmetric keys 70-462


Warning: count(): Parameter must be an array or an object that implements Countable in /home/fbsqlcom/public_html/youdidwhatwithtsql.com/wp-content/plugins/wp-codebox/main.php on line 31

Here’s some TSQL for creating sql logins using certificates and asymmetric keys. Explanatory comments are included. ?View Code TSQLCREATE CERTIFICATE myCert ENCRYPTION BY PASSWORD = ‘Secret2014’ WITH SUBJECT = ‘My certificate for sql logins’;   USE [master] GO   — create sql user with the cert CREATE LOGIN [sql_user_a] FROM CERTIFICATE [myCert]; GO   — […]

TSQL: Partially Contained Databases 70-462

Here’s some TSQL for the Partially Contained Databases section of the 70-462. Explanatory comments are included. ?View Code TSQL– enable show advanced options and view current config EXEC sp_configure ‘show advanced options’, 1; GO RECONFIGURE WITH OVERRIDE; GO EXEC sp_configure; GO — enable the feature EXEC sp_configure ‘contained database authentication’, 1; GO RECONFIGURE WITH OVERRIDE; […]

TSQL: User-Defined Server Roles 70-462

Just a little TSQL for the User-Defined Server Roles exercise in the 70-462 training materials. Explanatory comments are included. ?View Code TSQLUSE [master]; GO   — Create server role CREATE SERVER ROLE [Login_Manager]; GO   — Assign permission to server role GRANT ALTER ANY LOGIN TO [Login_Manager]; GO   — Add login to role ALTER SERVER […]

TSQL: Transparent Data Encryption exercise for 70-462

Here’s some TSQL for the WingTipToys2012 Transparent Data Encryption (TDE) exercise in the 70-462 training materials. ?View Code TSQLCREATE DATABASE WingTipToys2012; GO   USE WingTipToys2012; GO   USE [master]; GO   CREATE MASTER KEY ENCRYPTION BY PASSWORD = ‘SecretPa$$w0rd’; GO   CREATE CERTIFICATE server_cert WITH SUBJECT = ‘My DEK Certificate’; GO   USE WingTipToys2012; GO […]

TSQL: Partitioned table exercise for 70-462

Here’s some TSQL for the WingTipToys2012 table partitioning exercise in the 70-462 training materials. ?View Code TSQLCREATE DATABASE WingTipToys2012   USE WingTipToys2012; GO   CREATE PARTITION FUNCTION WTPartFunction(INTEGER) AS RANGE LEFT FOR VALUES (30, 60)   CREATE PARTITION SCHEME WTPartScheme AS PARTITION WTPartFunction TO (fgOne, fgTwo, fgThree);   CREATE TABLE toys ( column1 INTEGER NOT […]