|
Posted by Erland Sommarskog on 07/01/05 00:43
Don (dmorgan@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;Server=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, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
[Back to original message]
|