How to generate ''CREATE TABLE'' script using Stored procedure ?

  • How to generate 'CREATE TABLE' script using Stored procedure ?

    I want to pass table name to sp and generate create script for that table.

    That create script i ll be writing to a text file using vb.net.

    Pls let me know ASAP

    Thanks in Advance..

    Sandeep

     

  • sandeep - the only way to do it is by using dynamic sql...







    **ASCII stupid question, get a stupid ANSI !!!**

  • No u didn't get my question.

    By dynamic SQL we can create a table.But I want that,...

    Table is already created, I want to extract the SQL 'CREATE' script for the table.As we get in a standard way from SQL Analyzer.

    OK.

    n it was no an stupid Question...so ANSI should not be so..stupid..

  • yes - I did misunderstand the question -

    just to let you know that "acii stupid question..." etc. is just the signature I use with my profile...has nothing to do with what you asked...so no there's no cause for belligerence...







    **ASCII stupid question, get a stupid ANSI !!!**

  • Ya thats fine..

    But could you pls let me know how to generate script,if u know the same. ?

    Thnaks in advance//..

  • not off the top of my head - but a search on this site came up with one article that (I think) claims to do exactly what you require...

    create table script







    **ASCII stupid question, get a stupid ANSI !!!**

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply