sql - Using Stored Procedure variable in Like statement -


i can't seem use statement using variable stored procedure. want find rows table start variable passed.

i using following query @id value passed stored procedure nvarchar(20). works fine when ids match, not use '%' appended. proper way complete task?

select * table id @id + '%' 

this works me:

declare @id nvarchar(20) select @id = '1' select * tab id @id + '%' 

sql fiddle demo


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -