ALTER PROCEDURE dbo.getall
(
@title nvarchar(20),
@count int=4
)
AS
select top @count * from music
RETURN
就这个
他说我那个select top @count * from music 的@count有错
请问怎么办呢
...全文
1185打赏收藏
存储过程的创建问题????救命啊
ALTER PROCEDURE dbo.getall ( @title nvarchar(20), @count int=4 ) AS select top @count * from music RETURN 就这个 他说我那个select top @count * from music 的@count有错 请问怎么办呢
declare @count int
declare @sql nvarchar(1000)
set @count=4
set @sql=N'select top ' + cast(@count as nvarchar(10)) +N' from music'
EXEC sp_executesql @sql