I have a requirement to create a copy of existing active (currently in use) database through code.
I need to copy all objects which include tables, stored procs, triggers, functions, foreign keys, constraints, primary keys, etc... from source DB to new DB.
Both databases can be in different servers where I have access to both the servers. I also need to copy data for some tables....
It is exactly what copy database wizard is doing... but I want to do it through T-SQL code.....
is it possible?