在MS SQL SERVER2000中存取图片应该跟MYSQL一样的:
$query = "select pic from table where id=$id";
$result = @mssql_query($query);
$row=mssql_fetch_array($result);
$pic=$row["pic"];
Header( "Content-type: image/jpeg");
echo $pic;//显示
$query = "select pic from table where id=$id";
$result = @mssql_query($query);
$row=mssql_fetch_array($result);
$pic=$row["pic"];
Header( "Content-type: image/jpeg");
echo $pic;//显示
$filename = "F:/mm/M23406.jpg";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
//将$contents存入数据库中即可
//----------输出
//从数据库读出数据赋给$contents
$filename = "aaa1.jpg";
$fd = fopen ($filename, "w");
fwrite($fd,$contents);
fclose ($fd);