我編寫了一個存儲過程在Crystal Report中使用
專家回答:
只要存儲過程只產生了一個單個的結果
這裡是我們可能會復用的一個過程例子:
CREATE PROC usp_Demo_AllAuthors as select * from pubs
GO
現在有一個存儲過程使用usp_Demo_AllAuthors的結果:
CREATE proc usp_Demo_SPUser as CREATE TABLE #Authors (
au_id varchar(
au_lname varchar (
au_fname varchar (
phone char (
address varchar (
city varchar (
state char (
zip char (
contract bit NOT NULL
)– Execute usp_Demo_AllAuthors storing the
– results in #Authors
insert into #Authors
exec usp_Demo_AllAuthors– Here we use the #Authors table
– only selects from the temp table but you could do much
– more such as use a cursor on the table or join with
– other data
SELECT au_fName +
from #AuthorsDROP TABLE #Authors
GO
SQL Server
問題提交於
我在SQL Server
CREATE PROCEDURE add_ticket — parameters DECLARE free_seats int BEGIN TRANSACTION SELECT free_seats = COUNT(*) FROM tickets WHERE
seat_is_not_taken IF free_seats <>
問題就是兩個過程可以同時讀取空閒票數
專家回答:
你是正確的;更高的隔離級別也不會保證多個讀者去同時去讀取同一個數據行
就是說
[
From:http://tw.wingwit.com/Article/program/SQLServer/201311/22462.html