SQL Refactor - 1.3
Learning SQL Refactor - 1.3
Expand Wildcards
You can use Expand Wildcards to expand SELECT * and SELECT table.* statements so that they list all of the columns that exist in the referenced tables.
SQL Refactor takes USE database statements into account to ensure that the correct columns are identified.
For example:

Would become:

To do this:
- Open the source script in a SQL Server Management Studio query editor.
- Ensure you are connected to the SQL Server and database that contains the objects referenced in the SELECT statements.
Note that if the code contains USE database statements, SQL Refactor will change the connection as appropriate.
- If required, select the code that contains the SELECT statements that you want to expand.
If you do not select any code, all SELECT statements in the script are expanded.
- On the SQL Refactor menu, click Expand Wildcards.
A progress dialog box is displayed. SQL Refactor connects to the SQL Server to expand all SELECT * and SELECT table.* statements in the code that you selected.
You can undo the changes to the script using the standard SQL Server Management Studio Undo features.
To keep the changes, save the script in the usual way.
If any wildcard characters could not be expanded, for example because the referenced table does not exist, an error dialog box is displayed and the wildcard characters are underlined in red in the query editor. To see error details for an individual wildcard character, move your mouse pointer to the character in the query editor. For example:

See also |
Was this article helpful?
SQL Refactor
- Menu item grayed out
- Removing menu items after uninstalling SQL Prompt and SQL Refactor
- Installation fails when Management Studio is not installed (version 1.1)
- SmartRename is greyed out
- Installer doesn't recognise that SSMS is installed
- Dependency creation in Smart Rename
- Add-in failing to load into SQL Server Management Studio on Vista
- Removing SQL Server Management Studio Integration after uninstallation
- Layout SQL Error
- Log files
all SQL products
- Compatibility of Red Gate tools in 64-bit environments
- Application has encountered an error and needs to close
- Error message after installing SQL Toolbelt - The description for Event ID ( 1 ) in Source ( nview_info ) cannot be found.
- Changing the temporary directory used by the installer
- Toolbelt Installer "hanging" while "scanning volumes"
- Login failing with "trusted SQL Server connection" error when using RunAs
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
SQL Refactor
- Activating your products
- Activating your products
- Getting help offline
- SQL Refactor release notes - version 1.xx
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs

Refactorings