USE Northwind
DECLARE @SqlQuery VARCHAR(1000)
DECLARE @ColumnName VARCHAR(100)
DECLARE @TableName VARCHAR(100)
SET @ColumnName = N'Address'
SET @TableName = N'Customers'
SET @SqlQuery = N'SELECT '+ @ColumnName+ ' FROM ' + @TableName
EXEC (@SqlQuery)
DECLARE @SqlQuery VARCHAR(1000)
DECLARE @ColumnName VARCHAR(100)
DECLARE @TableName VARCHAR(100)
SET @ColumnName = N'Address'
SET @TableName = N'Customers'
SET @SqlQuery = N'SELECT '+ @ColumnName+ ' FROM ' + @TableName
EXEC (@SqlQuery)
No comments:
Post a Comment