This is for homework, the reading & provided notes are exteremly light. one of the homework problems requires me to pass a column and table varchar to a procedure.
for which i have....
create proc proc_test
declare @sql_string varchar(max)
set @sql_string = 'select ' + @col + ' from ' + @table;
Now, the next part of the assignment has me validating the @table variable is in fact a table within the database and not some inserted code.(delete, drop, insert, etc.)
I changed the @table to a sysname variable but that does not seem right to me.
Any insight is appreciated.....or a go here read this would be grand.thanks