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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 stored proc

Author  Topic 

pascal_jimi
Posting Yak Master

167 Posts

Posted - 2013-07-24 : 01:55:09

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

52326 Posts

Posted - 2013-07-24 : 02:02:51
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
Go to Top of Page

pascal_jimi
Posting Yak Master

167 Posts

Posted - 2013-07-24 : 03:04:41
thank you very much friend

kmkmmm
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-07-24 : 03:38:00
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

167 Posts

Posted - 2013-07-24 : 03:52:35
yes thank you


kmkmmm
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-07-24 : 03:58:42
cool

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

- Advertisement -