Hi folks.
I have recently taken over a project which has a lot of SQL related elements. (SQL is really not my field but I can muddle through it).
Anyway, the question.
When I go into SQL Server Management Studio and right click on my table and select "Create To", A nicely formatted SQL statement appears which allows me to create a copy of my table complete with constraints.
Basicaly, I need to perform this function (ie producing a nice "CREATE" SQL string) in code (using c sharp)
I have looked on Google and had a quick glance through the FAQ's here but can only find methods of copying a table without constraints.
Any help, pointers to code, pseudo code, etc etc would be greatly appreciated.
Dave Rigby
Systems Engineer
If somethings hard to do, its not worth doing - Homer Simpson
Jack of all trades, king of none!
I have recently taken over a project which has a lot of SQL related elements. (SQL is really not my field but I can muddle through it).
Anyway, the question.
When I go into SQL Server Management Studio and right click on my table and select "Create To", A nicely formatted SQL statement appears which allows me to create a copy of my table complete with constraints.
Basicaly, I need to perform this function (ie producing a nice "CREATE" SQL string) in code (using c sharp)
I have looked on Google and had a quick glance through the FAQ's here but can only find methods of copying a table without constraints.
Any help, pointers to code, pseudo code, etc etc would be greatly appreciated.
Dave Rigby
Systems Engineer
If somethings hard to do, its not worth doing - Homer Simpson
Jack of all trades, king of none!