Watch this example on YouTube
Replace
DECLARE @Customer VARCHAR(20)
SET @Customer = '1'
Declare @sql varchar(max)
Set @sql = 'SELECT * FROM CustomerMaster '
Set @sql = @sql + 'WHERE CustomerID = @Customer'
Execute(@sql)
With
DECLARE @Customer VARCHAR(20)
SET @Customer = '1'
Declare @sql varchar(max)
Set @sql = 'SELECT * FROM CustomerMaster '
Set @sql = @sql + 'WHERE CustomerID = ' +@Customer
Execute(@sql)
No comments:
Post a Comment