The information in this article applies to:
SUMMARYIf you need a temporary table to persist across non-nested stored procedures and then you want to drop the temporary table when you no longer need it, you can dynamically create permanent tables in your code. This article provides an example of this procedure. MORE INFORMATION
You can use the following code to create a dynamic table name in SQL
Server:
Notice that you can enhance this further if you need more than milliseconds precision (that is, if you need to create more than one table in the same millisecond) by adding username, spid(@@spid) or other data as part of the table name. You can use part of the code above to strip unwanted characters from a string. For example, assuming you have the string "De La Hoya", you can use the WHILE loop above to get a resulting string of "DeLaHoya" Additional query words: names tablename
Keywords : kbcode kbusage SSrvGen |
Last Reviewed: April 16, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |