Last post Aug 06, 2015 12:07 AM by Wee Bubba
Aug 03, 2015 11:23 PM|Wee Bubba|LINK
I am developing an ASP.NET/MVC web application using SQL Server as the database. The requirement is that users need to be able to save their own custom data. So the user would need a page to setup their user defined table structure (i.e. I want column A
to be a Date, column B to be currency, etc.) Afterwards, they can then go in and perform CRUD operations on their own custom data store.
My proposed solution to persist this data is to create the tables dynamically in the SQL Server database using SQL (e.g. CREATE TABLE statements etc.) But it rather feels like I am somewhat reinventing the wheel, as this functionality already exists in SQL
Management Studio. Is there an API or existing class library that I can utilise to save development time?
I am happy to consider any advice about this, as the last thing that I want to do is spend lots of time coding a solution that is already available, or if there is an easier way to tackle this problem.
Thanks in advance for any help.
Aug 04, 2015 02:07 AM|Mikesdotnetting|LINK
The "API" is called DDL (Data Definition Language) which is the CREATE TABLE etc statements that you have already mentioned. SSMS is just a visual wrapper over these commands. If you want to programmatically alter a database schema, that is the way to do
Aug 06, 2015 12:07 AM|Wee Bubba|LINK
Hi, and thanks for the reply. This is the way forward then. I just wondered whether there was an existing wrapper API out there.