SHARE
TWEET

Untitled

a guest Jul 18th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DECLARE @C_Names VARCHAR(MAX)
  2. DECLARE @T_Name VARCHER(MAX)
  3.  
  4. SET @C_Names = '[ID], [DateAdded], [TenantID]'
  5. SET @T_Name = 'your_table_name'
  6. --AS column names are fixed, you can now change the table name
  7. --only and execute the script to get your desired output
  8.  
  9. EXEC('SELECT '+@C_Names+' FROM '+@T_Name+'')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top