Use master.dbo.sysprocesses finally to get it running on all MS SQL versions

This commit is contained in:
Ansgar Becker
2012-01-10 17:21:44 +00:00
parent e65314ed78
commit 2d69818304

View File

@@ -1040,7 +1040,7 @@ begin
// CurCharset := CharacterSet;
// Log(lcDebug, 'Characterset: '+CurCharset);
FIsUnicode := True;
tmp := GetVar('SELECT DATEDIFF(SECOND, '+QuoteIdent('login_time')+', CURRENT_TIMESTAMP) FROM '+QuoteIdent('sys')+'.'+QuoteIdent('sysprocesses')+' WHERE '+QuoteIdent('spid')+'=1');
tmp := GetVar('SELECT DATEDIFF(SECOND, '+QuoteIdent('login_time')+', CURRENT_TIMESTAMP) FROM '+QuoteIdent('master')+'.'+QuoteIdent('sys')+'.'+QuoteIdent('sysprocesses')+' WHERE '+QuoteIdent('spid')+'=1');
if tmp <> '' then
FServerStarted := FConnectionStarted - MakeInt(tmp)
else