SQLLY challenged be gentle --
Trying to create code that will drop a table using a variable as the
Table Name.
DECLARE @testname as char(50)
SELECT @testname = 'CO_Line_of_Business_' +
SUBSTRING(CAST(CD_LAST_EOM_DATE
AS varchar), 5, 2) + '_' + LEFT(CAST(CD_LAST_EOM_DATE AS varchar),
4)+ '_' + 'EOM'
FROM TableName
Print @testname = 'blah...blah...blah' (which is the actual table
name on the server)
How can I use this variable (@testname) to drop the table? Under
severe time constraints so any help would be greatly appreciated.