| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| In Sql Server 2005, is there a way to set paramaters in open table. At the moment, it is giving me back all the rows. I am trying to set up some test data by copying/pasting rows and changes some selected fields which I can't do from a query. Is there a way to say, just give me the last 1000 rows? Thanks, Tom |
|
#2
|
| IF you feel comfortable making slight sql changes, after you right-click on the table and select "open", you can click on the SQL button (by default its in the upper left of management studio) and add a TOP clause EG... select top 1000 from "tshad" news:ucGfgRGCJHA.3496-at-TK2MSFTNGP03.phx.gbl... > In Sql Server 2005, is there a way to set paramaters in open table. At > the moment, it is giving me back all the rows. > > I am trying to set up some test data by copying/pasting rows and changes > some selected fields which I can't do from a query. > > Is there a way to say, just give me the last 1000 rows? > > Thanks, > > Tom > |
|
#3
|
| correction: select top 1000 * from then click on the little exclamation mark icon. "Jason Folkens" news:O$%238jZGCJHA.5656-at-TK2MSFTNGP04.phx.gbl... > IF you feel comfortable making slight sql changes, after you right-click > on the table and select "open", you can click on the SQL button (by > default its in the upper left of management studio) and add a TOP clause > > EG... > select top 1000 from > > > > "tshad" > news:ucGfgRGCJHA.3496-at-TK2MSFTNGP03.phx.gbl... >> In Sql Server 2005, is there a way to set paramaters in open table. At >> the moment, it is giving me back all the rows. >> >> I am trying to set up some test data by copying/pasting rows and changes >> some selected fields which I can't do from a query. >> >> Is there a way to say, just give me the last 1000 rows? >> >> Thanks, >> >> Tom >> > > |
|
#4
|
| "Jason Folkens" news:O$%238jZGCJHA.5656-at-TK2MSFTNGP04.phx.gbl... > IF you feel comfortable making slight sql changes, after you right-click > on the table and select "open", you can click on the SQL button (by > default its in the upper left of management studio) and add a TOP clause > > EG... > select top 1000 from > Actually, I am trying to get the last 1000 rows not the 1st 1000 rows. Thanks, Tom > > > "tshad" > news:ucGfgRGCJHA.3496-at-TK2MSFTNGP03.phx.gbl... >> In Sql Server 2005, is there a way to set paramaters in open table. At >> the moment, it is giving me back all the rows. >> >> I am trying to set up some test data by copying/pasting rows and changes >> some selected fields which I can't do from a query. >> >> Is there a way to say, just give me the last 1000 rows? >> >> Thanks, >> >> Tom >> > > |
|
#5
|
| On Wed, 27 Aug 2008 10:18:09 -0700, "tshad" wrote: >> select top 1000 from >> >Actually, I am trying to get the last 1000 rows not the 1st 1000 rows. In the ORDER BY use DESC (descending) to move the last ones to the front. Roy Harvey Beacon Falls, CT |
|
#6
|
| "Roy Harvey (SQL Server MVP)" news:qu3bb45ucr8ehqebjsc2d63en6b5mpf406-at-4ax.com... > On Wed, 27 Aug 2008 10:18:09 -0700, "tshad" > wrote: > >>> select top 1000 from >>> >>Actually, I am trying to get the last 1000 rows not the 1st 1000 rows. > > In the ORDER BY use DESC (descending) to move the last ones to the > front. Should do it. BTW, why can I change the fields if I change the script from the SQL button, but I can't if I do the same script in a normal query window? Thanks, tom > > Roy Harvey > Beacon Falls, CT |
|
#7
|
| On Wed, 27 Aug 2008 11:03:35 -0700, "tshad" wrote: >BTW, why can I change the fields if I change the script from the SQL button, >but I can't if I do the same script in a normal query window? I only use normal query windows for everything, so I don't even know what a SQL button is. I've never seen anything that can't be done in a normal query window. Roy Harvey Beacon Falls, CT |
|
#8
|
| If you want to modify the data and you care about it as well, you should NOT use the ridiculous data viewer/editor in SSMS. a) Design (and test!) a T-SQL script to modify data; or b) Use an appropriate client application that has been designed to handle your particular business case. Even for small and quick changes an appropriate T-SQL script is a much better choice compared to some generic tool. ML --- Matija Lah, SQL Server MVP http://milambda.blogspot.com/ |
![]() |
| Thread Tools | |
| Display Modes | |