Schemas, Synonyms and Permissions  

Posted by ReelTym

if object_id( 'SchemaA.TableA' ) is not null drop table SchemaA.TableA
if object_id( 'SchemaB.TableA' ) is not null drop synonym SchemaB.TableA
if schema_id( 'SchemaA' ) is not null drop schema SchemaA
if schema_id( 'SchemaB' ) is not null drop schema SchemaB
if user_id( 'UserB' ) is not null drop user UserB
go
create schema SchemaA
go
create table SchemaA.TableA ( id int identity(1,1), name varchar(20), systemuser sysname default system_user, sessionuser sysname default session_user, currentuser sysname default current_user )
go
create schema SchemaB
go
create synonym SchemaB.TableA for SchemaA.TableA
go
create user UserB without login with default_schema = SchemaB
go
grant DELETE, INSERT, REFERENCES, SELECT, UPDATE on schema::SchemaB to UserB
go
insert into SchemaB.TableA( name ) values ( 'Test1' )
go
execute as user = 'UserB'
go
insert into SchemaB.TableA( name ) values ( 'Test2' )
select * from SchemaA.TableA
select * from SchemaB.TableA
go
revert
go

So Long To Ya, 2010!  

Posted by ReelTym


SQL Server Version Database  

Posted by ReelTym

Querying/Resetting/Opening Remote Desktop Connections  

Posted by ReelTym


Log into a server on the domain and open a windows command prompt

qwinsta = Query WINdows STAtion

To view current connections on a server type:
            qwinsta /server:<server name or ip address>

When the results are displayed pick an ID value that has a state of “Disc” (Disconnected)

rwinsta = Reset WINdows STAtion

To kill a session pick the ID with the state of “Disc” and type the following:
            rwinsta <ID Value> /server:<server name or ip address>

The remote desktop session has been killed and you are now able to Remote Desktop into your original SQL Server.

Starting Remote Desktop from the Command-Line......

If you may wan to run Desktop Console from a batch file, for example RDC over VPN, you can use mstsc /v:servername /console command.

Mstsc

Creates connections to terminal servers or other remote computers, edits an existing Remote Desktop Connection (.rdp) configuration file, and migrates legacy connection files that were created with Client Connection Manager to new .rdp connection files.

Syntax

            mstsc.exe {ConnectionFile | /v:ServerName[:Port]} [/console] [/f] [/w:Width /h:Height]
            mstsc.exe /edit"ConnectionFile"
            mstsc.exe /migrate

Parameters
            ConnectionFile
                        Specifies the name of an .rdp file for the connection.

            /v:ServerName[:Port]
                        Specifies the remote computer and, optionally, the port number to which you want to connect.

            /console
                        Connects to the console session of the specified Windows Server 2003 family operating system.

            /f
                        Starts Remote Desktop connection in full-screen mode.

            /w:Width /h:Height
                        Specifies the dimensions of the Remote Desktop screen.

            /edit"ConnectionFile"
                        Opens the specified .rdp file for editing.

            /migrate
                        Migrates legacy connection files that were created with Client Connection Manager to new .rdp connection files.

Remarks

You must be an administrator on the server to which you are connecting to create a remote console connection.
default.rdp is stored for each user as a hidden file in My Documents. User created .rdp files are stored by default in My Documents but can be moved anywhere.
Examples

To connect to the console session of a server, type:

            mstsc /console

To open a file called filename.rdp for editing, type:

            mstsc /edit filename.rdp

Wooden Centrifugal Puzzle  

Posted by ReelTym

Notchable Burr Puzzles  

Posted by ReelTym


Design/test your own here: IBM Burr Puzzles

Public Domain Flix  

Posted by ReelTym