Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rajnidas
Yak Posting Veteran
97 Posts |
Posted - 2013-10-31 : 02:43:39
|
Hi,everyoneI am in new in sql, i need storeprocedure query method when i enter front end value ,if error code is 1 then insert values into the datebases , i need store procedure correction of my query pls help..i need to validation in sql coding has given belowUSE [IndusInd]GO/****** Object: StoredProcedure [dbo].[USP_Application_GetFinacleValidDetails] Script Date: 10/31/2013 11:14:29 AM ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOalter procedure [dbo].[USP_Insert_Finance](@Finacleid int,@ChequeNo int, @ChequeAmount float, @BranchCode varchar(25), @ValueDate date, @ApplicationNo int, @MatchFound bit, @CreatedBy varchar(50), @createdDate date) AS BEGIN INSERT INTO [dbo].[mtblFinacleDetails] ( ChequeAmount, BranchCode, ValueDate, ApplicationNo, MatchFound, CreatedBy, createdDate ) SELECT ChequeAmount,BranchCode,ValueDate,ApplicationNo,MatchFound,CreatedBy,CreatedDate from [dbo].[mtblFinacleDetails] as det inner join mtblFinacleDetailsTemp as tem on det.finacleid = tem.finacleid WHERE ErrorCode = 1 END |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-10-31 : 02:45:52
|
the query looks fine. didnt understand issue you facedare you getting some error? if yes, post error message you got------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
rajnidas
Yak Posting Veteran
97 Posts |
Posted - 2013-10-31 : 02:48:26
|
Msg 207, Level 16, State 1, Procedure USP_Insert_Finance, Line 28Invalid column name 'ErrorCode'.Msg 209, Level 16, State 1, Procedure USP_Insert_Finance, Line 26Ambiguous column name 'ChequeAmount'.Msg 209, Level 16, State 1, Procedure USP_Insert_Finance, Line 26Ambiguous column name 'BranchCode'.Msg 209, Level 16, State 1, Procedure USP_Insert_Finance, Line 26Ambiguous column name 'ValueDate'.Msg 209, Level 16, State 1, Procedure USP_Insert_Finance, Line 26Ambiguous column name 'CreatedBy'.Msg 209, Level 16, State 1, Procedure USP_Insert_Finance, Line 26Ambiguous column name 'CreatedDate'. |
 |
|
rajnidas
Yak Posting Veteran
97 Posts |
Posted - 2013-10-31 : 02:52:15
|
murukes sir,the logic is when data insert into the table from frontend , the data are matching error code is 1 then data insert into the main table,i want to write storeprocedure in this issue but i wrote storeprocedure is correct or not i not aware .i need help. pls |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2013-10-31 : 02:55:15
|
The errors are easy to understand. Use table qualifier for each columnMadhivananFailing to plan is Planning to fail |
 |
|
rajnidas
Yak Posting Veteran
97 Posts |
Posted - 2013-10-31 : 02:57:43
|
how to use table qualifier sir |
 |
|
rajnidas
Yak Posting Veteran
97 Posts |
Posted - 2013-10-31 : 02:59:18
|
vanakam madhivanan sir,the logic is when data insert into the table from frontend , the data are matching error code is 1 then data insert into the main table,i want to write storeprocedure in this issue but i wrote storeprocedure is correct or not i not aware .i need help. plspls correct my error i am new in sql . |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2013-10-31 : 03:02:41
|
Instead of ChequeAmount use tem.ChequeAmount, etc. Is there a column for error code?MadhivananFailing to plan is Planning to fail |
 |
|
rajnidas
Yak Posting Veteran
97 Posts |
Posted - 2013-10-31 : 03:05:28
|
nandri Madhivanan sir, i will try , keep on touch for help. |
 |
|
lilianjie
Starting Member
3 Posts |
Posted - 2013-10-31 : 03:43:10
|
unspammed |
 |
|
|
|
|
|
|