0

I working in a shared project

In ASCData database, i have a procedure, but I do not understand the meaning of it

set @srvid = -1
SELECT @srvid = srvid FROM master.dbo.sysservers where srvname = 'ASCData_Log'
if(@srvid <> -1)
begin
-- Some insert and select query here
end

Please explain help me

why have to compare @srvid ? and where is master.dbo.sysservers ?

ASCData_Log is one of database of this project.

4

1 回答 1

0

i don't know ASCData, but i think, it does the following:

  1. initialize the variable srvid with "-1" (wich will respresent an error)
  2. query the meta-data of the database-server for the server (and the server-id) of the maschine, which holds the ASCData_Log (a log-database)
  3. set the server-id to the variable "srvid"
  4. begin the procedure if "srvid" not equals "-1" (no error and a server is found)

should be the most logical interpretation...

于 2012-08-26T08:23:03.603 回答