Search Results

Search found 7127 results on 286 pages for 'calculated columns'.

Page 88/286 | < Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >

  • SSIS 2005 - How to Import a Fixed Width Flat File?

    - by Greg
    I have a flat file that looks something like this: junk I don't care about \n \n columns names\n val1 val2 val3\n val1 val2 val3\n columns names \n val1 val2 val3\n I only care the lines with values. These value lines are all fixed width format and have the same line length. The other junk lines and column names can have any line width. When I try the flat file fixed width option or the ragged right option the preview looks all wrong. Any ideas what the easiest way to get this into SSIS is?

    Read the article

  • ASP.NET CommandField & skin

    - by o..o
    Hi. I'm tying to skin ASP.NET GridView CommandField. Everything si working fine, just when I move CommandField property declarations from page to skin file, the whole commandField properties are ignored. here is my skin file: <asp:GridView AllowPaging="true" AllowSorting="false" AutoGenerateEditButton="false" AutoGenerateDeleteButton="false" AutoGenerateSelectButton="false" AutoGenerateColumns="false" GridLines="None" PageSize="20" ShowFooter="false" ShowHeader="true" runat="server"> <Columns> <asp:CommandField ButtonType="Image" ControlStyle-Width="25" EditImageUrl="Images/Icons/pencil.png" DeleteImageUrl="Images/Icons/cross.png" /> </Columns> </asp:GridView> In web.config I apply only StyleSheetTheme. Do I miss something? Thanks

    Read the article

  • Help needed with MySQL query to join data spanning multiple tables with data used as column names

    - by gurun8
    I need a little help putting together a SQL query that will give me the following resultsets: and The data model looks like this: The tricky part for me is that the columns to the right of the "Product" in the resultset aren't really columns in the database but rather key/value pairs spanned across the data model. Table data is as follows: My apologies in advance for the image heavy question and the image quality. This just seemed like the easiest way to convey the information. It'll probably take someone less time to write the query statement to achieve the results than it did for me to assemble this question. By the way, the "product_option" table image is truncated but it illustrated the general idea of the data structure. The MySQL server version is 5.1.45.

    Read the article

  • Mixed Table Type with other types as parameters to Stored Procedured c#

    - by amemak
    Hi, I am asking about how could i pass multi parameters to a stored procedure, one of these parameters is user defined table. When I tried to do it it shows this error: INSERT INTO BD (ID, VALUE, BID) values( (SELECT t1.ID, t1.Value FROM @Table AS t1),someintvalue) here @Table is the user defined table parameter. Msg 116, Level 16, State 1, Procedure UpdateBD, Line 12 Only one expression can be specified in the select list when the subquery is not introduced with EXISTS. Msg 109, Level 15, State 1, Procedure UpdateBD, Line 11 There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement. Thank you

    Read the article

  • max count with joins

    - by trixet
    I have 3 tables: users: Id Login 1 John 2 Bill 3 Jim computers: Id Name 1 Computer1 2 Computer2 3 Computer3 4 Computer4 5 Computer5 sessions: UserId ComputerId Minutes 1 2 47 2 1 32 1 4 15 2 5 5 1 2 7 1 1 40 2 5 31 I would like to display this resulting table: Login Total_sess Total_min Most_freq_computer Sess_on_most_freq Min_on_most_freq John 4 109 Computer2 2 54 Bill 3 68 Computer5 2 36 Jim - - - - - Myself I can only cover first 3 columns with: SELECT Login, COUNT(sessions.UserId), SUM(Minutes) FROM users LEFT JOIN sessions ON users.Id = sessions.UserId GROUP BY users.Id And some kind of other columns with: SELECT main.* FROM (SELECT UserId, ComputerId, COUNT(*) AS cnt ,SUM(Minutes) FROM sessions GROUP BY UserId, ComputerId) AS main INNER JOIN ( SELECT ComputerId, MAX(cnt) AS maxCnt FROM ( SELECT ComputerId, UserId, COUNT(*) AS cnt FROM sessions GROUP BY ComputerId, UserId ) AS Counts GROUP BY ComputerId) AS maxes ON main.ComputerId = maxes.ComputerId AND main.cnt = maxes.maxCnt But I need to get whole resulting table in one query. I feel I'm doing something completely wrong. Need help.

    Read the article

  • How to force grails GORM to respect DB scheme ?

    - by fabien-barbier
    I have two domains : class CodeSet { String id String owner String comments String geneRLF String systemAPF static hasMany = [cartridges:Cartridge] static constraints = { id(unique:true,blank:false) } static mapping = { table 'code_set' version false columns { id column:'code_set_id', generator: 'assigned' owner column:'owner' comments column:'comments' geneRLF column:'gene_rlf' systemAPF column:'system_apf' } } and : class Cartridge { String id String code_set_id Date runDate static belongsTo = CodeSet static constraints = { id(unique:true,blank:false) } static mapping = { table 'cartridge' version false columns { id column:'cartridge_id', generator: 'assigned' code_set_id column:'code_set_id' runDate column:'run_date' } } Actually, with those models, I get tables : - code_set, - cartridge, - and table : code_set_cartridge (two fields : code_set_cartridges_id, cartridge_id) I would like to not have code_set_cartridge table, but keep relationship : code_set -- 1:n -- cartridge In other words, how can I keep association between code_set and cartridge without intermediate table ? (using code_set_id as primary key in code_set and code_set_id as foreign key in cartridge). Mapping with GORM can be done without intermediate table?

    Read the article

  • How can custom properties be added to a column in Doctrine

    - by murze
    With doctrine if you execute this code $columns = $accountTable->getColumns(); foreach ($columns as $column) { print_r($column); } you could get for example this as result: Array ( [type] => integer [length] => 20 [autoincrement] => 1 [primary] => 1 ) Array ( [type] => string [length] => 255 ) Is there a way to add custom properties to a column, so that the result would be: Array ( [type] => integer [length] => 20 [autoincrement] => 1 [primary] => 1 [customproperty] => customvalue ) Array ( [type] => string [length] => 255 )

    Read the article

  • Neglect empty cells while refreshing

    - by Ashok Vardhan
    I have an excel macro which refreshes the worksheet. However, if the file (in .csv format) with which the worksheet is being refreshed has empty cells, it's shifting the data from other columns and placing the data in wrong columns. However,if I manually refresh the sheet, it's working fine. I don't know how I can fix this. I just want my whole .csv file including empty cells to appear as it is in the worksheet. Any suggestions would be greatly helpful. The following is the Macro code. With Worksheets("RawData1").QueryTables(1) .TextFilePromptOnRefresh = False .RefreshStyle = xlinsertdelete .Connection = Application.Substitute(.Connection, CurrPath, NewPath) .Refresh End With // We can assume that we have CurrPath and NewPath properly

    Read the article

  • Need to work out database structure

    - by jim smith
    Hi, Just need a little kickstart with this. I have Mysql/PHP, and I have 5,000 products. I have 30 companies I need to store some data for those 30 companies for each product as follows: a) prices b) stock qty I also need to store data historically on a daily basis. So the table... It makes sense that the records will be the products because there's 5000, and if I put the companies as the columns, I can store the prices, but what about the stock quantities? I could create two columns for each compoany, one for prices, one for qty. Then make the tablename the date for that day...so theer would be a new table for every day with 5000 products in it? is this the correct way? Some idea on how I'll be retreiving data the top 5 lowest prices (and the company) by product for a certain date the price and stock changes in the past 7 days by product

    Read the article

  • mySQL Query JOIN in same table

    - by jeerose
    Table structure goes something like this: Table: Purchasers Columns: id | organization | city | state Table: Events Columns: id | purchaser_id My query: SELECT purchasers.*, events.id AS event_id FROM purchasers INNER JOIN events ON events.purchaser_id = purchasers.id WHERE purchasers.id = '$id' What I would like to do, is obviously to select entries by their id from the purchasers table and join from events. That's the easy part. I can also easily to another query to get other purchasers with the same organization, city and state (there are multiples) but I'd like to do it all in the same query. Is there a way I can do this? In short, grab purchasers by their ID but then also select other purchasers that have the same organization, city and state. Thanks.

    Read the article

  • Get a value of checked checkbox into a button from a Gridview

    - by Nimish Kulkarni
    I have a Gridview Generated as follows : <asp:GridView ID="Cash_GridView" runat="server" CssClass="Grid" > <Columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="MemberCheck" runat="server" /> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Loan_Acno" HeaderText="Loan A/C number" /> </Columns> </asp:Gridview> <asp:Button ID="CashPayButton" runat="server" Text="Pay Dividend" CssClass="bluesome" OnClick="CashPayButton_Click" /> And also having the above button click event now when i click checkbox on particular row i want that whole row to be get caluclated in the Button click event in the code behind protected void CashPayButton_Click(object sender, EventArgs e) { }

    Read the article

  • Is it safe to convert varchar and char into nvarchar and nchar in SQL Server?

    - by Svish
    We currently have a number of columns in the database which are of type varchar. The application that uses them are in C# and it uses Linq2Sql for the communication (or what to call it). We would like to support unicode characters, which means we would have to convert the varchar columns into nvarchar. Is this a safe operation? Is it just a matter of changing the column type and updating the dbml file, or are there more stuff that needs to be done? Any changes in the C# code? Do I need to somehow convert the text that already exist in the database manually, or is it handled for me?

    Read the article

  • INSERT INTO temporary table from sp_executsql

    - by gotqn
    Generally, I am bulding dynamic SQL statement that is executing using sp_executsql like this: EXEC sp_executesql @TempSQLStatement I need to insert the return result row set in something (table variable or temporary table), but I am getting the following error: Msg 208, Level 16, State 0, Line 1746 Invalid object name '#TempTable'. after executing this: INSERT INTO #TempTable EXEC sp_executesql @TempSQLStatement From what I have read, I believe the issue is caused because I am not specifying the columns of the temporary table, but I am not able to do this because the return columns count varies. I have read that I can use global temporary tables, but I have done this before and wonder is there an other way to do that.

    Read the article

  • Oracle - Is there any effects of not having a primary key on a table ?

    - by Sathya
    We use sequence numbers for primary keys on the tables. There are some tables where we dont really use the primary key for any querying purpose. But, we have Indexes on other columns. These are non-unique indexes. The queries use these non-primary key columns in the WHERE conditions. So, I dont really see any benefit of having a primary key on such tables. My experience with SQL 2000 was that, it used to replicate tables which had some primary key. Otherwise it would not. I am using Oracle 10gR2. I would like to know if there are any such side-effects of having tables that dont have primary key.

    Read the article

  • Counting the most tagged tag with MySQL

    - by Jack W-H
    Hi folks My problem is that I'm trying to count which tag has been used most in a table of user-submitted code. But the problem is with the database structure. The current query I'm using is this: SELECT tag1, COUNT(tag1) AS counttag FROM code GROUP BY tag1 ORDER BY counttag DESC LIMIT 1 This is fine, except, it only counts the most often occurence of tag1 - and my database has 5 tags per post - so there's columns tag1, tag2, tag3, tag4, tag5. How do I get the highest occurring tag value from all 5 columns in one query? Jack

    Read the article

  • Silverlight HeaderStyle Broken?

    - by zburns
    Why does this not render correctly? <sdk:DataGrid AutoGenerateColumns="False" Height="438" HorizontalAlignment="Left" Margin="12,183,0,0" Name="dataGridWorkingGrid" VerticalAlignment="Top" Width="856" ClipboardCopyMode="IncludeHeader" CanUserReorderColumns="False" CanUserResizeColumns="False"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="BatchID" IsReadOnly="True" Visibility="Collapsed" Width="Auto" Binding="{Binding BatchID}"/> <sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Transaction Date" IsReadOnly="True" Width="100" Binding="{Binding TransactionDate, StringFormat='MM/dd/yyyy'}"> <sdk:DataGridTextColumn.HeaderStyle> <Style TargetType="TextBlock"> <Setter Property="TextWrapping" Value="Wrap"/> </Style> </sdk:DataGridTextColumn.HeaderStyle> </sdk:DataGridTextColumn> <sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Merchant Name" IsReadOnly="True" Width="200" Binding="{Binding MerchantName}"/> </sdk:DataGrid.Columns> </sdk:DataGrid>

    Read the article

  • Replication - User defined table type not propogating to subscriber

    - by Aamod Thakur
    I created a User defined table type named tvp_Shipment with two columns (id and name) . generated a snapshot and the User defined table type was properly propogated to all the subscribers. I was using this tvp in a stored procedure and everything worked fine. Then I wanted to add one more column created_date to this table valued parameter.I dropped the stored procedure (from replication too) and also i dropped and recreated the User defined table type with 3 columns and then recreated the stored procedure and enabled it for publication When i generate a new snapshot, the changes in user defined table type are not propogated to the subscriber. The newly added column was not added to the subscription. the Error messages: The schema script 'usp_InsertAirSa95c0e23_218.sch' could not be propagated to the subscriber. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001) Get help: http://help/MSSQL_REPL-2147201001 Invalid column name 'created_date'. (Source: MSSQLServer, Error number: 207) Get help: http://help/207

    Read the article

  • Zend Table Relationship Modeling with Composite Key

    - by emeraldjava
    I have a table with a composite primary key using four columns. mysql> describe leaguesummary; +------------------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------------+------------------+------+-----+---------+----------------+ | leagueid | int(10) unsigned | NO | PRI | NULL | auto_increment | | leaguetype | enum('I','T') | NO | PRI | NULL | | | leagueparticipantid | int(10) unsigned | NO | PRI | NULL | | | leaguestandard | int(10) unsigned | NO | | NULL | | | leaguedivision | varchar(5) | NO | PRI | NULL | | | leagueposition | int(10) unsigned | NO | | NULL | | I have the league object modelled as so (all plain enough mappings) <?php class Model_DbTable_League extends Zend_Db_Table_Abstract { protected $_name = 'league'; protected $_primary = 'id'; protected $_dependentTables = array('Model_DbTable_LeagueSummary'); And I've started like this on the new model class. I've mapped a simple reference map which returns all rows linked to the league id. // http://files.zend.com/help/Zend-Framework/zend.db.table.relationships.html // http://naneau.nl/2007/04/21/a-zend-framework-tutorial-part-one/ class Model_DbTable_LeagueSummary extends Zend_Db_Table_Abstract { protected $_name = "leaguesummary"; protected $_primary = array('leagueid', 'leaguetype','leagueparticipantid','leaguedivision'); protected $_referenceMap = array( 'Summary' => array( 'columns' => array('leagueid'), 'refTableClass' => 'Model_DbTable_League', 'refColumns' => array('id') ), ..... ); } ?> The simple case works when called from my controller public function listAction() { // action body $leagueTable = new Model_DbTable_League(); $this->view->leagues = $leagueTable->getLeagues(); $league = $leagueTable->getLeague(6); // work $summary = $league->findDependentRowset('Model_DbTable_LeagueSummary','Summary'); Zend_Debug::dump($summary,"",true); I'm not sure how i can define extra _referenceMap keys which will take extra contraint ket values. I would like to be able to define a set called 'MenA' in which the type and division values are hardcoded, and the league id is taken from the initial rowset. 'MenA' =>array( 'columns' => array('leagueid','leaguetype','leaguedivision'), 'refTableClass' => 'Model_DbTable_League', 'refColumns' => array("id","I","A") ) Is this style of mapping possible ie hardcoding the values into the 'refColumns'. The second crazy idea i had was to pass the variable values in as part of the third param of the findDependentRowset() method. $menA = $league->findDependentRowset('Model_DbTable_LeagueSummary','MenA',array("I","A")); Any suggestions on how I might use the Zend DB Table Relationship mapping correctly to do this would be appreciated. I'm not interested in the plain, old and ugly $db-select(a,b,c)-where(..) style solution.

    Read the article

  • How can I edit a css rule in jQuery?

    - by chacham15
    The purpose is that rows are dynamically added to a table and it is not as nice (and slower) to apply the rule manually later. The specific example is that I am creating a tree table to represent a folder directory. Each folder is a div. In each div, there is a ul with an li for each columns' information. These li have a class name equivalent to the column name. This provides column width. I want to make the columns resizable however. I could do $('.className').css('width', newWidth) but then this wont apply to newly inserted items. Therefore, I want to modify the css rule. How do I do this?

    Read the article

  • Is it possible to have a tableless select with multiple rows?

    - by outis
    A SELECT without a FROM clause gets us a multiple columns without querying a table: SELECT 17+23, REPLACE('bannanna', 'nn', 'n'), RAND(), CURRENT_TIMESTAMP; How can we write a query that results in multiple rows without referring to a table? Basically, abuse SELECT to turn it into a data definition statement. The result could have a single column or multiple columns. I'm most interested in a DBMS neutral answer, but others (e.g. based on UNPIVOT) are welcome. There's no technique application behind this question; it's more theoretical than practical.

    Read the article

  • Dynamic table design (common lookup table), need a nice query to get the values

    - by Swoosh
    sql2005 This is my simplified example: (in reality there are 40+ tables in here, I only showed 2) I got a table called tb_modules, with 3 columns (id, description, tablename as varchar): 1, UserType, tb_usertype 2, Religion, tb_religion (Last column is actually the name of a different table) I got an other table that looks like this: tb_value (columns:id, tb_modules_ID, usertype_OR_religion_ID) values: 1111, 1, 45 1112, 1, 55 1113, 2, 123 1114, 2, 234 so, I mean 45, 55, 123, 234 are usertype OR religion ID's (45, 55 usertype, 123, 234 religion ID`s) Don't judge, I didn't design the database Question How can I make a select, showing * from tb_value, plus one column That one column would be TITLE from the tb_usertype or RELIGIONNAME from the tb_religion table I would like to make a general thing. Was thinking initially about maybe a SQL function that returns a string, but I think I would need dynamic SQL, which is not ok in a function. Anyone a better idea ?

    Read the article

  • How to insert bulk data into mysql table from asp.net at once.

    - by kranthi
    Hi, I have a requirement that I need to read an excel sheet using asp.net/C# and insert all the records into mysql table.The excel sheet consists of around 2000 rows and 50 columns. Currently,upon reading the excel records ,I am inserting the records one by one using a prepare statement into mysql table.But its taking around 70 secs to do so because of the huge data. I've also thought of creating a new datarow, assigning values to each cell,adding the resulting datarow to datatable and finally calling dataadapter.update(...).But it seems to be complex because I got around 50 columns and hence I'll have to assign 50 values to the datarow. Could someone please suggest if there is an alternate to improve the performance of the insertion? Thanks

    Read the article

  • Populate DataGridViewComboBoxColumn runtime

    - by ghiboz
    Hi all! I have this problem: I have a datagridview that reads the data from a db and I wish, for an integer column use a combobox to choose some values... I modified the column using DataGridViewComboBoxColumn type and after, on the init of the form this: DataTable dt = new DataTable("dtControlType"); dt.Columns.Add("f_Id"); dt.Columns.Add("f_Desc"); dt.Rows.Add(0, "none"); dt.Rows.Add(1, "value 1"); dt.Rows.Add(2, "value 2"); dt.Rows.Add(3, "value 3"); pControlType.DataSource = dt; pControlType.DataPropertyName = "pControlType"; pControlType.DisplayMember = "f_Desc"; pControlType.ValueMember = "f_Id"; but when the program starts (after this code) this message appears:

    Read the article

  • wpf style converter : "Convert" called by every datagrid column using it

    - by Sonic Soul
    I created a converter, and assigned it to a style. than i assigned that style, to the columns i want affected. as rows are added, and while stepping through debugger, i noticed that the converter convert method gets called 1 time per column (each time it is used). is there a way to optimize it better, so that it gets called only once and all columns using it get the same value? <Style x:Key="ConditionalColorStyle" TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellStyle}"> <Setter Property="Foreground"> <Setter.Value> <Binding> <Binding.Converter> <local:ConditionalColorConverter /> </Binding.Converter> </Binding> </Setter.Value> </Setter> </Style>

    Read the article

< Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >