URL to make SSMS start and connect to a db? - sql

It would be nice to have a bunch of reference links somewhere, that could also be used to start SSMS.
Is this possible? and get it to use an already open instance?
e.g. sqlwb -E -S Server\instance
but I'm not sure if you can do this in the form of a URL
i.e. how to make a URL run CMD

Right click on your shortcut for SSMS (or copy existing one),i.e. that thing on which you click to open SSMS.
Open Properties --> tab Shortcut.
Add options to target text box
For ex., I have:
"D:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe" -nosplash -S localhost -d _A
to avoid splash, to connect automatically to database __A, etc.
You will get help by adding non-existent option
, pressing OK, double-click shortcut

I'm not sure you can do this in a URL directly, but you could certainly create URLs to .cmd batch files (in the form of a UNC path) which contained the relevant commands.

To make a "url" run a cmd file, format it in this way:
file:///c:\folder path\myfile.cmd
If you want to embed one of these file links in a document (like Word or email) then you may need to add angle brackets around it:
<file:///c:\folder path\myfile.cmd>
and the editor will make it into a link automatically. (alternatively you could just highlight some text, right click and create a file hyperlink using the first syntax).

Launching executables from URL is a very bad idea and a security hole. I advise to avoid doing this for many reasons.

Related

Set define off permanent

When running queries in SQL Developer and using the character & in my literals, a popup appears asking me to provide a variable. I then execute SET DEFINE OFF; and I can run my query for the rest of the session.
Is there any way to configure Oracle so it can never ask for manual variables when containing the & character?
Create a text file on your PC which contains set define off and any other set-up instructions you might want.
Then in SQL developer, go to the Tools menu and pick the Preferences... option. In the panel on the left click on Database.
Then either type the path to the file you created, or click Browse and navigate to the file in the 'Select connection startup script' dialog that appears.
That script will then be run every time you connect to any database.
Put SET DEFINE OFF into
login.sql (so that it works for you only, i.e. use user profile file), or
glogin.sql (so that its affect is global, i.e. use site profile file)

How can script the rename of pane in tmux to reflect the current directory?

I'd like to make a quick key in TMUX that queries the current directory and makes some portion of it the name of the pane window. Normally, I rename the pane window with ctrl-b , only to then add some indication about the where it is in the file system. It might be nice if I could both automate it putting the name there or even have new pane window open with this title.
So how can script a new keyboard shortcut like ctrl-b T that will add the title?
You can use #{pane_current_path} on most platforms (not OpenBSD) to get the pane's working directory. So you can do for example "tmux renamew '#{pane_current_path}'" to rename a single window, or put it in automatic-rename-format to automatically include it in every window name.
You might find the = modifier to be useful to trim the path (look at FORMATS in the manual).
If you want it to be shortened more intelligently your best bet is to rename it to $PWD from the shell prompt either with "tmux renamew" or by turning on allow-rename and using the rename escape sequence \033k$PWD\033\.

How to get the SQL query from a file in SSIS

I'm new to SSIS. I have a DataBase from which i'm getting the data. Suppose DB is the source and destination may be anything. (I tried DB to Excel and it worked fine)
In the source i have a custom query to get the data. I have written that in the properties.
Now i want to change it. I want to put it in some configuration file (xml file). i.e., i want to
get the query of the source from the xml file. How can i do this?
I'm a complete newbie trying the things. So please give your answer specifically.
UPDATE:
This is my package
I double clicked the OLE DB source. Now This is what i written there
I want to put the query (select id, age from emp where exp > 4), in a configuration(xml) file.
Create a package level variable for your query:
Change your source editor to use SQL command from variable (with appropriate variable) instead of SQL command:
Go to the SSIS menu and click "Package Configurations..." then click the checkbox to Enable package configurations, then click the "Add..." button.
... By default, it uses an XML Configuration file, which is probably easiest to work with. Specify a filename - the file extension is .dtsConfig. If the file doesn't exist on your machine, it will create one for you. Click Next.
Find your Variable, find the Value property for the variable, and check the box for it. Click Next.
Choose a name for your configuration. Click Done, then click Close in the Package configuration list, making a note of where on your file system you saved your configuration file.
Find the configuration file on your file system. Right-click and edit with an XML editor as needed.

how do i change default sources folder in Netbeans 7.1.2

Does anybody know how to change the default sources folder in Netbeans 7.1.2
I've looked through the files but can't seem to locate where the default directory is stored - I have been through the forums but can't find anything useful..?
currently C:\Users\wayne\Documents\NetBeansProjects\PhpProject7
I have read that if you select a different directory then that becomes the default - this is not the case on my installation
Thanks
If you are using Windows 7 or vista, you are gonna find it here C:\Users\YourUserName\AppData\Roaming\NetBeans\7.1.2\config\Preferences\org\netbeans\modules\projectui.properties.
However if you you are using windowsXP remember the USERPROFILE enviromental variable is not Users but rather Documents and Settings. Enviromental variables change depending on the operating system you are using. To know whats the USERPROFILE variable for yours just open a command prompt window and type SET USERPROFILE. Or you can simply type %USERPROFILE%\AppData\Roaming\NetBeans\$ENTER_YOUR_NETBEANS_VERSION_NUMBER_HERE\config\Preferences\org\netbeans\modules\projectui.properties and that will send you to the correct directory.
It's actually pretty simple.
"C:\Users\wayne\.netbeans\7.1.2\config\Preferences\org\netbeans\modules there is a file called projectui"
is right on the money, but he forgot one detail that you need to keep in mind for changing the directory. If you want to set the default project folder to (in my case):
"C:\Program Files\glassfish-3.1.2.2\glassfish\domains\domain1\docroot"
then you have to double the slashes. Instead of the above link you have to put:
"C:\\Program Files\\glassfish-3.1.2.2\\glassfish\\domains\\domain1\\docroot"
without spaces. I had it that way originally but it hid one of each of them.
In newer versions, right-click on the project you want to move in the 'Projects' tab, and then click 'Move'. This will allow you to move the project to a new directory.
Tip! I found (on Windows 7) that the AppData folder is hidden, so doesn't appear in windows explorer files by default .
To make it visible, open a window for the USERPROFILE directory as above, and use
Organize ->
Folder and Search Options ->
View (tab) ->
Advanced settings list ->
Hidden files and folders radio button to show them.
(Or you can open it via search or run if you type it right)
I hope that saves you the several hours it cost me...

VB.NET call desktop application from 2 shortcuts - supply different parameters

I have a desktop application which reads files from a specified folder, then deposits the files to a folder in a third party document management system based on criteria that the user provides.
My question is:
is it possible to somehow provide different parameters to the code, depending on which shortcut of the application the user clicked on to start it up?
You can add command line parameters to a shortcut icon. Here's how you can do it in Windows:
On the Start Menu, navigate to Notepad.
Right click on Notepad and choose Send To > Desktop (Create Shortcut)
Right click on the newly-created desktop icon and choose Properties
Add your command line parameters to the Target text box.
For example, if you want notepad to open up the hosts file, this would be the content of Target property:
%SystemRoot%\system32\notepad.exe "C:\WINDOWS\system32\drivers\etc\hosts"
You can put pretty much anything into the Target property of a shortcut that you would put into a command line.
Yes.
The easiest way would be to have the shortcut pass those parameters in via the command line.
You could also use conditional compilation variables, and have 2 different .exes. You should be able to find samples of both approaches (command line and conditional compilation variable) in help.