Description: Basic grammar dynamic sql statement one: ordinary SQL statement Exec can be used to implement eg: Select* from tableName Exec (select* from tableName) Exec sp_executesql N select* from tableName Please note that the string must be added before the N 2: field names, table name, database name, such as variables, we must use dynamic SQL eg: declare @ fname varchar (20) set @ fname = FiledName Select @ fname from tableName error will not prompt an error, but the result for the fixed value FiledName, not to be.
File list (Check if you may need any files):