Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InsertStored procedure

Status
Not open for further replies.

desireemm

Technical User
Dec 17, 2003
50
US
I created a database that has Access XP on the front end and SQL Server 2000 as the engine. Now I created a view of another table which is located in another database, its called ConditionalLicense_View. It gets updated from time to time from the EmployeeGamingLicense table (after the team memeber is terminated). The problem is that the stored procedure I created is not populating the fields with the information from the EmployeeGamingLicense table. it will say "Stored Procedure executed successfully but didnt return any records". Now thats normal I get that same message when I execute another stored procedure also and it does populate the fields..but this one does not, can anyone see anything wrong with this stored procedure?? Any advice you might have would be awesome

Thanks

Code:
ALTER PROCEDURE insert_Conditionals
	
AS 
INSERT INTO [GamingCommissiondb].[dbo].[ConditionalLicense_View] 
	 ( [TM #],
	 [FirstName],
	 [LastName],
	 [SS#],
	 [reasonforconditional],
	 [ConditionalStart Date]) 
	 
 
SELECT	 
	 [TM#],
	 [LASTNAME],
	 [FIRSTNAME],
	 [SSN#],
	 [NOTES],
	 [DATEOFCONDITIONAL]

FROM EmployeeGamingLicense 
WHERE STATUS = 'TERMINATION-COND'
IF @@Error <> '0'
RETURN

 
Have you run the select statement by itself to ensure that it in fact does return some records?

Is your view an updateable one? Try running the code from query analyzer not the strored procedure and see if some messages come up, you could be exerienceing an error that query analyzer will help you find.



Questions about posting. See faq183-874
Click here to learn Ways to help with Tsunami Relief
 
Thanks for the reply SQLSister, yes I created it from the query analyzer and I executed it and dont get any error messages.

(0 row(s) affected)

Stored Procedure: GamingCommissiondb.dbo.insert_Conditionals
Return Code = 0


 
But when you run the select by itself (not from the stored procedure) does it return any rows? If it does not then you have filtered out all the records, nothing meets the criteria you set. Are you sure the where value exists in your data? Does it maybe have trailing spaces or is it spelled differntly? Or is is only part of the vlue of the column?

If the select does return rows, have you run the insert statment directly in query analyzer, not run the sp, but the insert itself?

Questions about posting. See faq183-874
Click here to learn Ways to help with Tsunami Relief
 
Problem solved thank the Lord..this problem has been going on for awhile now finally its resolved. I didnt put the 'TERMINATION-COND' Was not set up in the EmployeeGamingLicense table which triggers the stored procedure which record to execute.

HOOORAAAYYYY

Code:
FROM EmployeeGamingLicense 
WHERE STATUS = 'TERMINATION-COND'
IF @@Error <> '0'
RETURN
 
Oh yes thank you SQL Sister running the sp as a query helped also it returned 0 rows.

thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top