how to auto generate sql query
-
Hey, I am just wondering whelther we can generate the sql query if we already have tables. Just curious about that. If yes, how to do it ??
suchita
-
Hey, I am just wondering whelther we can generate the sql query if we already have tables. Just curious about that. If yes, how to do it ??
suchita
With a little work SQL 2005 and SQL 2008 both have a GUI by right clicking the white space of the query analyzer. Or if you just want one table you can right click the table then click SELECT TOP 1000 Rows
-
What kind of queries are you looking for? Management Studio 2008 does provides the basic structure of the statements fora table.
like i created one table. lets say S.N | Name | PhoneNumb| Now this S.N is auto increment. I am testing my project and I need to reset table many times and since this S.N is auto increment, its value just kept on increasing. So what i'm doing is just deleting the table and re-creating the table manually. So i am just wondering that if i can generate the "create" sql query for the already existed table, then once i delete that table, i can re-run that create query to create that table again. Well I can write the query and re-run it. Thats not the problem but i am just checking if there is any that feature in sql server ??
suchita
-
like i created one table. lets say S.N | Name | PhoneNumb| Now this S.N is auto increment. I am testing my project and I need to reset table many times and since this S.N is auto increment, its value just kept on increasing. So what i'm doing is just deleting the table and re-creating the table manually. So i am just wondering that if i can generate the "create" sql query for the already existed table, then once i delete that table, i can re-run that create query to create that table again. Well I can write the query and re-run it. Thats not the problem but i am just checking if there is any that feature in sql server ??
suchita
-
How are you performing the testing? If you are using test projects, make use of TestInitialize and TestCleanUp methods to clean the data up from the tables used.
I am new to testing. I have just one ascx page and i am testing that page. I saw the example using that in http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.testinitializeattribute(VS.80).aspx[^] But I dont know how this links to empty the database tables.. ??
suchita
-
I am new to testing. I have just one ascx page and i am testing that page. I saw the example using that in http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.testinitializeattribute(VS.80).aspx[^] But I dont know how this links to empty the database tables.. ??
suchita
-
Hey, I am just wondering whelther we can generate the sql query if we already have tables. Just curious about that. If yes, how to do it ??
suchita
-
In Management Studio you can right click on any table and choose Script Table As and get a list of choices. If you choose Drop and Create that will give you the script to remove and recreate the table from scratch.