Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 1
    i can't seem to find this option. is there something version specific here? Commented Apr 20, 2012 at 11:24
  • 38
    You can't really say it's a better answer generally. It's unusable for automation to be called from within a script for instance. BTW the author asked specifically for an "..SQL statement..". But of course it's a great answer, but not a better one ;). Commented Nov 5, 2012 at 9:35
  • 3
    The author asked to move "(data and all)"; so I hoped that this answer did that. It creates the table but does not create any keys or indexes; so not much of an improvement over the SQL answer. Commented Jan 6, 2014 at 22:02
  • 1
    yes this is correct way as mentioned here too, but identity and foreign key references are removed in the destination database, any solution ? Commented Nov 16, 2015 at 18:35
  • 1
    How did this get 508 Votes and Ryan's "Oct 11 '11 at 23:41" Answer only get 13 to date?!? Ryan's is the only answer that answer's the o.p.'s q. completely. Because it handles these scenarios (which, btw, the O.P. did NOT exclude from his q.): a) Identity (very common), b) Constraints, c) Triggers, d) Indexes, e) Permissions, d) copying Schema AND Data (Hint: the "and all" part of o.p.'s "(data and all)" implies Schema also.) and e) generates "SQL statement"'s which the o.p. specified which even if he didn't mean it literally is better to have than not. Commented Jun 14, 2017 at 21:50