Search Results

Search found 6257 results on 251 pages for 'columns'.

Page 10/251 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • BULK INSERT with inconsitant number of columns

    - by aceinthehole
    I am trying to load a large amount data in SQL server from a flat file using BULK INSERT. However, my file has varying number of column, for instance the first row contains 14 and the second contains 4. That is OK, I just want to make a table with the max number of columns and load the file into it with nulls for the missing columns. I can play with it from that point. But it seems that SQL Server when reaching the end of the line and having more columns to fill for that same row in the destination table, just moves on to the next line and attempts to put the data on that line to the wrong column of the table. Is there a way to get the behavior that I am looking for? Is there a table hint that I can use the specify this? Has anyone run into this before? Here is the code BULK INSERT #t FROM '<path to file>' WITH ( DATAFILETYPE = 'char', KEEPNULLS, FIELDTERMINATOR = '#' )

    Read the article

  • C# pulling out columns from combobox text

    - by Mike
    What i have is four comboboxes and two files. If the column matches the combobox i need to write it out to a file but it has to appened with the second combobox. So for example Combobox1: Apple | Orange Combobox2: Pineapple | Plum I have selected Apple Plum I need to search threw a text file and find whatever columns is Apple or Plum: Orange|Pear|Peach|Turnip|Monkey|Apple|Grape|Plum and then i need to write out just the columns Apple|Plum to a new text file. Any help would be awesome! Better example Combobox1 selected item:Apple Combobox2 selected item:Plum Text FILE: APPLE|Pear|Plum|Orange 1|2|3|4 215|3|45|98 125|498|76|4 4165|465|4|65 Resulting File: 1|3 215|45 125|76 4165|4 Thanks for the advice, i dont need help on adding to combobox or reading the files, just how to create a file from a delimited file having multiple columns.

    Read the article

  • Fluid Columns with matching height and background image

    - by JamesArmes
    I'm working on a new layout for my site that uses a header, footer and two column center region. The two columns consist of the main content area which is fluid height and width and a right sidebar which is fluid height and fixed width. I have done similar layouts before, but this one depends on using two different background images (one for the sidebar and one for the content area). Is there any way to implement this, using proper HTML & CSS, so that the background images of the two columns are always the same height, regardless of which columns content is longer? I've tried using JavaScript to simulate this, but it doesn't work so well if there are images in the content area. I would really prefer not to use this method any way. Any help is greatly appreciated. I have setup a staging environment at http://staging.jamesarmes.net/jimmyssandbox to provide an example. This environment is not my finished product, but I want to get the containers under control before I move any further

    Read the article

  • List of all index & index columns in SQL Server DB

    - by Anton Gogolev
    How do I get a list of all index & index columns in SQL Server 2005+? The closest I could get is: select s.name, t.name, i.name, c.name from sys.tables t inner join sys.schemas s on t.schema_id = s.schema_id inner join sys.indexes i on i.object_id = t.object_id inner join sys.index_columns ic on ic.object_id = t.object_id inner join sys.columns c on c.object_id = t.object_id and ic.column_id = c.column_id where i.index_id > 0 and i.type in (1, 2) -- clustered & nonclustered only and i.is_primary_key = 0 -- do not include PK indexes and i.is_unique_constraint = 0 -- do not include UQ and i.is_disabled = 0 and i.is_hypothetical = 0 and ic.key_ordinal > 0 order by ic.key_ordinal which is not exactly what I want. What I want is to list all user-defined indexes (which means no indexes which support unique constraints & primary keys) with all columns (ordered by how do they apper in index definition) plus as much metadata as possible.

    Read the article

  • stored procedure to find value in 2 columns out of 3

    - by user1510533
    I am putting in the samle date and i am supposed to do something similar what i am asking. I want to run a query that would pull values in any two columns out 3 if it has a 1 or if any one column has a 1 it will return just those results. However it should search all three columns and in any of the three columns where it found value as 1 it should return that result. Can anyone please help me with this. Thanks in advance. ID Patient Patient Name prio prio2 prio3 ------------------------------------------------- 1 101563 Robert Riley 1 1 1 2 101583 Cody Ayers 1 0 1 3 101825 Jason Lawler 0 0 1 4 101984 Dustin Lumis 1 0 0 5 102365 Stacy smith 1 0 0 6 102564 Frank Milon 1 0 0 7 102692 Thomas Kroning 1 0 0 8 102856 Andrew Philips 1 0 0 9 102915 Alice Davies 0 0 1 10 103785 Jon Durley 0 0 1 11 103958 Clayton Folsom 1 1 1 12 104696 Michelle Holsley 1 1 1 13 104983 Teresa Jones 1 0 1 14 105892 Betsy Prat 1 1 0 15 106859 Casey Ayers 1 1 0

    Read the article

  • C# GridView dynamically built columns with textboxes ontextchanged

    - by tnriverfish
    My page is a bulk order form that has many products and various size options. I've got a gridview that has a 3 static columns with labels. There are then some dynamically built columns. Each of the dynamically built columns have a textbox in them. The textbox is for quantity. Trying to either update the server with the quantity entered each time a textbox is changed (possibly ontextchanged event) or loop though each of the rows column by column and gather all the items that have a quantity and process those items and their quantities all at once (via button onclick). If I put the process that builds the GridView behind a if(!Page.IsPostBack) then the when a textchanged event fires the gridview only gets the static fields and the dynamic ones are gone. If I remove the if(!Page.IsPostBack) the process to gather and build the page is too heavy on processing and takes too long to render the page again. Some advice would be appreciated. Thanks

    Read the article

  • How to invert rows and columns using a T-SQL Pivot Table

    - by Jeff Stock
    I have a query that returns one row. However, I want to invert the rows and columns, meaning show the rows as columns and columns as rows. I think the best way to do this is to use a pivot table, which I am no expert in. Here is my simple query: SELECT Period1, Period2, Period3 FROM GL.Actuals WHERE Year = 2009 AND Account = '001-4000-50031' Results (with headers): Period1, Period2, Period3 612.58, 681.36, 676.42 I would like for the results to look like this: Desired Results: Period, Amount Period1, 612.58 Period2, 681.36 Period3, 676.42 This is a simple example, but what I'm really after is a bit more comlex than this. I realize I could produce theses results by using several SELECT commands instead. I'm just hoping someone can shine some light on how to accomplish this with a Pivot Table or if there is yet a better way.

    Read the article

  • How to compare multiple columns in excel?

    - by musicking123
    Hi i have two sheets having data like this sheet1 : **A** **B** **C** 752 A 752 E 752 N 984 G1 984 G2 4471 U1 4471 U2 4471 U4 4471 U5 4471 U7 4471 U8 sheet2: **A** **B** **C** 132 G 69092 227 G 29400 227 G1 2378 292 G 2088 426 G 14419 752 A 180829 752 E 719404 752 N 602180 1173 G 7361 1173 G1 13083 1619 US 108 5804 N 701 5804 SG 8 5819 CA 24 6333 AE 218 What i want is, i need compare sheet1 and sheet2 , if sheet1 A and B columns match with sheet2 's A and B columns then i want the value C (column in sheet2) to be placed in sheet1 column C. Please help me, i know how to compare only one column with other column by using vlookup, but here i want to compare two columns at a time. Thanks in advance

    Read the article

  • show only those columns which have data value

    - by Zankar
    I don't known that it is possible or not but i want to ask a question to you as suppose i have a table as table1 id | mon | tue | wed | thu | fri | sat | sun 1 | 100 | 200 | 0 | 0 | 0 | 0 | 0 2 | 200 | 0 | 300 | 0 | 0 | 0 | 0 So from given table result should be ... id | mon | tue | wed | 1 | 100 | 200 | 0 | 2 | 200 | 0 | 300 | as shown in table1 different columns of week. If all values in a column is 0 or null then query should ignore to show that column(as shown in result) Note: if we run a query as select * from table1 it shows all columns. While I don't wants a query like select id,mon,tue,wed from table1 because no. of showing columns may change. Please reply to me. Thank you....

    Read the article

  • [Flex] Using same set of columns in AdvancedDataGrid in a TabBar

    - by user283403
    I have a TabBar control which will show an AdvancedDataGrid with same set of columns on different tabs, i am doing this so that i can show similar data on different tab pages. Column heading will be the same on all grids, is there a way I can put all column headings in an array and set that as columns of data grid? I tried setting the columns property but it doesn't work. Also I need to set ID property for a single column in the grid to set it the treecolumn so one column must have individual id field too.

    Read the article

  • exporting html table multi line columns to excel multi line cells

    - by Passat
    I have a html table in a view MVC4 that I am sending to excel as output. Inside the view page I have some columns that have multiple lines that are built with forloops within the HTML. What's the best way to add the or \r\n so that excel renders it correctly? I have a table and inside I build each row looping thru a recordset. In each row I also loop thru different recordsets to populate columns within each row so that some of the columns may contain more than one value and they should show in different lines in the table that will export to excel.

    Read the article

  • Comparing columns in Excel

    - by Regan
    I needed to take columns A, B, and C and compare D, E and F. Here's an example: A B C D E F Jump Smith 5 Jump Smith 8 Run Naylor 2 Swim Fran 4 Swim Fran 7 Jog Dylan 1 Jump Fran 3 Jog Smith 4 So I want to match column A and B with D and E but still have both number related C for 2011 and F for 2012. Can anyone please help with that formula? My data is from A3-C4344 and D3 - D4470.

    Read the article

  • Teradata equivalent of persisted computed column (in SQL Server)

    - by Cade Roux
    We have a few tables with persisted computed columns in SQL Server. Is there an equivalent of this in Teradata? And, if so, what is the syntax and are there any limitations? The particular computed columns I am looking at conform some account numbers by removing leading zeros - an index is also created on this conformed account number: ACCT_NUM_std AS ISNULL(CONVERT(varchar(39), SUBSTRING(LTRIM(RTRIM([ACCT_NUM])), PATINDEX('%[^0]%', LTRIM(RTRIM([ACCT_NUM])) + '.' ), LEN(LTRIM(RTRIM([ACCT_NUM]))) ) ), '' ) PERSISTED With the Teradata TRIM function, the trimming part would be a little simpler: ACCT_NUM_std AS COALESCE(CAST(TRIM(LEADING '0' FROM TRIM(BOTH FROM ACCT_NUM))) AS varchar(39)), '' ) I guess I could just make this a normal column and put the code to standardize the account numbers in all the processes which insert into the table. We did this to put the standardization code in one place.

    Read the article

  • SQL Exec T-SQL statement?

    - by salvationishere
    I am trying to list all of the columns from whichever Adventureworks table I choose. What T-sQL statement or stored proc can I execute to see this list of all columns? I want to use my C# web app to input one input parameter = table_name and then get a list of all the column_names as output. Right now I am trying to execute the sp_columns stored proc which works, but I can't get just the one column with select and exec combined. Does anybody know how to do this?

    Read the article

  • Use XSLT to arrange a list of items in a table

    - by Mark Sp
    I have a linear list of items which I wish to arrange in a table using XSLT. I wish to specify the number of columns as a parameter. For example, if I have a list of 12 items, I can select a 2x6, 3x4, 4x3 or 6x2 table. I cannot see a general way to do this. I have seen this article: http://www.nedcomp.nl/support/origdocs/xml4/extracted/xpath_hdi_1_4llx.aspx It tells you how to generate a table with a specific number of columns, but does not allow a general case. (Ideally there would be a loop for the xsl:value-of lines). Thanks Mark

    Read the article

  • flex actionscript Datagridcolumn array

    - by Jad
    Hi, We have an AIR app and using a datagrid. We want to store the dataGrid.columns array in mySQL DB through PHP. This is needed because the user can customise the column headers of the datagrid and his preference needs to be stored and shown to him on his next login. Using HTTPService, we tried sending the dataGrid.columns array as a string, as follows, var ht:HTTPService = new HTTPService(); ht.url = Config.getServerURL(); ht.method = URLRequestMethod.POST; ht.resultFormat = "text"; ht.request["action"] = "updateGrid"; ht.request["headercolumns"] = colsArray.toString(); The data is stord as comma separated array string in DB. When we retrieve it back, cannot seem to cast it back to the DatagridColumns and assign it. Please let me know. Regards Jada.

    Read the article

  • How to do simple math in datagridview

    - by EB
    I am new to C#. I have a datagridview with 9 columns. I am simply trying take the value in column 5 and subtract it from column 6. Then display the result in column 9. It seems simple enough.I know it's done in excel all the time. But I just cannot figure this out. Do I need to create a new class with a method called calculate columns? or does the datagridview class have something already built in that can handle this? Again, I am new to C#. Any help would be appreciated. Thank you, Oceantrain.

    Read the article

  • Trouble updating my datagrid in WPF

    - by wrigley06
    As the title indicates, I'm having trouble updating a datagrid in WPF. Basically what I'm trying to accomplish is a datagrid, that is connected to a SQL Server database, that updates automatically once a user enters information into a few textboxes and clicks a submit button. You'll notice that I have a command that joins two tables. The data from the Quote_Data table will be inserted by a different user at a later time. For now my only concern is getting the information from the textboxes and into the General_Info table, and from there into my datagrid. The code, which I'll include below compiles fine, but when I hit the submit button, nothing happens. This is the first application I've ever built working with a SQL Database so many of these concepts are new to me, which is why you'll probably look at my code and wonder what is he thinking. public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } public DataSet mds; // main data set (mds) private void Window_Loaded_1(object sender, RoutedEventArgs e) { try { string connectionString = Sqtm.Properties.Settings.Default.SqtmDbConnectionString; using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); //Merging tables General_Info and Quote_Data SqlCommand cmd = new SqlCommand("SELECT General_Info.Quote_ID, General_Info.Open_Quote, General_Info.Customer_Name," + "General_Info.OEM_Name, General_Info.Qty, General_Info.Quote_Num, General_Info.Fab_Drawing_Num, " + "General_Info.Rfq_Num, General_Info.Rev_Num, Quote_Data.MOA, Quote_Data.MOQ, " + "Quote_Data.Markup, Quote_Data.FOB, Quote_Data.Shipping_Method, Quote_Data.Freight, " + "Quote_Data.Vendor_Price, Unit_Price, Quote_Data.Difference, Quote_Data.Vendor_NRE_ET, " + "Quote_Data.NRE, Quote_Data.ET, Quote_Data.STI_NET, Quote_Data.Mfg_Time, Quote_Data.Delivery_Time, " + "Quote_Data.Mfg_Name, Quote_Data.Mfg_Location " + "FROM General_Info INNER JOIN dbo.Quote_Data ON General_Info.Quote_ID = Quote_Data.Quote_ID", connection); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); MainGrid.ItemsSource = dt.DefaultView; mds = new DataSet(); da.Fill(mds, "General_Info"); MainGrid.DataContext = mds.Tables["General_Info"]; } } catch (Exception ex) { MessageBox.Show(ex.Message); } // renaming column names from the database so they are easier to read in the datagrid MainGrid.Columns[0].Header = "#"; MainGrid.Columns[1].Header = "Date"; MainGrid.Columns[2].Header = "Customer"; MainGrid.Columns[3].Header = "OEM"; MainGrid.Columns[4].Header = "Qty"; MainGrid.Columns[5].Header = "Quote Number"; MainGrid.Columns[6].Header = "Fab Drawing Num"; MainGrid.Columns[7].Header = "RFQ Number"; MainGrid.Columns[8].Header = "Rev Number"; MainGrid.Columns[9].Header = "MOA"; MainGrid.Columns[10].Header = "MOQ"; MainGrid.Columns[11].Header = "Markup"; MainGrid.Columns[12].Header = "FOB"; MainGrid.Columns[13].Header = "Shipping"; MainGrid.Columns[14].Header = "Freight"; MainGrid.Columns[15].Header = "Vendor Price"; MainGrid.Columns[16].Header = "Unit Price"; MainGrid.Columns[17].Header = "Difference"; MainGrid.Columns[18].Header = "Vendor NRE/ET"; MainGrid.Columns[19].Header = "NRE"; MainGrid.Columns[20].Header = "ET"; MainGrid.Columns[21].Header = "STINET"; MainGrid.Columns[22].Header = "Mfg. Time"; MainGrid.Columns[23].Header = "Delivery Time"; MainGrid.Columns[24].Header = "Manufacturer"; MainGrid.Columns[25].Header = "Mfg. Location"; } private void submitQuotebtn_Click(object sender, RoutedEventArgs e) { CustomerData newQuote = new CustomerData(); int quantity; quantity = Convert.ToInt32(quantityTxt.Text); string theDate = System.DateTime.Today.Date.ToString("d"); newQuote.OpenQuote = theDate; newQuote.CustomerName = customerNameTxt.Text; newQuote.OEMName = oemNameTxt.Text; newQuote.Qty = quantity; newQuote.QuoteNumber = quoteNumberTxt.Text; newQuote.FdNumber = fabDrawingNumberTxt.Text; newQuote.RfqNumber = rfqNumberTxt.Text; newQuote.RevNumber = revNumberTxt.Text; try { string insertConString = Sqtm.Properties.Settings.Default.SqtmDbConnectionString; using (SqlConnection insertConnection = new SqlConnection(insertConString)) { insertConnection.Open(); SqlDataAdapter adapter = new SqlDataAdapter(Sqtm.Properties.Settings.Default.SqtmDbConnectionString, insertConnection); SqlCommand updateCmd = new SqlCommand("UPDATE General_Info " + "Quote_ID = @Quote_ID, " + "Open_Quote = @Open_Quote, " + "OEM_Name = @OEM_Name, " + "Qty = @Qty, " + "Quote_Num = @Quote_Num, " + "Fab_Drawing_Num = @Fab_Drawing_Num, " + "Rfq_Num = @Rfq_Num, " + "Rev_Num = @Rev_Num " + "WHERE Quote_ID = @Quote_ID"); updateCmd.Connection = insertConnection; System.Data.SqlClient.SqlParameterCollection param = updateCmd.Parameters; // // Add new SqlParameters to the command. // param.AddWithValue("Open_Quote", newQuote.OpenQuote); param.AddWithValue("Customer_Name", newQuote.CustomerName); param.AddWithValue("OEM_Name", newQuote.OEMName); param.AddWithValue("Qty", newQuote.Qty); param.AddWithValue("Quote_Num", newQuote.QuoteNumber); param.AddWithValue("Fab_Drawing_Num", newQuote.FdNumber); param.AddWithValue("Rfq_Num", newQuote.RfqNumber); param.AddWithValue("Rev_Num", newQuote.RevNumber); adapter.UpdateCommand = updateCmd; adapter.Update(mds.Tables[0]); mds.AcceptChanges(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } Thanks in advance to anyone who can help, I really appreciate it, Andrew

    Read the article

  • ExtJS Portal - Columns of different sizes

    - by needshelp
    I need to be able to use different size columns in the ExtJS portal. For example, I want in the center region, one area which has room for one big widget, and then right below it, 2 areas for 2 smaller widgets. I keep trying to play with the columns to figure this out, but nothing seems to work. Help?

    Read the article

  • Multiple Columns as Primary keys

    - by rockbala
    CREATE TABLE Persons ( P_Id int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Address varchar(255), City varchar(255), CONSTRAINT pk_PersonID PRIMARY KEY (P_Id,LastName) ) The above example is taken from w3schools. From the above example, my understanding is that both P_Id, LastName together represents a Primary Key for the table Persons, correct ? Another question is why would some one want to use multiple columns as Primary keys instead of a single column ? How many such columns can be used in together as Primary key in a given table ? Thanks Balaji S

    Read the article

  • Any way to change Phppgadmin view order of columns without changing underlying db

    - by nick
    Hey everyone, Is there any way to change the order of the columns phppgadmin views when browsing tables without having to change the underlying db? I have a few columns that I want seperated by heaps of unimportant ones and then a few more important ones at the end. The problem is that the important ones on the right are way of the screen so its hard to check visually if data has been inputed correctly. Cheers

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >