Link to home
Start Free TrialLog in
Avatar of hojohappy
hojohappy

asked on

Script to create a SQL Server Table

I have a windows form .net application that uses SQL Server 2012 Express.  I have a user of this application who knows nothing of SQL Server and he needs a new table added to the SQL Server Database that my application uses.  Is there a way to create an executable script that I can send to this user that would execute a SQL script to create a new table?  I do have SQL Server management studio so is there anything in this tool that will allow me to create an executable script for this user?  I only want this user to execute the script and let the script to the work of create a new table in an existing database.
Avatar of Brian Pringle
Brian Pringle
Flag of United States of America image

You could write a stored procedure for him and have him import and run it.
This article describes how to import the stored procedure.

http://msdn.microsoft.com/en-us/library/vstudio/bb896231(v=vs.100).aspx
The other option would be to make a C# program to connect to the database server and then issue the commands.  You would want to prompt the user for the name or IP address of the server, the username and password of a user account that has administrative rights on the DBMS.  You could then publish the app and send the executable or installer to him.
ASKER CERTIFIED SOLUTION
Avatar of Surendra Nath
Surendra Nath
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial