In SQL Server Management Studio, I can right-click a table and choose:
Script Table as > CREATE To > New Query Editor Window
When I run the script on another database, it creates the table without the data. Is there an option to bring the data (i.e. the contents of the table) along with the table definition?
Best method will be Backup /Restore. Take the backup and restore it with New Name. Select * into will create table but all other constraints of the tables (PK/FK/CK/Indexes) will be missing.. so it will not be the method you are looking for. As mentioned, Detach/attach or Copy database also can do the trick.
E. Make a copy of a database using BACKUP and RESTORE
This example uses both the BACKUP and RESTORE statements to make a copy of the Northwind database. The MOVE statement causes the data and log file to be restored to the specified locations. The RESTORE FILELISTONLY statement is used to determine the number and names of the files in the database being restored. The new copy of the database is named TestDB. For more information, see RESTORE FILELISTONLY.
BACKUP DATABASE Northwind TO DISK = 'c:\Northwind.bak' RESTORE FILELISTONLY FROM DISK = 'c:\Northwind.bak' RESTORE DATABASE TestDB FROM DISK = 'c:\Northwind.bak' WITH MOVE 'Northwind' TO 'c:\test\testdb.mdf', MOVE 'Northwind_log' TO 'c:\test\testdb.ldf'