How to retrieve create statement for table from db in C#开发者_Go百科?
I need to create a script file containing create statement for an existing table in db using C#.
I can generate create statement of storedproc using sp_helptext but can't generate it for table.
Please help.
this is joke.
- use sqlmetal.exe and compile output.
- use DataContext.CreateDatabase (use Log property of DataContext to get SQL Code)
It's not supported for tables although a quick google gives a script
http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/28eeb603-1607-4b56-9461-3c0502cbec9c
精彩评论