Parameters for open table

This is a discussion on Parameters for open table within the sqlserver-programming forums in Microsoft SQL Server category; 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...

Go Back   Database Forum > Microsoft SQL Server > sqlserver-programming

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-27-2008, 01:45 PM
Default Parameters for open table

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


Reply With Quote
  #2  
Old 08-27-2008, 02:00 PM
Default Re: Parameters for open table

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" wrote in message
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
>



Reply With Quote
  #3  
Old 08-27-2008, 02:07 PM
Default Re: Parameters for open table

correction:

select top 1000 * from

then click on the little exclamation mark icon.



"Jason Folkens" wrote in message
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" wrote in message
> 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
>>

>
>



Reply With Quote
  #4  
Old 08-27-2008, 02:18 PM
Default Re: Parameters for open table


"Jason Folkens" wrote in message
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" wrote in message
> 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
>>

>
>



Reply With Quote
  #5  
Old 08-27-2008, 02:34 PM
Default Re: Parameters for open table

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
Reply With Quote
  #6  
Old 08-27-2008, 03:03 PM
Default Re: Parameters for open table


"Roy Harvey (SQL Server MVP)" wrote in message
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



Reply With Quote
  #7  
Old 08-27-2008, 04:44 PM
Default Re: Parameters for open table

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
Reply With Quote
  #8  
Old 08-28-2008, 04:41 AM
Default Re: Parameters for open table

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/
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 07:28 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.