You can, but how are you intending to use it?declare @Tabname varchar(100)set @Tabname = 'TableName'Select name from sys.columns where object_id in (select object_id from sys.objects where name = '' + @Tabname + '')
Will allow you to look for columns in a table depending on the value of your variable.where as:declare @Tabname varchar(100), @SqlCmd nvarchar(max)set @Tabname = 'TableName'set @SqlCmd = 'select * from ' + @Tabnameexec sp_executesql @SqlCmd
Will allow you to select from any table in the variable. Before using the second optioon, please read up on dynamic SQL and the security issues you need to take into account.