SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 stored proc
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pascal_jimi
Posting Yak Master

Azerbaijan
139 Posts

Posted - 07/24/2013 :  01:55:09  Show Profile  Visit pascal_jimi's Homepage  Reply with Quote

hi this text works fine
declare @ph int,@sn int
set @ph=11
set @sn=8999
update yeni_yeni
set phone=@ph
where SertiNom=@sn
insert phone
(phone,telUnvan,ASA,kateqoriya,alamat,cdmaalamet,Teltarix,milliyet,Name,DoYer,
DoTarix,SexVes,Elaqe,Odeme,MINIATS,XusKart)
select
phone,telUnvan,ASA,alamat,kateqoriya,cdmaalamet,Teltarix,milliyet,Name,DoYer,
DoTarix,SexVes,Elaqe,Odeme,MINIATS,XusKart from yeni_yeni where phone=@ph and SertiNom=@sn

select*from yeni_yeni where phone=@ph
select*from phone where phone=@ph


but I write stored proc this query

create proc nome_ver
@ph int,@sn int
as
update yeni_yeni
set phone=@ph
where SertiNom=@sn
insert phone
(phone,telUnvan,ASA,kateqoriya,alamat,cdmaalamet,Teltarix,milliyet,Name,DoYer,
DoTarix,SexVes,Elaqe,Odeme,MINIATS,XusKart)
select
phone,telUnvan,ASA,alamat,kateqoriya,cdmaalamet,Teltarix,milliyet,Name,DoYer,
DoTarix,SexVes,Elaqe,Odeme,MINIATS,XusKart from yeni_yeni where phone=@ph and SertiNom=@sn


exec nome_ver @ph=5505502 ,@sn=5555555555555


excute stored proc get me error


Message 8114, Level 16, State 4, the procedure nome_ver, row 0
Error converting data type numeric to int.

kmkmmm

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 07/24/2013 :  02:02:51  Show Profile  Reply with Quote
whats the datatype of SertiNom and phone? I think one of them is decimal

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs

Edited by - visakh16 on 07/24/2013 02:03:26
Go to Top of Page

pascal_jimi
Posting Yak Master

Azerbaijan
139 Posts

Posted - 07/24/2013 :  03:04:41  Show Profile  Visit pascal_jimi's Homepage  Reply with Quote
thank you very much friend

kmkmmm
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 07/24/2013 :  03:38:00  Show Profile  Reply with Quote
did you get it sorted?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

pascal_jimi
Posting Yak Master

Azerbaijan
139 Posts

Posted - 07/24/2013 :  03:52:35  Show Profile  Visit pascal_jimi's Homepage  Reply with Quote
yes thank you


kmkmmm
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 07/24/2013 :  03:58:42  Show Profile  Reply with Quote
cool

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000