Don (dm*****@rocketmail.com) writes:
Within an SQL Script is it possible to send a SQLDisconnect
command? (server is MSDE)
I have used sp_dropserver, sp_droplinkedsrvlogin
and do not get a SQLDisconnect.
That only drops the linked server from the system catalog, and will
not affect any connections use.
Each time I run the script a new nsql32.exe process loads up and they
accumulate.
use Sales
Go
sp_dropserver 'M', 'Droplogins'
go
Exec sp_addlinkedserver 'M', ' ', 'MSDASQL', NULL, NULL,
'DRIVER=Lotus NotesSQL DRIVER
(*.nsf);Database=C:\eUROPE\Instrument_Base.nsf;Ser ver=Local;UserName=XXXXXXX
XXXXXX;EncryptPWD=XXXXXXX;' go
select * from M...MainForm where description= 'Described Here'
Would like disconnect when this is done.......
If you stop fiddling with sp_addlinkedserver and sp_dropserver, SQL
Server may use an existing connection instead of opening a new one. I
believe the connections are kept around as a means of pooling to avoid
expensive connection sequences.
--
Erland Sommarskog, SQL Server MVP,
es****@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp