How can we copy data as well the structure and schema as sql query? We need database publishing wizard for that.
Download the database publishing wizard and install it.
It will be installed at following location : C:\Program Files\Microsoft SQL Server\90\Tools\Publishing\
run the exe and you can get the sql file with all the data, schema and structure of the database you select.
