Hi Everyone,
I want to be able to run a SQL statement such as:
samp c_orders
and it will return the top 10 rows of the "c_orders" table.
So I tried putting together what I thought would be a very simple stored procedure, but I cannot get it to work. I've tried everything I can think of with no luck. Can somebody help? Here's what I'm writing:
*************************************
CREATE procedure [dbo].samp
@MyTable varchar(64)
as
select top 10 * from @MyTable
GO
*************************************
Any help would be greatly appreciated!
Joseph
I want to be able to run a SQL statement such as:
samp c_orders
and it will return the top 10 rows of the "c_orders" table.
So I tried putting together what I thought would be a very simple stored procedure, but I cannot get it to work. I've tried everything I can think of with no luck. Can somebody help? Here's what I'm writing:
*************************************
CREATE procedure [dbo].samp
@MyTable varchar(64)
as
select top 10 * from @MyTable
GO
*************************************
Any help would be greatly appreciated!
Joseph