October 17, 2002 at 10:03 am
How do I do the following from a client?
1. Create a database on my SQL Server.
2. Create a table with the database.
3. Add information within that table.
TIA
-Andre
October 17, 2002 at 4:35 pm
What you can do is create the database in sql server as you want. Then script the database though EM, with all the objects in it and save it to a .txt file. Then drop the database from SQL Server. With in your app, execute a shell command with the OSQL command (See BOL for more info.) With OSQL you can connect to SQL server and execute a file as input. The file you specified is the one you created before.
With the question about adding info to the tables, you can do it in a similar way by creating a file with all the inserts.
October 17, 2002 at 6:34 pm
Many areas of possibility, if you want to code this the SQLDMO is probably your best option. This is want enterprise manager is based on
Simon Sabin
Co-author of SQL Server 2000 XML Distilled
http://www.amazon.co.uk/exec/obidos/ASIN/1904347088
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons
October 18, 2002 at 3:22 am
depends also on the client you could use ado or ado.net as well.
October 18, 2002 at 4:44 am
For a simple table doing it from ADO/.Net would work. Work out what the command should be in Query Analzyer, then just do a connection.execute "create table..." in your app.
Andy
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply