in visual studio, right click on table to select top 1000 rows
in the ssms object explorer, many of us regularly right click on tables to select top 1000 rows, which opens a new query window with an editable query script. visual studio's sql object explorer has no such functionality besides view data which forces you into a designer-based edit mode.
-
Pavel commented
Adam - I realize this is an old thread, but this is the only lead I have found on this topic, and I tried my best to follow your directions below. However, I'm little over my head. I think the big idea here is that you would put the code below into a template project of some kind, and then you call the template from a keyboard shortcut...but I'm not able to fill the gaps. Would you be willing to point us in the right direction on this? Thank you!
-
Adam commented
You can make yourself a master-based routine.
USE [master]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GOCreate PROC [dbo].[sp_Table1000]
@object sysname,
@horizontal tinyint = 1
ASSET NOCOUNT ON
declare @polecenie varchar(500), @proces varchar(50)
select @polecenie = 'select top 50 * from '+DB_NAME()+'.dbo.' +@object
execute(@polecenie)
then you go to Tools> Options> Environment> Keyboard> Query Shortcust and add the procedure name to the shortcut
now selecting the table name in the code and pressing the shortcut will show you 1000 records