SQL Stored Procedure Creation

Cem_KaraerCem_Karaer Member Posts: 281
edited 2008-12-02 in SQL General
Hello I tried following code
CREATE PROCEDURE dbo.proc_MyStoredProcedure
  @CompanyName
AS
  SELECT * FROM dbo.[@CompnayName$Item]
to return all lines of the item table which belong to the company that I want to specify while calling the stored procedure. To my surprise, SQL created a stored procedure without murmuring :D. But when I tried to execute the procedure with the following code
EXECUTE dbo.proc_MyStoredProcedure 'My Company Name'
it refused to obey me. What can I do?
Cem Karaer @ Pargesoft
Dynamics NAV Developer since 2005

Comments

Sign In or Register to comment.