Web Reference: Dec 10, 2011 · Accessing a table from a name in a variable. SQL: Select dynamic column name based on variable. Regards. You cannot use a variable like that in a SELECT statement. You will need to create dynamic TSQL. You don't specify your RDBMS, but in SQL Server you would use sp_executesql (preferably) or EXEC. Declare @sql varchar(1000) Jul 23, 2025 · Dynamic sorting using dynamic SQL in SQL Server is a method to sort one or more columns of a dynamic query result set dynamically and flexibly. By this method, the user can determine the sorting order of the result set at runtime instead of being hardcoded in the query. Jul 18, 2015 · Since, user can order the column from client side select statement should be dynamic. Is it possible? Use dynamic SQL. But join to sys.columns to avoid SQL Injection attacks. SELECT ', ' + QUOTENAME(c.name) . FROM Report.InfoColumnOrder r. JOIN sys.columns c ON c.name = r.ColumnName AND c.object_id = object_id('dbo.Info')
YouTube Excerpt: In this video, we'll learn about
Information Profile Overview
Sql Dynamic Column Selection Sql - Latest Information & Updates 2026 Information & Biography

Details: $48M - $90M
Salary & Income Sources

Career Highlights & Achievements

Assets, Properties & Investments
This section covers known assets, real estate holdings, luxury vehicles, and investment portfolios. Data is compiled from public records, financial disclosures, and verified media reports.
Last Updated: April 4, 2026
Information Outlook & Future Earnings

Disclaimer: Disclaimer: Information provided here is based on publicly available data, media reports, and online sources. Actual details may vary.








