How do I create a table in SQL Server from a .sql? I see the query statements and the data to be inserted into the table but how do I create the actual tables?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the statements to create the tables aren’t in the .sql file, then you will need to know their structure and create them, either by using a handwritten query, another .sql file or SQL Server Management Studio (SSMS).
In SSMS you can expand a database in the Object Explorer and then right click on “Tables” to select “New Table…” then you will get a UI for defining the columns you need.
With the context of your previous question you need to contact whoever supplied the .sql files and ask for a script to create the required tables. Or perhaps they should send you a copy(a backup) of the database.