How to create list of a View's column names and source

Using SQL 2005, 2008, and 2012
How to create list of a View's column names and source. For the following example would like to @Print something like the following.  Does anyone already have some code to do this? I realize there are probably some gotchas, but the views that I am looking
at to use this follows the code snippet pattern below.
DBACCT.[Account Number]
dbo.ConvertDate(DBACDT). [Boarding Date]
DBXES.DBXES
CREATE VIEW [dbo].[v_ods_DBAL]
AS
SELECT DBACCT AS [Account Number], dbo.ConvertDate(DBACDT) AS [Boarding Date], DBXES
FROM dbo.ods_DBAL

The column information can be obtained from INFORMATION_SCHEMA.COLUMNS view using logic like below
SELECT c.COLUMN_NAME,c.DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS c
WHERE EXISTS (SELECT 1
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = c.TABLE_NAME
AND TABLE_TYPE='VIEW')
http://technet.microsoft.com/en-us/library/ms188348.aspx
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • How to create rtf template to view report in Word and Excel, with numeric f

    Hi,
    Please help me!
    How to create rtf template to view report in Word and Excel, with numeric formatted fields (like this 999 999 999,99 with spaces between numbers) and then end user be able to process those fields with Excel tools (sum, etc).
    Thank you.

    From what I have seen Excel can not handle 999 999 999.00. You can use 999999999.00 and then format it as you want in the xls bt you can not have values like 999 999 999.00 coming from publisher output and have functions on the values in Excel
    Tim

  • How to create new form fields in several columns (spreadsheet) and have them named consecutively?

    Hopefully someone can help.  I created a new form from an Excel spreadsheet, but the form field recognition didn't "take" well and very little of the spreadsheet translated into form fields.  I need to create new fields (31) for each column (about 10) and I want the fields in each column to have a keyword from the parent column and the fields numbered consecutively.  I'm really hoping I don't have to do this manually!
    Next, is there a way to total the values in a column of fields (the same as the SUM function in Excel?) or does the form user have to dig out a calculator and add everything?
    Can I create an email (submit) button and direct how (ie email) and by what method the form is sent?
    Once the form is completed, is there a way for the user to lock it before sending it - ie a button they could press to make it no longer fillable?  Or can I set the document to be a regular .pdf once it leaves the host machine?
    I think that's it!  Hopefully someone can help soon - this is a work project that could be potentially very time consuming if I have to create each form field manually.  Thank you for any assistance!
    Cheers,
    LostintheNorth

    LostintheNorth wrote:
    Rats!  Thank you for your link - I may take you up on that... however for the purposes of this form I'm more than halfway done, so I might as well keep plugging away.  A workaround I found was to creat 32 of something I only need 31 of, then delete the parent.  Somehow even playing with spacing on the "create multiple fields" option as the fields are being created only gets the vertical alignment close - no matter what I do I still end up manually aligning (vertically) 31 little boxes for each column so they fit visually.  Grrrr.
    Yes, this can be very tricky. If you don't get the exact right offset between each field, the difference will accumulate and after a while it will be completely off.
    You just have to play around with it, until you get it right. Or almost right, and then adjust it manually.
    Another thing I've noticed, is that when you select one field and right click for properties, you get an expanded version, as opposed to select/shift/enter for a bunch of cells only yields an abbreviated properties box - what's up with that?  Is there a way to change this?  For instance, I had set the properties for a column of 31 cells to be number, 1 decimal place.  Halfway through my project, the lady I am doing the favor for tells me she would like 2 decimal places, requiring me to manually change each box for 62 cells!  Apparently cell formatting is not an option in the abreviated properties dialogue!  Is there a fix for that?
    No, there isn't. Some propeties you have to set manually (or get right the first time, before copying and pasting...). There is a way to do it with a script, but it's a bit complex and requires using an undocumented method.
    This next question is a bit more complicated, and may not be possible.  The form I am creating is for payroll purposes, so at the moment it is generic (31 days) and the user fills in the month manually. Is it possible to get the form to recognize a month value (or create a pulldown menu with a selection of months to choose from) and limit the days accordingly?  Or better yet, run a calendar function so that weekends and stat holidays are highlighted on the affected row?  Kind of like what you can do with an Excel spreadsheet, which is what I designed the form in at the start (then printed to .pdf - the form field recognition did NOT work well on my spreadsheet!  hence me doing every cell manually).  Is this even possible, and if so, is it something I could learn to do?
    Yeah, it's possible, but requires quite a bit of scripting knowledge. If you wish, contact me personally (by PM or email at try6767 at gmail dot com) and I could possibly create this for you.
    If you want to do it yourself, you would have to learn a lot about both the Date object in JS and about the various date printing and scanning methods in Acrobat JS.

  • How to create the floating message view like Map app and Safari does?

    Hi, guys,
    I am trying to implement a information message view like the Map app and the Safari does.
    Here is the description:
    1. When you drop a pin in the Map app and then tap on the pin, you always can see a floating transparent message on the top of the pin.
    2. When you tap and hold on a link in the Safari app for a few seconds, you can also see a same message view like the Map app does and without showing the disclosure button.
    All I want is such kind of thing, but I had look through out the documentation and the Interface Builder components list. I can not find such a component.
    Does anybody has a similar experience on implement this?
    Thank you guys..

    You're not going to find a control to do this for you. You will have to create a subview and set the properties (color, frame, etc) yourself.

  • How to populate list in tree view  dynamically

    Hi,
    I am new to  Indesign Plugin creation.
    I want to create list in tree view dynamically.
    I tried wlistboxcomposite sdk sample in indesign cs4.
    I have some doubts in this.
    1. Can i write my own method in  WLBCmpTreeViewAdapter class because it's implements ListTreeViewAdapter
    If it's possible how can i call this method.
    2. In this example they populating static string in constructor like this
    WLBCmpTreeViewAdapter::WLBCmpTreeViewAdapter(IPMUnknown* boss):ListTreeViewAdapter(boss){
    K2Vector<PMString> lists;
    for (int32 i = 0; i< 12; i++){PMString name(kWLBCmpItemBaseKey);name.AppendNumber(i+1);name.Translate();lists.push_back(name);}
    InterfacePtr<IStringListData> iListData(this, IID_ISTRINGLISTDATA);}
    and this list is populating on loading time but my requirement is i have one button "get list" after clicking this button i have to populate the list, how can
    i achieve this.
    Pls do needful.
    Thanks
    Arun

    The TreeViewAdaptor is responsible for mapping your custom data to the tree view itself.  I almost always start by making it return some fixed number of objects with names "item 1" etc. That way you get the tree view working first.
    Then, after you get it laid out and displaying properly, you can worry about using real data.  At that point, you have your adaptor return the actual number of items in your list and each individual item.  Then you can populate your list when you push your button and then invalidate the IControlView of the tree view widget to cause it to redraw.  At that point your adaptor will get called and your data should appear.
    Jon
    "Expert for hire"

  • How to create EVENTS for a View Cluster.

    Hi Tech Gurus,
    I have created a view cluster on 5 tables. I need to do a validation and this can be done by using events. But i am unable to create a EVENT for the View Cluster. Could anyone please tell me how to create events for a View Cluster.
    Thanks in advance for your esteemed replies.
    Regards,
    Raghavendra Goutham P.

    Hello Pasapula
    When you are in the View Cluster maintenance dialog (SE54) click on dialog "Events".
    Below the field for the view cluster you have an additional field <b>FORM routines main program</b>. There you have to add the main program containing the FORM routines called by the VC events.
    For example: I had defined a normal report containing an include with all the FORM routines. The report contains only the following lines of coding:
    report zus_0120_u1.
    * Common Data und access routines for user exits in VC maintenance
    include LSVCMCOD.
    include  zus_0120_f1. "FORM routines for VC events
    Now in the "Events" dialog of the view cluster maintenance you assign your FORM routines to the events.
    Regards
      Uwe

  • How to create variant for table/view ?

    Hi,
    When I go through SM30, I find a radio button called variant. I don't know the effect.
    Can anyone tell me how to create variant for table / view ?
    I want to know when we need to create variant for table/view.
    Best regards,
    Chris Gu

    hi ,
    Whenever you start a program in which selection screens are defined, the system displays a set of input fields for database-specific and program-specific selections. To select a certain set of data, you enter an appropriate range of values.
    For further information about selection screens, refer to Selection Screens in the ABAP User's Guide.
    If you often run the same program with the same set of selections (for example, to create a monthly statistical report), you can save the values in a selection set called a variant
    Procedure
    To create a new variant:
           1.      On the ABAP Editor initial screen, enter the name of the program for which you want to create a variant, select Variants, and choose Change.
           2.      On the variant maintenance initial screen, enter the name of the variant to be created.
    Note the naming convention for variants (see below).
           3.      Choose Create.
    If the program has more than one selection screen, a dialog box for screen assignment appears. The dialog box does not appear if the program only has one selection screen. The selection screen appears in this case.
           4.      If there is more than one selection screen, select the screens for which you want to create the variant
    5.      Choose Continue.
    The (first) selection screen for the report appears.
    If your program has more than one selection screen, use the scroll buttons in the left-hand corner of the application toolbar to navigate between them and to fill the fields with values. If you keep scrolling forwards, the Continue button appears on the last selection screen.
           6.      Enter the desired selection values, including multiple selection and dynamic selection.
           7.      Choose Continue.

  • How to create a left join view in se11??

    I would like to create a view which contains KNA1,KONA,KNVV,KNVH(four tables) , I want to use this view to create a search help for Tcode 'VBO3'.
    but when I join table KNVH, there is no data in view, because there is no customer hierarchy, so I want to create a left join view. could you please tell me how to create a left join view? Thank you very much.

    Hello,
    yes, in general, maint. view and help view could be created as outer join view.
    but it should obey relationship.
    my fourt tables:
    KONA -
    > I want to get agreement number and type from this table
    KNA1 -
    >I want to get customer name, city, country from this table
    KNVH -
    >I want to get customer hierarchy from this table.
    KNVV -
    >I want to get customer group 1 from this table.
    but in help view, I can only get relationship between KONA and KNA1.
    I could not find the relationship for KNVH and KNVV.
    if it's required to add a search help exit, then how to write the code in the function?
    Could somebody please give me any solutions? thank you.

  • How to create a domain index on NCLOB Column

    hi all,
    My database version is 10.2.0.1.
    Any body know how to create a domain index on nclob column.
    SQL> alter table test add (nclob1   nclob);
    Table altered.
    SQL> CREATE INDEX test_nclob ON test (nclob1) indextype is ctxsys.context
      2  /
    CREATE INDEX test_nclob ON test (nclob1) indextype is ctxsys.context
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-10509: invalid text column: NCLOB1
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 364Regards
    Singh

    Any body know how to create a domain index on nclob columnNot possible per design/documentation:
    The column that you specify must be one of the following types: CHAR, VARCHAR, VARCHAR2, BLOB, CLOB, BFILE, XMLType, or URIType.
    «

  • How to create PDF with Form Builder (T-Code:SPF) and how to use it?

    How to create PDF with Form Builder (T-Code:SPF) and how to use it? Is there anyone can show me some doc. or PA material ? << removed >>  Thank you very much!!
    Edited by: Rob Burbank on Nov 11, 2010 1:04 PM

    PDF forms also known as Adobe From or Interactive Forms.
    Check this link -
    Interactive Forms
    REG:ADOBE FORM
    Adobe forms
    Regards,
    Amit

  • How to list column names and data types for a given table using SQL

    I remember that it is possible to use a select statement to list the column names and data types of databaase tables but forgot how its done. Please help.

    You can select what you need from DBA_TAB_COLUMNS (or ALL_TAB_COLUMNS or USER_TAB_COLUMNS).

  • How can I list my iphoto library by file name only?

    How can I list my iphoto library by file name only?

    There are two apps that can do that for your.
    1 - the better of the two is  iPhoto Library Manager.  You will have to manually select those Events in Library A that are not in Library B and copy them to B.  Then do the same for B to A.  This also copies both the original and edited versions, keywords, titles, descriptions, faces and places.
    2 - the second app is SyncPhotos.  This one is automatic and will copy the original images in A that are not in B into B and the same for B to A. This does not copy edited versions or any of the metadata, i.e. keywords, etc.

  • ....how to create table maintanence generator for a z table and how to use

    Hi...
    3....how to create table maintanence generator for a z table and how to use that for transfering a selected records to one server to another server.
    thanks and regards,
    k.swaminath reddy

    Hi,
    Table maintanance Generator is used to manually
    input values using transaction sm30.The Table Maintenance Generator is used to create table maintenance program to add, modify or delete records in the database table. This can be accessed using transaction SE54 or in SE11 using the menu Utilities->Table Maintenance Generator
    <b>
    Follow below steps</b>
    go to se11 check table maintanance check box under
    attributes tab
    utilities-table maintanance Generator->
    create function group and assign it under
    function group input box.
    also assign authorization group default &NC& .
    select standard recording routine radio in table
    table mainitainence generator to move table
    contents to quality and production by assigning
    it to request.
    select maintaience type as single step.
    maintainence screen as system generated numbers
    this dialog box appears when you click on create
    button
    save and activate table
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
    One step, two step in Table Maintenance Generator
    Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
    Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
    please check the link for getting information about table maintenance generator !
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=use%20of%20table%20maintenance%20generator&cat=sdn_all
    http://www.sapdevelopment.co.uk/tips/tips_tabmaint_tcode.htm
    http://www.sap-img.com/abap/create-a-table-maintance-program-for-a-z-table.htm
    Regards,
    Priyanka.

  • How to create a graph representing a big tree(parents and children are know

    How to create a graph representing a big tree(parents and children are known)?
    Thank you so much!
    Also, I need to write the graph into a jpg/gif file or display the graph in the web browser.
    I got a code from JGraph and can create the graph I want, although unextendable. However, JGraph define the graph as class Gscene instead of Img or BufferedImg or RenderedImg. Therefore, I couldn't use ImageIO.write(image, ext, file) to write the graph into a jpg file.

    aiGrace wrote:
    How to create a graph representing a big tree(parents and children are known)?Hierarchical data structures are covered here all the time. Please search before you post. This topic has been covered over and over.
    Thank you so much!
    Also, I need to write the graph into a jpg/gif file or display the graph in the web browser. I got a code from JGraph and can create the graph I want, although unextendable. However, JGraph define the graph as class Gscene instead of Img or BufferedImg or RenderedImg. Therefore, I couldn't use ImageIO.write(image, ext, file) to write the graph into a jpg file.Did you read the JGraph API? I'm guessing it exposes a method to get the image data somehow.

  • Reading MS Project column names and data on the fly from a selected View

    Hi guys,
    I have several views on my project file (MSPROJECT 2010) and I want to build a macro so that;
    1. User can select any view ( Views can have diffrent columns and the user may add new columns as well)
    2. User runs the Macro and all the coulmns along with the tasks displayed in the view will be written to a excel file. ( I don't want to build several macro's for each view, I'm thinking of a common method which would work for any selected view)
    The problem I'm facing is that how will i read the column names and data for a particular view on the fly without hard coding them inside the vba code ?
    The solution needs to work on a master schedule as well.
    Appreciate your feedback.

    Just to get you started the following code writes the field name and data for the active task to the Immediate window.
    Sub CopyData()
    Dim fld As TableField
    For Each fld In ActiveProject.TaskTables(ActiveProject.CurrentTable).TableFields
    If fld.Field >= 0 Then
    Debug.Print Application.FieldConstantToFieldName(fld.Field), ActiveCell.Task.GetField(fld.Field)
    End If
    Next fld
    End Sub
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

Maybe you are looking for