Append SQL table name with today's date
- by Ricardo Deano
Hello all.
I understand that I can change a sql table using the follow sp:
EXEC sp_rename 'customers', 'custs'
How would I go about appending this so that the new table has today's date as a suffix?
I've attempt variations on the below theme with little success!!
EXEC sp_rename 'customers', 'customers +(CONVERT(VARCHAR(8),GETDATE(),3))'
Any help greatly appreciated.