How can I Inserting to a table
-
I use SQL Server 2005 and Visual Basic 2005. I write these Statement in SQL Server but it executes these with error and the record dose not inserted into table Project. CREATE PROCEDURE Insert_Project (@pNumber_M int, @pRow_Agreement int, @pRow_Machine int, @pRow_Language int) AS BEGIN SET NOCOUNT ON; BEGIN TRY DECLARE @Number_O int; SELECT @Number_O=Number-sum(Number_A) FROM Machine_View WHERE Row=@pRow_Machine GROUP BY Number SET @Number_O=@Number_O-@pNumber_M; INSERT INTO Project (Number_A,Number_D,Row_Agreement,Row_Machine,Row_Language) VALUES (@pNumber_M,@Number_O,@pRow_Agreement,@pRow_Machine,@pRow_Language) UPDATE Project SET Number_D=@Number_O WHERE Row_Machine=@pRow_Machine END TRY BEGIN CATCH SELECT ERROR_PROCEDURE() AS ErrorProcedure; END CATCH END GO Please help me. Thank you.
-
I use SQL Server 2005 and Visual Basic 2005. I write these Statement in SQL Server but it executes these with error and the record dose not inserted into table Project. CREATE PROCEDURE Insert_Project (@pNumber_M int, @pRow_Agreement int, @pRow_Machine int, @pRow_Language int) AS BEGIN SET NOCOUNT ON; BEGIN TRY DECLARE @Number_O int; SELECT @Number_O=Number-sum(Number_A) FROM Machine_View WHERE Row=@pRow_Machine GROUP BY Number SET @Number_O=@Number_O-@pNumber_M; INSERT INTO Project (Number_A,Number_D,Row_Agreement,Row_Machine,Row_Language) VALUES (@pNumber_M,@Number_O,@pRow_Agreement,@pRow_Machine,@pRow_Language) UPDATE Project SET Number_D=@Number_O WHERE Row_Machine=@pRow_Machine END TRY BEGIN CATCH SELECT ERROR_PROCEDURE() AS ErrorProcedure; END CATCH END GO Please help me. Thank you.
mghiassi wrote:
it executes these with error
What error?
Upcoming events: * Edinburgh: Web Security Conference Day for Windows Developers (12th April) * Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects My website
-
mghiassi wrote:
it executes these with error
What error?
Upcoming events: * Edinburgh: Web Security Conference Day for Windows Developers (12th April) * Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects My website
-
Hi The statement below return another code and not zero SELECT ErrorProcedure AS ERRORPROCEDURE Thanks for your help
mghiassi wrote:
The statement below return another code and not zero
That is hardly helpful information. What code? If you remove the TRY/CATCH, what error is given (That should give you a textual description of the error)
Upcoming events: * Edinburgh: Web Security Conference Day for Windows Developers (12th April) * Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects My website