Monday, October 18, 2010

How to kill session remotely

1. Download PsTools at this address and then run Windows command prompt at the folder containing PsTools
2. Run psexec command: D:\PsTools> psexec \\RemoteMachineName_Or_IPAddress -u UserName -p Password cmd
Wait a moment to allow to connect to remote server. A new command prompt will appear like that:
3. Run: qwinsta to get session ID need to log off: C:\WINDOWS\system32>qwinsta
A list of sessions will display, choose one you need to kill
4. Run: C:\WINDOWS\system32>logoff SessionID /v

Thursday, October 7, 2010

Create linked server to Access 2007 accdb file

EXEC master.dbo.sp_addlinkedserver @server = N'AccessLinkedServerName', @srvproduct=N'Access', @provider=N'Microsoft.ACE.OLEDB.12.0', @datasrc=N'D:\Projects\MyAccessDB.accdb'
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'AccessLinkedServerName', @locallogin = NULL , @useself = N'False'

Oracle Query