May 23, 2012 at 1:19 am
please tell any one , how i see the query which is used for creating a table
May 23, 2012 at 1:24 am
shubhamagrawal.107 (5/23/2012)
please tell any one , how i see the query which is used for creating a table
SQL Server does not keep the query used for creating a table.
But you can generate script if you need.
You can configure trigger to track DDL statements.
May 23, 2012 at 1:24 am
what are the requirements?
is it an object which exists on ServerA and you need to script it to move it to ServerB? If so right click the object and use the script object as
is it an object has been created and you want to know by who, when and how? If so check the default trace, it might be in there but it might not, query the system table you might get what you need, or impliment a custom DDL trigger
if its learning how to create table then look in your favourite search engine or BOL for the keywords CREATE TABLE
May 23, 2012 at 1:28 am
actually, i created a table before some time and now i want to see what query i used to create that table.
now tell me can i see the query.....
May 23, 2012 at 1:29 am
script the table using the script table as function when you right click the table
May 23, 2012 at 1:40 am
can you please give me the query as a example
May 23, 2012 at 1:42 am
there is no query, use SSMS, connect to server, expand database, expand tables, right click table, hover over script table as, click new query window
May 23, 2012 at 3:06 am
shubhamagrawal.107 (5/23/2012)
actually, i created a table before some time and now i want to see what query i used to create that table.now tell me can i see the query.....
Just follow these steps:
1. Open SSMS.
2. Connect to you Server.
3. Open Database you want to view in Tree View.
4. Open Tables in Tree View.
5. Right Click the table and select "Script Table As"-->"Create To"-->"New Query Window".
6. And Voilla!!!!!.....there you have your create table query. 😀
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply