sql server 2000: Short cut for getting stored proc text - tsql

what is the short cut to get entire text of the stored proc in query analyzer. I know that I could highlight table name and hit alt + F1 and get the entire table structure.

It seems to not exist a shorcut with your exact request. If you want to see the complete list of query analyzer shorcuts visit the folowing link:
http://msdn.microsoft.com/en-us/library/aa216992(SQL.80).aspx
Anyway you can modify, customize or create your own shorcuts.
For examle ALT+F1 just executes the "sp_help" stored procedure.
Check the documentation at:
http://msdn.microsoft.com/en-us/library/aa216956(SQL.80).aspx

You should be able to add a shortcut that uses sp_helptext, rather then sp_help

Related

When changing path in a ms word field to reference a new file, how can I get it to automatically update/refresh?

I have a document with over 1000 images (set a), each of which are sitting on separate folder and I am loading them into my word document by entering the path in a "field". The images get uploaded to the word document and displayed.
I have another 1000 images (set b), all of which are named in the exact same way, except that they all end a different letter (b instead of a). I have tried to take my pre-existing and working word document that displayed the first 1000 images (set a), and edit the path in the field so that they all reference the set b images. This change is easy to make as I just need to find and replace everywhere that the text image_a.pngappears with image_b.png.
However, when I do this, the images don't actually refresh and are instead still displaying all of the images from set a. I have played around with a lot of stuff like saving the document as and opening it again, and for a separate issue I had to enter and exit print preview for my number sequence to update, and I tried that for this issue, but that still doesn't help. The only thing that I have found that works is if I go to each field individually, right click on it and select "edit field" and then select ok, and then the correct image will be displayed. However this is not a practical solution because I would have to do this over 1000 times. Does anyone know what is going on here and does anyone know a way to refresh/update all of the 1000 images at once?
Thanks!
Try Ctrl+A followed by the F9 key. You may need to press an Fn key with the F9.
If you need something more nuanced, I can provide a macro. For that, I would need the name of the field being used.
You may want to look at Paul Edstein's tutorial on relative paths in fields.

Cross-reference list is empty in Word 2010

I have been given a Word file (.docx) that has about 35 figures and tables. When I try to add a cross-reference I get an empty list like this:
I made sure that:
1) The figures and tables are actually captions. If I delete anyone of them, the rest get updated as expected.
2) Other cross-references already in the file works. They get updated correctly like in (1)
3) The document doesn't have any 'track changes'. This is apparently a problem for some people, so I did an 'accept all changes'. Doesn't seem to help unfortunately.
4) I tried copy all and paste into a new file.
5) I tried selecting all and F9.
I'm perplexed why this is happening. Anyone can help me find the root cause?
I know that it is probably late, but maybe it will help somebody else.
Select caption below table/picture
Right click and select Toggle field codes - the caption show the code in format like SEQ xxx xxx
Go to Insert -> Reference -> Caption and click on New Label button
Insert the text following after SEQ from point 2. E.g. Fig.
Save the new label.
Go to Insert -> Reference -> Cross Reference - select the inserted value from point 4 in the Reference type dropdown list. Now you should see all the values.
The answer is based on the following link.
In Word 2013, instead of Insert>Reference>Caption, right click on a figure or table and select insert caption. A dialogue box including the option New Label will appear.
In my case, I think this issue arose because of changes in language. The tables are all captioned with the French Tableau, but in insert references, it had Table and a blank list.

See raw code/text from copy paste

I doing some formatting from copy/paste. When I copy a table from Word, and I want to insert it in my program, I need to edit the table formatting to show the info like I want.
When I copy from word I can view whats copy in clipboard magic:
Is there a way to get the formatting, or do I need to create a new table for scratch with the data listed in clipboard magic?
I Clipdiary the "copy" is read as HTML
This makes me wounder, is it possible to get the html code?
Yes, the HTML is present as CF_HTML. See reference on MSDN: http://msdn.microsoft.com/en-us/library/aa767917(v=vs.85).aspx
If you just want to SEE it, ClipMate has a Binary display that will show you a binary dump of the data. It's available in the trial version. If you don't see the Binary tab in the display window, turn it on in the Tools | Options | Editor dialog.

Why are values copied from returned grid marked with quotes?

In PgAdmin III, when I copy value from returned grid and paste it into the query text, it appears there in double quotes. But to use it in query, in where clause for example, it has to be marked with apostrophe. So I have to replace quotes with apostrophe. It is rather weird for me that I always have to do so. Why it is designed in such strange way?
This is a kind of stupid theoretical question, I do not expect any practical answers :)
You can customize the quoting character, by following the following steps.
On the PgAdmin-III main window, click on File and then Options
Click on the Query Tool Tab
Change the field called "Result copy quote character" to apostrophe (')
It should work, you may need to close and open PgAdmin-III
EDIT: For Mac OS X the option could be found in pgAdmin3 > Preferences > Query tool > Results grid
For pgAdmin 4 go to File> Preferences> SQL Editor> Results Grid. You can change the Quotation mark to single quote or none.

How to see the CREATE VIEW code for a view in PostgreSQL?

Is there an easy way to see the code used to create a view using the PostgreSQL command-line client?
Something like the SHOW CREATE VIEW from MySQL.
Kept having to return here to look up pg_get_viewdef (how to remember that!!), so searched for a more memorable command... and got it:
\d+ viewname
You can see similar sorts of commands by typing \? at the pgsql command line.
Bonus tip: The emacs command sql-postgres makes pgsql a lot more pleasant (edit, copy, paste, command history).
select pg_get_viewdef('viewname', true)
A list of all those functions is available in the manual:
http://www.postgresql.org/docs/current/static/functions-info.html
select definition from pg_views where viewname = 'my_view'
If you want an ANSI SQL-92 version:
select view_definition from information_schema.views where table_name = 'view_name';
Good news from v9.6 and above. View editing are now native from psql. Just invoke \ev command. View definitions will show in your configured editor.
julian#assange=# \ev your_view_names
Bonus. Some useful command to interact with query buffer.
Query Buffer
\e [FILE] [LINE] edit the query buffer (or file) with external editor
\ef [FUNCNAME [LINE]] edit function definition with external editor
\ev [VIEWNAME [LINE]] edit view definition with external editor
\p show the contents of the query buffer
\r reset (clear) the query buffer
\s [FILE] display history or save it to file
\w FILE write query buffer to file
In psql cli , you can use
\d+ <yourViewName>
\sv <yourViewName>
Output as follows:
\d+ v_ma_students
View "public.v_ma_students"
Column | Type | Collation | Nullable | Default | Storage | De
scription
--------+-----------------------+-----------+----------+---------+----------+---
SOMETHINGS HERE
View definition:
SELECT student.sno,
student.sname,
student.ssex,
student.sage,
student.sdept
FROM student
WHERE student.sdept::text = 'MA'::text;
Options: check_option=cascaded
\sv v_ma_students
CREATE OR REPLACE VIEW public.v_ma_students AS
SELECT student.sno,
student.sname,
student.ssex,
student.sage,
student.sdept
FROM student
WHERE student.sdept::text = 'MA'::text
WITH CASCADED CHECK OPTION
These is a little thing to point out.
Using the function pg_get_viewdef or pg_views or information_schema.views you will always get a rewritten version of your original DDL.
The rewritten version may or not be the same as your original DDL script.
If the Rule Manager rewrite your view definition your original DLL will be lost and you will able to read the only the rewritten version of your view definition.
Not all views are rewritten but if you use sub-select or joins probably your views will be rewritten.
In the command line client psql you can use following command:
\sv <VIEWNAME>
The straightforward way to find the 'CREATE TABLE ...' query is to use this query -
SHOW TABLE your_schema_name.your_table_name