how to find the real meaning of the specific field - sql-server

IT guy creates a field under view table. I want to know what the field meaning or the formula behind the scene for this field, such as BT_ACT_RECPTS.AVG_MATERIAL_COST. I want to know how to calculate the average material cost.
I'm using SQL management studio.
thanks.

With the GUI:
Or with code using the object_definition function.

Related

How to add a dropdown to datasheet form in MS Access which is based off a SQL Server query

I have a form in MS Access (datasheet view) which is based on the output of a SQL Server query. Now this is used in a front end where the user needs to be able to select from a drop down the value for one of the columns, 'NAME'. I tried adding a combo box which is mapped to take distinct names from the SQL Server table to the datasheet form but the results were not as desired.
Kindly provide advice on how this can be possible. I did this before by using a lookup on a similar MS Access database, but in a multi-user environment, the database was corrupted and now I moved my back end to SQL Server.
Just got the answer to my question. here are the steps I followed.
a) Add a combo box to the datasheet form in design view like Johnny Bones suggested.
b) Create a drop down with values.
c) Point the Control Source property to the field in the SQL Server table which needs to be updated, in this case NAME.
d) And voila, your drop-down now shows the values in the table and you can include a drop down for the user.
Thank you for pointing me in the right direction Johnny.
In datasheet view, I think you'll need to set up the field in the table.
Open the table in Design View
Click on the specific field in question
At the bottom you will see 2 tabs; General and Lookup (I
apologize, my work doesn't allow me to upload pics, so I hope you
can visualize it)
On the Lookup tab, change the Display Control from Text Box to
Combo Box
At that point, the properties should look familiar if you've worked with Combo Boxes, and you can change them to suit your needs.

Sharing report parameters between cubes and views/tables

Is it possible to share parameters between a DataSet based on Cubes, and a DataSet based on views/tables?
As my report currently is, I am filtering the DataSet based on cubes by setting the filter to be a parameter in the query designer. This produces the desired effect of cascading etc that one wants from a report based on cubes, and generates new parameters.
I have another DataSet that needs to be filtered using the same parameters, but based on views. I tried to use the following in the WHERE clause:
AND <FieldIdentifier> IN #<ParameterName>
This seems to filter the entire data set out. Has anyone had any problems with this before?
Any answers are really appreciated. If you need any more information, I will definitely provide it.
I don't think this will work due to the syntax differences between MDX and SQL the clause that you need in the parameters are different.
To solve this in the past I have use a report function function to make the conversion from the Rs parameter for the SQL and generate the correct MDX slicers. but this will require a bit of custom code and a good understanding of MDX.

Gather inserted text values from multiple rows in a report

I'm currently struggling with Oracle Apex.
I'm trying to create an application which enables customers to place their order. Therefore I create a report which lists the available products. Furthermore the report contains a column (the SQL query for that is simply '0' as "Quantity") which displays a text box. In this text boy the customer should be able to insert the required quantity.
I've create a screenshot to make it easier to follow me:
After the customer has fill out the form, the "Place Order" button will purchase the wished items then.
My question is now, how is it possible to read out in which text boxes did the user filled in a number and also to which product belongs it!
An easier solution would be to recreate the region but choose Form Region and then Tabular Form Region and then the wizard will help take care of the DML for you. But you need to use specific table columns for this to work.
To answer your question more directly - the input items defined in reports that are posted to the server can be accessed in PL/SQL as a set of "Global Arrays". These are defined as PL/SQL tables in the package apex_application with the names g_f01 through g_f50.
To be sure which of these arrays to use for the quantity text box you can look at the html of the page for the name attribute of the input tag. If it is f01 then you would be able to process the results by accessing each position or element in apex_application.g_f01.
To link the input with the table you would need some sort of key. If you use the wizard to build a Tabular Form all this headache is taken care of for you though.

Non editable field in database

Sorry for this lame question, but I really am a database newbie:
I want to store the date when I create a certain field on the database. Is there any attribute I can add to that date field so that it cannot be modified? I just want the date field to have the date when a field is created on never want to edit it.
I am using PostgreSQL.
Thanks.
There is no way to actually do this; however, if you want to make this occur you would perform a trigger on update for that specific table.field and throw a DBMS error. There might be a more elegant way to do this; but this is all I can think of to protect a specific value once it has been written.
I think PostgreSQL supports column level permissions. Check this : PostgreSQL 8.4 Feature List

Cross-reference Distance chart in SQL Server 2008 or Excel?

I would like to cross-reference construct a distance chart similar to the one here (example is a road-distance cross-reference chart) and, ideally, store the data in SQL Server 2008 (preferably the Express version). It needs these properties / abilities
Every column has a corresponding row with the same name (ie. not misspelled like my example).
Changing the value at one Row-Column intersection would update the mirror intersection (Column-Row) or the mirror data could be ignored.
The distance-values would need to be end-user editable.
The end-user would need to be able to add, delete or rename a column/row pair.
The end-user needs to be able to sort the columns and have the rows move automatically.
There could be hundreds of pairs.
a look-up query needs to find a distance given a start & destination (Row & Column)
The distance chart is reasonably straightforward to implement in Excel. Considering this, am I better off...
Using Excel as the user editing UI and then updating an SQL 'thing' with the new data?
Using Excel as the data-source even if it means performance issues with querying the data?
Using an as-yet undiscovered stroke of genius detailed here in an answer?
Sure looks like an Excel application to me, start to end. (heh)
I can't imagine your users typing enough data in to make performance an issue. Excel will only take 32757 rows by ditto columns. If that's enough, I'd say you're golden.

Resources