Does select * into B from A
also copy constraints of A on B ? If not, then how can I copy constraints?
No, not in SQL-Server. You would need to specify the constraints and indexes on the new table manually. If you're using SSMS, using the Script As... Create To
functionality can get you a sample script to create a new table with the same constraints and structure.
Indexes, constraints, and triggers defined in the source table are not transferred to the new table, nor can they be specified in the SELECT...INTO statement. If these objects are required, you can create them after executing the SELECT...INTO statement.