Computing.Net > Forums > Database > stored procedure

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

stored procedure

Reply to Message Icon

Name: sumaira
Date: March 23, 2009 at 21:04:14 Pacific
OS: Windows XP
Subcategory: MS SQL Server
Comment:

i have made a stored procedure in which two tables and ID field is provided as input and the result is used to fill a combo in a form .when i execute it i get the follwing error:
Incorrect syntax near 'MAST_STORE'.
my procedure is here .Kindly anyone tell me wats wrong with it.there is a small mistake that i hvnt found yet.

ALTER PROCEDURE [dbo].[mp_LoadPartCombo]
-- Add the parameters for the stored procedure here
@table1 as varchar(max)=MAST_PART,
@table2 as varchar(max)=MAST_STORE ,
@IdCol as varchar(max)=StoreID
AS
BEGIN
declare @select as varchar(Max);
set @select = '(select * from ' + @table1 + ' innerjoin ' + @table2 + ' on ' + @table1 + '.' + @IdCol + ' = ' + @table2 + '.'+@IdCol + ')'
--print (@select)
exec (@select)



Sponsored Link
Ads by Google

Response Number 1
Name: sumaira
Date: March 23, 2009 at 21:18:26 Pacific
Reply:

i hv solved it .i used join instead of innerjoin and problem wz solved


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: stored procedure

SQL2005 stored procedure question www.computing.net/answers/dbase/sql2005-stored-procedure-question/199.html

pl/sql stored procedure syntax www.computing.net/answers/dbase/plsql-stored-procedure-syntax/330.html

assign value to stored pro in SQL server www.computing.net/answers/dbase/assign-value-to-stored-pro-in-sql-server-/594.html