SQL Server: Why would i add “;1” to the end of a stored procedure name?

前端 未结 3 1438
孤独总比滥情好
孤独总比滥情好 2021-01-11 11:04

i came across a compatibility issue today, as a customer upgraded from Windows XP to Windows 7.

The (12 year old code) is calling a stored procedure on the SQL Serve

3条回答
  •  猫巷女王i
    2021-01-11 11:49

    I had the same problem, until I added some code, to remove the ";1" if it was still at the end of the StoredProcName:

    strProcName := StoredProc.StoredProcName;
    
    IF (length(strProcName) > 2) AND (copy(strProcName, length(strProcName) - 1, 2) = ';1') THEN
    
      BEGIN
    
        delete(strProcName, length(strProcName) - 1, 2);
    
        StoredProc.StoredProcName := strProcName;
    
      END {IF};
    
    StoredProc.Prepare;
    
    StoredProc.ParamByName('@cntid').AsInteger := nCounterID;
    
    StoredProc.ParamByName('@range').AsInteger := nRange;
    
    StoredProc.ExecProc;
    
    result := StoredProc.ParamByName('@Status').AsInteger;
    

提交回复
热议问题