How can I get the cursor value from a waveform graph

 Is there a way to get the value of cursor position on the waveform graph so mathematical calculations be performed on those values. We can see the value in cursor legend, but can we extract those values for future calculations in the block diagram somehow.

Right-click on the waveform graph icon.  Select Create>Property Node>Cursor>Cursor Position.  That spits out a a xy cluster for the current cursor position.
If you have more than one cursor, you can either set up a loop and set the Active Cursor property node (right click the property node and select "Change to Write") or you can pull everything you ever wanted to know about every cursor with the Cursor List property node. 

Similar Messages

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • How can I get the edited value from the editor in JTable

    I have a JTextField added as an editor to a cell in JTable.
    I value gets changed when I press enter.
    but in actionPerformed of the JTextField when I say
    String txtEditorValue = txtEditor.getText();
    I am getting the old value. How can I get the edited value? Thanks.

    Hi,
    I guess, your understanding of how JTable works together with its models is not good enough - for example the method getTableCellEditorComponent(...) of the TableCellEditor interface is used to get the component, that should be used as editing component - its second parameter is a value that should be used to setup the editing component - it is normally not the editing component itself.
    JTable uses an underlying TableModel to store the cell values - if you have edited a cell, JTable gets the value of the editing component by itself and stores it in the TableModel using its setValueAt(...) method. To retrieve this data you only need to query the TableModel using row and column of this cell as parameters
    say jt is your JTable, and row and column are the row and column of the cell - so to get the value, simply use
    Object obj = jt.getModel().getValueAt(row,column);
    if you know, that there is a String in this cell use
    String str = (String) jt.getModel().getValueAt(row,column);
    The editor component is used for the view of the JTable - you only want the data, which is stored in the model - you don't have to deal with the GUI components in this case.
    greetings Marsian

  • How can i get the random values from database?

    Hi,
    i want to get random values from database.
    I try my best find no solution
    plz give solution in either sql query or java method.
    thanks in advance.

    try this:
    Give a numeric row-id to each row of database.
    say (1-100) for 100 rows
    In the program use random function to get random number between 0 and 1. this value u multiply with 100(or total number of rows) and take integer value of it . u then perform sql query to select the a row which matches randomly genarated value with row-id assigned to each row of database
    madhu

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • How can I get the default value of a particular preference programatically. I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.

    <blockquote>Locked by Moderator as a duplicate/re-post.
    Please continue the discussion in this thread: [tiki-view_forum_thread.php?comments_parentId=702631&forumId=1]
    Thanks - c</blockquote>
    == Issue
    ==
    I have a problem with my bookmarks, cookies, history or settings
    == Description
    ==
    How can I get the default value of a particular preference in FireFox?.
    I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.
    I see some that there are values for preferences in firefox.cs but I am not certain that these are being used as the default values for preferences. prefs.js in user's profile only has the updated values and not the default values.
    Any help towards acheiving this programtically is greatly appreciated.
    If the default values are stored in a file, kindly let me know the format in which it is stored for me to parse it programatically.
    == User Agent
    ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

    Dear Friend,
    Here when you have the callableSattement as ?=proc(?), the first ? is an output parameter. So you should register it as out parameter using registeroutparameter.
    Then you can get the value from the outparameter using callablestatement.getXXX().
    Try that way.
    For free tral versions of JDBC Drivers go to www.Atinav.com

  • How can I get the cursor's position in a opened file and display a menu?

    Hello,
    I want to make a program by which I will be able to display a panel/pops up menu at the corsor's current position, (In any text/doc file or in the desktop, we can display a menu by right click of the mouse.) Now I want my program to do the same task.
    More clearly-
    1. First I would save some words or sentences in a file(aa.txt).
    2. Then I would open another text file/ a word/ excel/ or any other editor( bb.txt / cc.doc / dd.xls / ee.html ).
    3. While editing or writing something in the opened file, if I click the right mouse button/ press a key (ctrl+space), a menu will appear containing the sentences I saved in the file(aa.txt) previously.
    My program will tell me the cursor's position in bb.txt / cc.doc / dd.xls / ee.html that i opened. And display a menu. my problem is not reading / writing in a file.
    My problem is how can I get the cursor's position in a opened file display a menu at that position by a mouse/key action*.
    Would you please help me on this regard.
    Thanks

    DrClap wrote:
    I think the OP wants to start up an application like MS Word and then operate it from a Java program.Doesn't The Monkey's Paw do that? What a second, according to Wikipedia:
    [http://en.wikipedia.org/wiki/The_Monkey%27s_Paw]
    <quote>
    ...the paw of a dead monkey is a talisman that grants its possessor three wishes, but the wishes come with an enormous price.
    The moral of the story is contained in this description of the paw: "It had a spell put on it by an old fakir," said the sergeant-major, "a very holy man. He wanted to show that fate ruled people's lives, and that those who interfered with it did so to their sorrow."
    </quote>
    So I guess that a non-sequitor ... or is it?

  • How can I get the "text" field from the actionEvent.getSource() ?

    I have some sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class JFrameTester{
         public static void main( String[] args ) {
              JFrame f = new JFrame("JFrame");
              f.setSize( 500, 500 );
              ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
              buttonsArr.add( new JButton( "first" ) );
              buttonsArr.add( new JButton( "second" ) );
              buttonsArr.add( new JButton( "third" ) );
              MyListener myListener = new MyListener();
              ( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
              JPanel panel = new JPanel();
              panel.add( buttonsArr.get( 0 ) );
              panel.add( buttonsArr.get( 1 ) );
              panel.add( buttonsArr.get( 2 ) );
              f.getContentPane().add( BorderLayout.CENTER, panel );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.setVisible( true );
         public static class MyListener  implements ActionListener{
              public MyListener() {}
              public void actionPerformed( ActionEvent e ) {
                   System.out.println( "hi!! " + e.getSource() );
                   // I need to know a title of the button (which was clicked)...
    }The output of the code is something like this:
    hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
    border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
    flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
    disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
    right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
    rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
    I need this: "first" (from this part: "text=first" of the output above).
    Does anyone know how can I get the "text" field from the e.getSource() ?

    System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
    In a real-world application, no.
    In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
    In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
    All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
    Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button).

  • How can i get the max rpm from cpu fan??

    how can i get the max rpm from my cpu cooler regarding that i don't have a speed controller attached to the cpu fan ,,, ??  please make things clear for me
    thanks

    if you have not reduced it by using a speed controller either hardware or software or by the 7v mod its already going as fast as it will at 12 v dc you cannot speed it up only slow it down
    need more air get a different cooler/fan

  • How can I get the edited pictures from the thumbnails to full size?

    I upgraded to iPhoto 11, the thumbnail photos show my previous edits, but when I click on the photo to make it bigger, it reverts back to the unedited, original picture.  How can I get the edited pictures from the thumbnails to full size?

    Verify you are using iPhoto11 ver 9.5
    if not run the >Software update or check your apps folder and make sure the correct iPhoto is launched,  not an older ver.

  • How can I get the XML structure from a flat structure?

    Hi all,
    in my XI SP 12 I use a JMS adapter to read information using the WebSphereMQ transport protocol.
    The structure that I receive have this format:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value>
    <NumberRecordType_B><NumberRecordType_c>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    the problem is that in this structure each line is not separated by a carriage return or a comma, I have all the information in a single line:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value><NumberRecordType_B><NumberRecordType_c><Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>...<Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value><Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>...<Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    and the customer don't want to insert a line separator.
    Then, the question is:
    How can I get the XML structure from this structure?
    If possible, I don't want to develop new Module and add it in the JMS Module Sequence.
    PS I have already read the article "How to Use the Content Conversion Module with the XI 3 J2EE JMS Adapter.pdf" and it doesn't seem to help me.
    Best Regards,
    Paolo

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • How can i get the source code from java concurrent program in R12

    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    Zulqarnain

    user570667 wrote:
    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    ZulqarnainDid you see old threads for similar topic/discussion? -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Java+AND+Concurrent+AND+Source+AND+Code&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • How can I get the data back from my game

    How can I get the data back from minecraft if I deleted the app and bought with a different Apple ID

    No, they are tied to the ID that purchased them, and cannot be transferred to anyone else.

  • In Jsp TagLib how can I get the Attribute value (like JavaBean) in jsp

    Dear Friends,
    TagLib how can I get the Attribute value (like JavaBean) in jsp .
    I do this thing.
    public void setPageContext(PageContext p) {
              pc = p;
    pc.setAttribute("id", new String("1") );
              pc.setAttribute("first_name",new String("Siddharth")); //,pc.SESSION_SCOPE);
              pc.setAttribute("last_name", new String("singh"));
    but in Jsp
    <td>
    <%=pageContext.getAttribute("first_name"); %>
    cause null is returing.
    Pls HELP me
    with regards
    Siddharth Singh

    First, there is no need to pass in the page context to the tag. It already is present. How you get to it depends on what type of tag:
    Using [url http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/SimpleTagSupport.html]SimpleTagSupport
    public class MyTag extends SimpleTagSupport
      public void doTag()
        PageContext pc = (PageContext)getJspContext();
        pc.setAttribute("first_name", "Siddharth");
        pc.setAttribute("last_name", "Singh");
        pc.setAttribute("id", "1");
    }Using [url http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/TagSupport.html]TagSupport or it's subclass [url http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/BodyTagSupport.html]BodyTagSupport the page context is aleady declared as an implicit object:
    public class MyTag extends TagSupport
      public void doStartTag()
        pageContext.setAttribute("first_name", "Siddharth");
        pageContext.setAttribute("last_name", "Singh");
        pageContext.setAttribute("id", "1");
    }In each case, this sort of thing should work:
    <mytags:MyTag />
    <%= pageContext.getAttribute("first_name") %>I

  • How can i get the parent value by sum of the child value of billing of material by using with cte

    I want to sum every parent recursively to the top of parent for example
    So far i got all relation between parent and child
    but I can t get the sum value of all parent in every levels ,
    This is what i get so far 
     WITH EmpCTE( MS_ID ,  MMS_ID , Qty , FLG , lvl)
                        AS
                        SELECT        Child_Code, Parent_Code , Cast(1 as float) ,  GSS_HR_COSTRELATION.FLG  , 0 AS lvl
                        FROM            GSS_HR_COSTRELATION
                        WHERE Child_Code  =  '01'
                        UNION ALL
                        SELECT        Child_Code, Parent_Code , Cast(1 as float) , E.FLG  , M.lvl + 1
                        FROM            GSS_HR_COSTRELATION AS E
                        JOIN EmpCTE AS M  ON E.Parent_Code = M.MS_ID WHERE  E.FLG is null
                        SELECT  A.Cost_ID , MS_ID  , A.Cost_CODE , A.Cost_name ,  MMS_ID , FLG , ISNULL(A.TOTAL , 0) As Cost , Cast(A.month AS nvarchar) As month , lvl From EmpCTE  LEFT join
                        SELECT  Cost_ID , Cost_CODE , Cost_Name ,  Sum(QTY*PRICE) AS TOTAL ,month(DateCreated) AS month
                        FROM            GSS_HR_COSTCENTER LEFT JOIN
                        GSS_AC_WTHDRAW ON GSS_HR_COSTCENTER.Cost_ID = GSS_AC_WTHDRAW.line_id
                        GROUP BY Cost_ID , Cost_Name , Cost_CODE ,month(DateCreated) ) A ON A.Cost_code = EmpCTE.MS_ID Order by lvl , A.Cost_CODE
    Thanks
    I am using Sql server 2012 
    this is my script of my database (include data)
    USE [SMEDB]
    GO
    /****** Object:  Table [dbo].[GSS_AC_WTHDRAW]    Script Date: 11/23/2014 3:31:31 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[GSS_AC_WTHDRAW](
    [MATID] [int] IDENTITY(1,1) NOT NULL,
    [MATNO] [nvarchar](50) NULL,
    [STPRICE_ID] [int] NULL,
    [MS_CD] [nvarchar](50) NULL,
    [QTY] [decimal](16, 2) NULL,
    [PRICE] [float] NULL,
    [DateCreated] [datetime] NULL,
    [Name] [nvarchar](50) NULL,
    [DeptID] [int] NULL,
    [CreatedID_by] [int] NULL,
    [JvHeader_ID] [int] NULL,
    [line_id] [int] NULL,
    [createby] [nvarchar](50) NULL,
     CONSTRAINT [PK_GSS_AC_WTHDRAW] PRIMARY KEY CLUSTERED 
    [MATID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    /****** Object:  Table [dbo].[GSS_HR_COSTCENTER]    Script Date: 11/23/2014 3:31:31 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[GSS_HR_COSTCENTER](
    [Cost_ID] [int] IDENTITY(1,1) NOT NULL,
    [Cost_code] [nvarchar](50) NOT NULL,
    [Cost_name] [nvarchar](50) NULL,
    [Dept_ID] [int] NULL,
    [DeptGroup_ID] [int] NULL,
     CONSTRAINT [PK_GSS_HR_COSTCENTER] PRIMARY KEY CLUSTERED 
    [Cost_code] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    /****** Object:  Table [dbo].[GSS_HR_COSTRELATION]    Script Date: 11/23/2014 3:31:31 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[GSS_HR_COSTRELATION](
    [Relation_ID] [int] IDENTITY(1,1) NOT NULL,
    [Child_Code] [nvarchar](50) NULL,
    [Parent_Code] [nvarchar](50) NULL,
    [FLG] [int] NULL
    ) ON [PRIMARY]
    GO
    SET IDENTITY_INSERT [dbo].[GSS_AC_WTHDRAW] ON 
    INSERT [dbo].[GSS_AC_WTHDRAW] ([MATID], [MATNO], [STPRICE_ID], [MS_CD], [QTY], [PRICE], [DateCreated], [Name], [DeptID], [CreatedID_by], [JvHeader_ID], [line_id], [createby]) VALUES (1002, N'1411-0130', 1385, N'9101101', CAST(200.00 AS Decimal(16, 2)), 18,
    CAST(0x0000A3DB00000000 AS DateTime), N'0', 13, NULL, NULL, 49, NULL)
    INSERT [dbo].[GSS_AC_WTHDRAW] ([MATID], [MATNO], [STPRICE_ID], [MS_CD], [QTY], [PRICE], [DateCreated], [Name], [DeptID], [CreatedID_by], [JvHeader_ID], [line_id], [createby]) VALUES (1003, N'1411-0130', 1466, N'910201', CAST(50.00 AS Decimal(16, 2)), 18, CAST(0x0000A3DB00000000
    AS DateTime), N'0', 13, NULL, NULL, 49, NULL)
    INSERT [dbo].[GSS_AC_WTHDRAW] ([MATID], [MATNO], [STPRICE_ID], [MS_CD], [QTY], [PRICE], [DateCreated], [Name], [DeptID], [CreatedID_by], [JvHeader_ID], [line_id], [createby]) VALUES (1004, N'1411-0131', 1456, N'914201', CAST(150.00 AS Decimal(16, 2)), 27.25,
    CAST(0x0000A3DB00000000 AS DateTime), N'0', 13, NULL, NULL, 58, NULL)
    INSERT [dbo].[GSS_AC_WTHDRAW] ([MATID], [MATNO], [STPRICE_ID], [MS_CD], [QTY], [PRICE], [DateCreated], [Name], [DeptID], [CreatedID_by], [JvHeader_ID], [line_id], [createby]) VALUES (1005, N'1411-0131', 1118, N'914016', CAST(31.00 AS Decimal(16, 2)), 105, CAST(0x0000A3DB00000000
    AS DateTime), N'0', 13, NULL, NULL, 59, NULL)
    INSERT [dbo].[GSS_AC_WTHDRAW] ([MATID], [MATNO], [STPRICE_ID], [MS_CD], [QTY], [PRICE], [DateCreated], [Name], [DeptID], [CreatedID_by], [JvHeader_ID], [line_id], [createby]) VALUES (1006, N'1411-0131', 105, N'914015', CAST(34.00 AS Decimal(16, 2)), 70, CAST(0x0000A3DB00000000
    AS DateTime), N'0', 13, NULL, NULL, 59, NULL)
    SET IDENTITY_INSERT [dbo].[GSS_AC_WTHDRAW] OFF
    SET IDENTITY_INSERT [dbo].[GSS_HR_COSTCENTER] ON 
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (107, N'01', N'SME', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (1, N'02', N'ADMIN', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (2, N'03', N'MANUFACTURE', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (15, N'11', N'Pattern', 11, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (104, N'21', N'Foundry', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (16, N'2100', N'FD Common', NULL, 2)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (41, N'2110', N'Melting', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (108, N'2110-00', N'Melting Common', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (123, N'2110-01', N'Melting Repairing', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (109, N'2110-01-0101', N'Melting_เตา.1', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (124, N'2110-01-0201', N'Melting CM1', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (125, N'2110-01-0202', N'Melting CM2', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (126, N'2110-01-0203', N'Melting CM3', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (127, N'2110-01-0204', N'Melting CM4', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (128, N'2110-01-0205', N'Melting CM5', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (129, N'2110-01-0206', N'Melting CM6', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (130, N'2110-01-0207', N'Melting CM7', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (131, N'2110-01-0208', N'Melting CM8', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (132, N'2110-01-0209', N'Melting CM9', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (110, N'2110-02-0102', N'Melting_เตา.2', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (111, N'2110-03-0103', N'Melting_เตา.3', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (112, N'2110-04-0104', N'Melting_เตา.4', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (113, N'2110-05-0105', N'Melting_เตา.5', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (114, N'2110-06-0106', N'Melting_เตา.6', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (115, N'2110-07-0107', N'Melting_เตา.7', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (116, N'2110-08-0108', N'Melting_เตา.8', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (117, N'2110-09-0109', N'Melting_เตา.9', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (118, N'2110-10-0110', N'Melting_เตา.10', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (119, N'2110-11-0111', N'Melting_เตา.11', 12, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (18, N'2111', N'Molding', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (42, N'2111-01', N'Core Common', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (151, N'2111-01-0201', N'Moulding -Core _CSC1', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (152, N'2111-01-0202', N'Moulding -Core _CSC2', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (148, N'2111-01-0401', N'Moulding -Core _CS-1', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (149, N'2111-01-0402', N'Moulding -Core _CS-2', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (150, N'2111-01-0501', N'Moulding -Core _MP-1', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (43, N'2111-0110', N'Core - HSP', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (44, N'2111-0111', N'Core - AVS', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (45, N'2111-0112', N'Core - VML', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (46, N'2111-0113', N'Core - AMF', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (47, N'2111-0114', N'Core - DISA', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (48, N'2111-02', N'Molding Line Common', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (49, N'2111-0210', N'Molding Line - HSP', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (144, N'2111-0210-0201', N'Moulding Line-HSP_CHSP1', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (145, N'2111-0210-0202', N'Moulding Line-HSP_CHSP2', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (146, N'2111-0210-0203', N'Moulding Line-HSP_CHSP3', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (143, N'2111-0210-0301', N'Moulding Line-HSP_HSP', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (50, N'2111-0211', N'Molding Line - AVS', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (139, N'2111-0211-0201', N'Moulding Line-AVS_CAVS', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (140, N'2111-0211-0202', N'Moulding Line-AVS_CAV1', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (141, N'2111-0211-0203', N'Moulding Line-AVS_CAV2', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (142, N'2111-0211-0204', N'Moulding Line-AVS_CAV3', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (138, N'2111-0211-0301', N'Moulding Line-AVS_AVS', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (51, N'2111-0212', N'Molding Line - VML', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (137, N'2111-0212-0201', N'Moulding Line-VML_CVML', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (136, N'2111-0212-0301', N'Moulding Line-VML_VML', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (52, N'2111-0213', N'Molding Line - AMF', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (134, N'2111-0213-0201', N'Moulding Line-AMF_CAMF1', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (135, N'2111-0213-0202', N'Moulding Line-AMF_CAMF2', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (133, N'2111-0213-0301', N'Moulding Line-AMF_AMF', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (53, N'2111-0214', N'Molding Line - DISA', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (147, N'2111-0214-0301', N'Moulding Line-DISA_DISA', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (54, N'2111-0215', N'Finishing Small - Shot Blast', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (55, N'2111-0216', N'Finishing Small - Grinding', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (159, N'2111-0216-1101', N'Moulding-Finishing-small grinding_G1', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (160, N'2111-0216-1102', N'Moulding-Finishing-small grinding_G2', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (161, N'2111-0216-1103', N'Moulding-Finishing-small grinding_G3', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (162, N'2111-0216-1104', N'Moulding-Finishing-small grinding_G4', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (163, N'2111-0216-1105', N'Moulding-Finishing-small grinding_G5', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (164, N'2111-0216-1106', N'Moulding-Finishing-small grinding_G6', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (165, N'2111-0216-1107', N'Moulding-Finishing-small grinding_G7', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (166, N'2111-0216-1108', N'Moulding-Finishing-small grinding_G8', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (167, N'2111-0216-1109', N'Moulding-Finishing-small grinding_G9', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (168, N'2111-0216-1110', N'Moulding-Finishing-small grinding_G10', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (56, N'2111-0217', N'Finishing Small - Oil Painting', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (57, N'2111-0218', N'Finishing Small - Packing', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (58, N'2111-0219', N'Finishing Line - Shot Blast', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (153, N'2111-0219-0901', N'Moulding-Finishing Line Shot Blast_SB-1', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (154, N'2111-0219-0902', N'Moulding-Finishing Line Shot Blast_SB-2', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (155, N'2111-0219-0903', N'Moulding-Finishing Line Shot Blast_SB-3', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (156, N'2111-0219-0904', N'Moulding-Finishing Line Shot Blast_SB-4', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (157, N'2111-0219-0905', N'Moulding-Finishing Line Shot Blast_SB-5', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (158, N'2111-0219-0906', N'Moulding-Finishing Line Shot Blast_SB-6', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (59, N'2111-0220', N'Finishing Line - Grinding', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (60, N'2111-0221', N'Finishing Line - Oil Painting', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (61, N'2111-0222', N'Finishing Line - Packing', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (62, N'2111-03', N'Molding Repairing', 13, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (19, N'2112', N'F1', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (63, N'2112-00', N'F1 Common', 14, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (64, N'2112-01', N'Molding Roll', 14, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (65, N'2112-0110', N'Grinding Roll', 14, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (66, N'2112-02', N'Molding M/C Tool', 14, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (67, N'2112-0210', N'Finishing F1', 14, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (68, N'2112-0211', N'Shot Blast F1', 14, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (69, N'2112-0212', N'Grinding F1', 14, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (70, N'2112-0213', N'Painting F1', 14, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (71, N'2112-0214', N'Packing F1', 14, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (72, N'2112-0215', N'Repairing F1', 14, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (20, N'2113', N'F2', NULL, NULL)
    GO
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (73, N'2113-00', N'F2 Common', 15, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (74, N'2113-01', N'Molding Press Die', 15, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (75, N'2113-02', N'Finishing F2', 15, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (76, N'2113-03', N'Shot Blast F2', 15, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (77, N'2113-04', N'Grinding F2', 15, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (78, N'2113-05', N'Painting F2', 15, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (79, N'2113-06', N'Repairing F2', 15, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (105, N'51', N'Machine', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (21, N'5100', N'MC Common', NULL, 3)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (22, N'5110', N'SME M/C', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (80, N'5110-00', N'SME M/C Common', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (81, N'5110-01', N'SME M/C CNC Late', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (82, N'5110-02', N'M/C Center', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (83, N'5110-03', N'Timing', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (84, N'5110-04', N'Milling', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (85, N'5110-05', N'SME M/C Grinding', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (86, N'5110-06', N'Drilling', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (87, N'5110-07', N'Boring', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (88, N'5110-08', N'Honning', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (89, N'5110-09', N'Double Colume', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (90, N'5110-10', N'Painting', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (91, N'5110-11', N'SME M/C Packing', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (23, N'5111', N'ROLL M/C', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (92, N'5111-00', N'ROLL M/C Common', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (93, N'5111-01', N'Rough Cut', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (94, N'5111-02', N'Center', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (95, N'5111-03', N'ROLL M/C  CNC Late', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (96, N'5111-04', N'M/C Center (Ring roll)', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (97, N'5111-05', N'ROLL M/C Grinding', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (98, N'5111-06', N'Plan Cut', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (99, N'5111-07', N'Flower Cut', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (100, N'5111-08', N'Drilling', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (101, N'5111-09', N'Hand Finish', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (102, N'5111-10', N'ROLL M/C Packing', 16, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (106, N'81', N'Maintenance', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (24, N'8100', N'MT Common', NULL, 3)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (3, N'91', N'ADMIN', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (4, N'9100', N'Admin Common', NULL, 5)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (5, N'9110', N'Account', 1, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (6, N'9111', N'Purchase', 2, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (7, N'9112', N'Human Resource', 3, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (8, N'9113', N'Quality Assurance', 4, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (9, N'9114', N'Quality Control', 5, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (10, N'9115', N'Safety', 6, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (11, N'9116', N'Doc.Control', 7, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (12, N'9117', N'Sale', 8, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (13, N'9118', N'Planning', 9, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (14, N'9119', N'Store&Delivery', 10, NULL)
    INSERT [dbo].[GSS_HR_COSTCENTER] ([Cost_ID], [Cost_code], [Cost_name], [Dept_ID], [DeptGroup_ID]) VALUES (120, N'9120', N'R & D Engineering', 19, NULL)
    SET IDENTITY_INSERT [dbo].[GSS_HR_COSTCENTER] OFF
    SET IDENTITY_INSERT [dbo].[GSS_HR_COSTRELATION] ON 
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (1, N'02', N'01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (2, N'03', N'01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (3, N'91', N'02', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (4, N'9100', N'91', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (5, N'9110', N'91', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (6, N'9111', N'91', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (7, N'9112', N'91', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (8, N'9113', N'91', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (9, N'9114', N'91', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (10, N'9115', N'91', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (11, N'9116', N'91', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (12, N'9117', N'91', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (13, N'9118', N'91', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (14, N'9119', N'91', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (15, N'11', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (16, N'2100', N'21', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (17, N'2110', N'21', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (18, N'2111', N'21', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (19, N'2112', N'21', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (20, N'2113', N'21', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (21, N'5100', N'51', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (22, N'5110', N'51', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (23, N'5111', N'51', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (24, N'8100', N'81', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (121, N'2110-01', N'2110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (122, N'2110-01-0201', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (123, N'2110-01-0202', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (124, N'2110-01-0203', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (125, N'2110-01-0204', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (126, N'2110-01-0205', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (127, N'2110-01-0206', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (128, N'2110-01-0207', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (129, N'2110-01-0208', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (130, N'2110-01-0209', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (131, N'2111-0213-0301', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (132, N'2111-0213-0201', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (133, N'2111-0213-0202', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (134, N'2111-0212-0301', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (135, N'2111-0212-0201', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (136, N'2111-0211-0301', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (137, N'2111-0211-0201', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (42, N'2111-01', N'2110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (43, N'2111-0110', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (44, N'2111-0111', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (45, N'2111-0112', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (46, N'2111-0113', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (47, N'2111-0114', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (48, N'2111-02', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (49, N'2111-0210', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (50, N'2111-0211', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (51, N'2111-0212', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (52, N'2111-0213', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (53, N'2111-0214', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (54, N'2111-0215', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (55, N'2111-0216', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (56, N'2111-0217', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (57, N'2111-0218', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (58, N'2111-0219', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (59, N'2111-0220', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (60, N'2111-0221', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (61, N'2111-0222', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (62, N'2111-03', N'2111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (63, N'2112-00', N'2112', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (64, N'2112-01', N'2112', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (65, N'2112-0110', N'2112', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (66, N'2112-02', N'2112', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (67, N'2112-0210', N'2112', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (68, N'2112-0211', N'2112', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (69, N'2112-0212', N'2112', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (70, N'2112-0213', N'2112', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (71, N'2112-0214', N'2112', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (72, N'2112-0215', N'2112', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (73, N'2113-00', N'2113', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (74, N'2113-01', N'2113', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (75, N'2113-02', N'2113', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (76, N'2113-03', N'2113', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (77, N'2113-04', N'2113', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (78, N'2113-05', N'2113', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (79, N'2113-06', N'2113', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (80, N'5110-00', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (81, N'5110-01', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (82, N'5110-02', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (83, N'5110-03', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (84, N'5110-04', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (85, N'5110-05', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (86, N'5110-06', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (87, N'5110-07', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (88, N'5110-08', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (89, N'5110-09', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (90, N'5110-10', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (91, N'5110-11', N'5110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (92, N'5111-00', N'5111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (93, N'5111-01', N'5111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (94, N'5111-02', N'5111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (95, N'5111-03', N'5111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (96, N'5111-04', N'5111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (97, N'5111-05', N'5111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (98, N'5111-06', N'5111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (99, N'5111-07', N'5111', NULL)
    GO
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (100, N'5111-08', N'5111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (101, N'5111-09', N'5111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (102, N'5111-10', N'5111', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (103, N'11', N'03', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (104, N'21', N'03', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (105, N'51', N'03', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (106, N'81', N'03', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (107, N'01', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (108, N'2110-00', N'2110', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (109, N'2110-01-0101', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (110, N'2110-02-0102', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (111, N'2110-03-0103', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (112, N'2110-04-0104', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (113, N'2110-05-0105', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (114, N'2110-06-0106', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (115, N'2110-07-0107', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (116, N'2110-08-0108', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (117, N'2110-09-0109', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (138, N'2111-0211-0202', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (139, N'2111-0211-0203', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (140, N'2111-0211-0204', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (141, N'2111-0210-0301', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (142, N'2111-0210-0201', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (143, N'2111-0210-0202', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (144, N'2111-0210-0203', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (145, N'2111-0214-0301', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (146, N'2111-01-0401', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (147, N'2111-01-0402', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (148, N'2111-01-0501', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (149, N'2111-01-0201', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (150, N'2111-01-0202', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (151, N'2111-0219-0901', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (152, N'2111-0219-0902', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (153, N'2111-0219-0903', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (154, N'2111-0219-0904', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (155, N'2111-0219-0905', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (156, N'2111-0219-0906', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (157, N'2111-0216-1101', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (158, N'2111-0216-1102', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (159, N'2111-0216-1103', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (160, N'2111-0216-1104', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (161, N'2111-0216-1105', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (162, N'2111-0216-1106', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (163, N'2111-0216-1107', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (164, N'2111-0216-1108', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (165, N'2111-0216-1109', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (166, N'2111-0216-1110', NULL, NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (118, N'2110-10-0110', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (119, N'2110-11-0111', N'2110-01', NULL)
    INSERT [dbo].[GSS_HR_COSTRELATION] ([Relation_ID], [Child_Code], [Parent_Code], [FLG]) VALUES (120, N'9120', N'91', NULL)
    SET IDENTITY_INSERT [dbo].[GSS_HR_COSTRELATION] OFF

    >> I want to sum every parent recursively to the top of parent <<
    The terms “parent” and “child” are part of network databases and NOT RDBMS. We have “weak entity” and “{strong entity” in our data models today.
    If you use the nested sets model, this hierarchical aggregation is easy. But your mindset is still in file systems, pointer chains and procedural language programming code. You also have no idea how ISO-11179 naming rules work. 
    Most of the data element names are garbage! Most of your code is garbage, even after we get over the fundamental design errors. 
    Think about how absurd “qty” as a data element name is in a schema. Quantity of what?? From logic (specifically the Law of Identity, the most fundamental law in mathematics) that “to be” (exist) is to be something in particular; so this has to be “<something
    in particular>_qty” to be valid. Your other data elemet names are also vague garbage. 
    We do NOT use flags in SQL; this is a predicate language like Assembly code. We do NOT set flags; we discover a current “state of being” with predicates. 
    Think about “GSS_Hr_Cost_Relation” as a name. Is there only one of them, as you have said?? Would also call a table of “Marriages” a “Man_Woman_Legal_Relations” ? NO! The relationship has a name of its own! 
    CAST(1 AS FLOAT) is better written AS a constant E1.0; but it is weird. why are you using FLOAT? Do you want rounding errors? Why do you write crap like “CAST(34.00 AS DECIMAL(16, 2)”  when an insertion of just 34.00 works better? Why do you write crap
    like “CAST(0x0000a3db00000000 AS DATETIME” instead of using ISO-8601 formats, DATE and DATETIME2(0) data types? 
    Then you have no idea what kind of attribute a “<something>_code” is and why it cannort ever be key. Go to any library and look at the Dewey DECIMAL Classification system. The hierarchy is in the encoding itself, NOT in some multiple levels of storage. 
    Why do you have more NULL-able columns than the loan systems of major automobile corporations? I can answer that! Your schema is a disaster that needs to be re-done. 
    Putting audit data into the table being audited is both stupid and illegal! And then to make it worse, “datecreated” should have been “creation_date” if the moron knew ISO-11179 rules. But it is still a crime; what happens to the audit data when the row is
    deleted or the table is dropped? Can a person with access to the data also have access to the audit trail? DOH! 
    The use of “NVARCHAR(50)” might be correct in places where the data actually is in Unicode varying strings. I think I have seen ~10 of them in 30 years of writing SQL. But everything does not qualify; most likely some moron using ACCESS or a ORM tool used this
    default because he is both stupid and lazy. Fire him; his ignorance is dangerous to the project. 
    Most ISO encodings are fixed length and between 9 and 16 characters with a regular expression for validation. Not all but most. 
    Finally, after all the decades of RDBMS, why do you use “mat_id INTEGER IDENTITY(1,1) NOT NULL”?? Why do you think that the insertion attempt count of one table is a valid logical attribute, much less a KEY? 
    You do not know how to write an INSERT UNTO statement! Look up the VALUES () clause and row constructions. 
    I have decades of my life invested in SQL and RDBMS. Reading code like this is painful. Can you please get a minimal education and correct this mess? I have been asked to write a book on bad SQL and this is classic illiterate programming! Almost nothing is
    right. 
    Sorry, but you wanted help and the best help is to stop you from doing more harm until you can learn how to do it properly. >> I want to sum every parent recursively to the top of parent <<
    The terms “parent” and “child” are part of network databases and NOT RDBMS. We have “weak entity” and “{strong entity” in our data models today.
    If you use the nested sets model, this hierarchical aggregation is easy. But your mindset is still in file systems, pointer chains and procedural language programming code. You also have no idea how ISO-11179 naming rules work. 
    Most of the data element names are garbage! Most of your code is garbage, even after we get over the fundamental design errors. 
    Think about how absurd “qty” as a data element name is in a schema. Quantity of what?? From logic (specifically the Law of Identity, the most fundamental law in mathematics) that “to be” (exist) is to be something in particular; so this has to be “<something
    in particular>_qty” to be valid. Your other data elemet names are also vague garbage. 
    We do NOT use flags in SQL; this is a predicate language like Assembly code. We do NOT set flags; we discover a current “state of being” with predicates. 
    Think about “GSS_Hr_Cost_Relation” as a name. Is there only one of them, as you have said?? Would also call a table of “Marriages” a “Man_Woman_Legal_Relations” ? NO! The relationship has a name of its own! 
    CAST(1 AS FLOAT) is better written AS a constant E1.0; but it is weird. why are you using FLOAT? Do you want rounding errors? Why do you write crap like “CAST(34.00 AS DECIMAL(16, 2)”  when an insertion of just 34.00 works better? Why do you write crap
    like “CAST(0x0000a3db00000000 AS DATETIME” instead of using ISO-8601 formats, DATE and DATETIME2(0) data types? 
    Then you have no idea what kind of attribute a “<something>_code” is and why it cannort ever be key. Go to any library and look at the Dewey DECIMAL Classification system. The hierarchy is in the encoding itself, NOT in some multiple levels of storage. 
    Why do you have more NULL-able columns than the loan systems of major automobile corporations? I can answer that! Your schema is a disaster that needs to be re-done. 
    Putting audit data into the table being audited is both stupid and illegal! And then to make it worse, “datecreated” should have been “creation_date” if the moron knew ISO-11179 rules. But it is still a crime; what happens to the audit data when the row is
    deleted or the table is dropped? Can a person with access to the data also have access to the audit trail? DOH! 
    The use of “NVARCHAR(50)” might be correct in places where the data actually is in Unicode varying strings. I think I have seen ~10 of them in 30 years of writing SQL. But everything does not qualify; most likely some moron using ACCESS or a ORM tool used this
    default because he is both stupid and lazy. Fire him; his ignorance is dangerous to the project. 
    Most ISO encodings are fixed length and between 9 and 16 characters with a regular expression for validation. Not all but most. 
    Finally, after all the decades of RDBMS, why do you use “mat_id INTEGER IDENTITY(1,1) NOT NULL”?? Why do you think that the insertion attempt count of one table is a valid logical attribute, much less a KEY? 
    You do not know how to write an INSERT UNTO statement! Look up the VALUES () clause and row constructions. 
    I have decades of my life invested in SQL and RDBMS. Reading code like this is painful. Can you please get a minimal education and correct this mess? I have been asked to write a book on bad SQL and this is classic illiterate programming! Almost nothing is
    right. 
    Sorry, but you wanted help and the best help is to stop you from doing more harm until you can learn how to do it properly. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

Maybe you are looking for