Not 100% sure but i think if you go to your database, right click Tasks--> Generate scripts, you can do what you want.