Author |
Topic |
crash893
Starting Member
5 Posts |
Posted - 2006-04-05 : 17:54:40
|
Hi all,I am trying to write a stored procedure and i just can't get it to workcan you find anything wrong with this that would make it not enter the data into a row?[code]ALTER PROCEDURE dbo.Insertprimerank( @Rank numeric (18,0), @dat_time datetime, @years numeric(18,3) , @cleared numeric(18,0) )AS /* SET NOCOUNT ON */ INSERT INTO rank_table (rank, dat_time, years, cleared) VALUES (@Rank,@dat_time,@years,@cleared) RETURN[\code]The table is named rank_tabledat_time is the primary keyI would really appreshate any help i have been trying to figure this out for about 2 weeks now |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-04-05 : 17:56:46
|
What is the error that you are getting? If no error, does it insert the row if you execute the stored procedure from Query Analyzer?Tara Kizeraka tduggan |
|
|
crash893
Starting Member
5 Posts |
Posted - 2006-04-05 : 22:31:10
|
It doesnt throw an error but it also does not add any new values to the table when i run it independentlyI created this SP from an example from a driffrent programi was unclear why he has what looks like definetions in the begining"@rank numeric(18,0),"I changed there values to match the feilds in my database but im still unclear on what they dothanks so much for helping |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-04-05 : 23:03:28
|
" It doesnt throw an error but it also does not add any new values to the table when i run it independently"Is there any trigger on the table that somehow block the insert ? KH |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-04-06 : 11:55:47
|
Where are you executing the stored procedure from? From Query Analyzer or your application?Tara Kizeraka tduggan |
|
|
crash893
Starting Member
5 Posts |
Posted - 2006-04-06 : 15:05:07
|
Im not sure i understand i am still kinda of a noob at thisi have a line in my code ( vb.net) that sends the valuses in order to the stored procdedure |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-04-06 : 15:09:02
|
So you are executing it in your application. You need to take a step back and ensure that the stored procedure even works, so that means you need to try it out in Query Analyzer. Like this:EXEC dbo.Insertprimerank 1.0, GETDATE(), 1.0, 1.0Substitute values instead of what I have. Check the table, did the row get inserted? If so, then the problem is in your VB.NET code and not with the stored procedure.If you are unfamiliar with Query Analyzer, let us know.Tara Kizeraka tduggan |
|
|
crash893
Starting Member
5 Posts |
Posted - 2006-04-06 : 15:10:28
|
I think i should also mention that the entire database is very simpleits one table with 4 feildsand one stroed procedure nothing else |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-04-06 : 15:33:05
|
Did you see my last post?Tara Kizeraka tduggan |
|
|
crash893
Starting Member
5 Posts |
Posted - 2006-04-10 : 10:11:27
|
no i didnt till just nowill try that now |
|
|
|