May 15, 2014 at 5:40 pm
Comments posted to this topic are about the item Productivity Keyboard Shortcuts
June 10, 2014 at 1:27 pm
Awesome!
I'm using SqlComplete and SqlCodeGuard and QuickMacros but this fills a hole left by those products.
Thank You.
June 22, 2014 at 11:35 pm
You can use,
ctrl + 6 for : select * from tablename
ctrl + 7 for : select count(*) from tablename
June 22, 2014 at 11:42 pm
For some queries/utility we can avoid dependency of this type of util procedure by writing query directly.
e.g.
for ctrl + 7 write : select count(*) from
now for any database connected in SSMS we can fire count command by press ctrl + 7 for selected table/view name.
by the way, your util procedure & its usage trick is awesome.
Thanks.
June 23, 2014 at 8:09 am
Here are my assignments if it helps you decide what to do with your open slots:
CRTL+1: sp_who
CRTL+2: sp_lock
CRTL+3: sp_who2
CRTL+4: sp_spaceused
CRTL+5: sp_monitor
CRTL+6: sp_tables
CRTL+7: sp_columns
CRTL+8: sp_stored_procedures
CRTL+9: sp_helptext
CRTL+0: select * from
June 25, 2014 at 10:27 am
We still have quite a few Sql Server login accounts and with frequent copying & restoring, have to deal with orphaned users. I assign this script to Ctrl+0. After restoring a db I start a new query in that db then hit Ctrl+0.
The Select produces the "sp_change_users_login" statements for any orphans. I like to see what is produced & then copy / paste into the query window for executing.
Declare @usrs as Table ([usr] [varchar](50) NULL,[usid] [varbinary](250) NULL);insert @usrs execute sp_change_users_login 'Report';select 'exec sp_change_users_login ''update_one'', ' + '''' + usr + ''',' +'''' + usr + ''';' from @usrs;
Formatted:
DECLARE @usrs AS TABLE (
[usr] [varchar](50) NULL,
[usid] [varbinary](250) NULL
);
INSERT @usrs
EXECUTE sp_change_users_login 'Report';
SELECT 'exec sp_change_users_login ''update_one'', ' + '''' + usr + ''',' + '''' + usr + ''';'
FROM @usrs;
October 23, 2015 at 7:09 am
Does not work. Your Declare statements are missing the @Object and @AddParam parameters.
October 23, 2015 at 7:15 am
this is great utility code. Can I share it on some wikis that I use?
412-977-3526 call/text
October 23, 2015 at 8:06 am
Hi Robert, sure you can, I have updated version of it, not sure why the old one is posted. I'll attach it soon
October 23, 2015 at 8:07 am
craig
thats the whole point you have to make a selection in the text editor
October 23, 2015 at 8:22 am
Latest version here:
https://drive.google.com/file/d/0B-5--YXA5WAGTXVHZmh6VHJDWTA/view?usp=sharing
October 26, 2015 at 2:28 am
I get an error:
Procedure or function 'Utils' expects parameter '@Object', which was not supplied.
October 26, 2015 at 5:52 am
Make a selection in text editor (ex: highlight a table name and press ctrl+3)
October 27, 2015 at 6:56 am
Thanks. I've done similar things with my shortcuts too.
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply