Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Help with Visual Studio Shortcuts

I am using visual studio 2012 and im writing sql code in it. Is it possible to make a shortcut when i mark a text it will try to append that text to a SELECT * FROM statement so when i mark a table name and press ctrl + 1 it will select everything from that table
I don't fully understand your question, but you can add snippets of code/text to the toolbox if that's what you mean..?
its a snippet of code 'SELECT * FROM ' and when i mark lets say a table name 'mytable' and i run this snippet of code with my defined combination it will select everything from that table
sorta like concatenating the snippet with the marked text and executing it
I wouldn't use "SELECT " to begin with. Please please please always name the columns you want from the query and only query the columns you are actually going to use. I can't tell you how many times I've seen on JOIN queries to return 100+ columns only for the developer to use like 5...
I am using * because i will use this shortcut on objects which i would not know their column names also i just want to know the method of how to do this my example code is irrelevant
(Sep 22, 2014 06:08 AM)eXaByte Wrote:  I am using * because i will use this shortcut on objects which i would not know their column names

Ah snap.

I didn't consider that.

Are you using MSSQL or MySql?
(Sep 22, 2014 06:09 AM)ShadowCloud Wrote:  Ah snap.

I didn't consider that.

Are you using MSSQL or MySql?
im using visual studio to write tsql code because my project files need to be synced with others
(Sep 22, 2014 06:10 AM)eXaByte Wrote:  im using visual studio because my project files need to be synced with others

No I meant is the datasource MSSQL or Mysql?

I might need some more background information on this... but what I was going to is that you could select the columns from the sys tables...

Ctrl+K, Ctrl +B as per the above user should work well for you I imagine?
(Sep 22, 2014 06:13 AM)ShadowCloud Wrote:  No I meant is the datasource MSSQL or Mysql?

I might need some more background information on this... but what I was going to is that you could select the columns from the sys tables...

Ctrl+K, Ctrl +B as per the above user should work well for you I imagine?

my problem is not how to select the column names i just want to know the way how to be able to execute a statement when i have a piece of text which will represent the name of an object so that execute statement concatenates with the name without me having to write for example exec sp_helptext name_ of_my_proc
but only select the name of my proc and pressing lets say ctrl+3 and it will automanticly execute 'exec sp_helptext name_ of_my_proc'
(Sep 22, 2014 06:20 AM)eXaByte Wrote:  my problem is not how to select the column names i just want to know the way how to be able to execute a statement when i have a piece of text which will represent the name of an object so that execute statement concatenates with the name without me having to write for example exec sp_helptext name_ of_my_proc
but only select the name of my proc and pressing lets say ctrl+3 and it will automanticly execute 'exec sp_helptext name_ of_my_proc'

If you use a global keyboard hook (in the same fashion as a keylogger I imagine) you'd be able to make pretty much any combination do pretty much anything?

The snippet will work work adding the text in front of the name, don't think it will concat though.
(Sep 22, 2014 06:26 AM)ShadowCloud Wrote:  If you use a global keyboard hook (in the same fashion as a keylogger I imagine) you'd be able to make pretty much any combination do pretty much anything?

The snippet will work work adding the text in front of the name, don't think it will concat though.
it might not be possible with the built in functions of visual studio i thought it would be easy because this feature is built in the MSSMS and is quite easy and comfortable using it
(Sep 22, 2014 06:32 AM)eXaByte Wrote:  it might not be possible with the built in functions of visual studio i thought it would be easy because this feature is built in the MSSMS and is quite easy and comfortable using it

O you are talking about the query shortcuts...

Have a look at this: http://stackoverflow.com/questions/33646...xecute-sql

Is that what you were after?
(Sep 22, 2014 06:38 AM)ShadowCloud Wrote:  O you are talking about the query shortcuts...

Have a look at this: http://stackoverflow.com/questions/33646...xecute-sql

Is that what you were after?
No.
But i expect that my answer will be somewhere in the same menu
What i want to do is this
just in visual studio.

the example you showed will execute whatever i selected
in my example i will execute whatever i selected with a prefix command


Possibly Related Threads...
Thread / Author Replies Views Last Post
by brokenheartsJun 30, 2025 01:05 AM 29 1,083 Jun 30, 2025 01:05 AM
Last Post: HOMODIN
[Tutorial] by WhiteTVFeb 17, 2025 08:25 AM 0 114 Feb 17, 2025 08:25 AM
Last Post: WhiteTV
by HackersDec 11, 2024 05:11 PM 21 534 Dec 11, 2024 05:11 PM
Last Post: padrino