我不是一個真正的SQL人,所以我很掙扎。 "program"
下面有什麼問題阻止我創建此存儲過程?任何幫助或清理建議都會很棒。SQL Server存儲過程語法
ALTER PROCEDURE [dbo].[CreateHaystackExportJob_Program]
-- Add the parameters for the stored procedure here
@ID AS VARCHAR
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @JobCount AS INT
SELECT
@JobCount = COUNT (*)
FROM
dbo.HaystackExportJobs
WHERE
ID = @ID AND ExportType = "program"
IF @JobCount = 0
INSERT INTO dbo.HaystackExportJobs (ID,ExportType) VALUES (@ID,"program")
END
如果你發佈錯誤信息,你會得到更好的反饋 – 2013-02-11 00:24:11
你是對的,抱歉。 – MFB 2013-02-11 00:45:48