Search Results

Search found 10060 results on 403 pages for 'column'.

Page 3/403 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Identity column SQL Server 2005 inserting same value twice

    - by DannykPowell
    I have a stored procedure that inserts into a table (where there is an identity column that is not the primary key- the PK is inserted initially using the date/time to generate a unique value). We then use SCOPEIDENTITY() to get the value inserted, then there is some logic to generate the primary key field value based on this value, which is then updated back to the table. In some situations the stored procedure is called simultaneously by more than one process, resulting in "Violation of PRIMARY KEY constraint..." errors. This would seem to indicate that the identity column is allowing the same number to be inserted for more than one record. First question- how is this possible? Second question- how to stop it...there's no error handling currently so I'm going to add some try/ catch logic- but would like to understand the problem fully to deal with properly

    Read the article

  • Query a column and a calculation of columns at the same time PostgreSQL

    - by pablo
    Hi I have two tables, Products and BundleProducts that have o2o relation with BaseProducts. A BundleProduct is a collection of Products using a m2m realtion to the Products table. Products has a price column and the price of a BundleProduct is calculated as the sum of the prices of its Products. BaseProducts have columns like name and description so I can query it to get both Products and BundleProducts. Is it possible to query and sort by price both for the price column of the Products and calculated price of the BundleProducts? Thanks

    Read the article

  • Compute column widths in a HTML-like manner (based on cell contents)

    - by cipak
    Hi, I have a grid of data that I want to export to RTF, PDF etc. using various (and not perfect) PHP converters/generators. What I am missing most is the HTML table automatic adjustment of column widths based on the lengths of strings in the cells (strings contain line breaks which complicate things a bit, as they should be preserved). I need an algorithm that, given the contents of the cells (plain text), a total width of the table and an average width of a character, would return a width for each column. I wouldn't want to reinvent the wheel if something is already available. Of course it can't be perfect if the font is variable width, but an approximation would do just fine. Or maybe it could have a configurable table with widths for each character. Any hint would be appreciated. Thank you.

    Read the article

  • Automatic multi-page multi-column flowing text with QtWebkit (HTML/CSS/JS -> PDF)

    - by Peter Boughton
    I have some HTML documents that are converted to PDF, using software that renders using QtWebkit (not sure which version). Currently, the documents have specific tags to split into columns and pages - so whenever the wording changes, it is a manual time-consuming process to move these tags so that the columns and pages fit. Can anyone provide a way to have text auto-wrapped into the next column/page (as appropriate) when it reaches the bottom of the current container? Any HTML, CSS or JS supported by QtWebkit is ok (assuming it works in the PDF converter). (I have tested the webkit-column-* in CSS3 and it appears QtWebkit does not support this.) To make things more exciting, it also needs to: - put a header at the top of each page, with page X of Y numbering; - if an odd number of pages, add a blank page at the end (with no header); - have the ability to say "don't break inside this block" or "don't break after this header" I have put some quick example initial markup and target markup to help explain what I'm trying to do. (The actual documents are far more complicated than that, but I need a simple proof-of-concept before I attack the real ones.) Any suggestions? Update: I've got a partially working solution using Aaron's "filling up" suggestion - I'll post more details in a bit.

    Read the article

  • DataTable identity column not set after DataAdapter.Update/Refresh on table with "instead of"-trigge

    - by Arno
    Within our unit tests we use plain ADO.NET (DataTable, DataAdapter) for preparing the database resp. checking the results, while the tested components themselves run under NHibernate 2.1. .NET version is 3.5, SqlServer version is 2005. The database tables have identity columns as primary keys. Some tables apply instead-of-insert/update triggers (this is due to backward compatibility, nothing I can change). The triggers generally work like this: create trigger dbo.emp_insert on dbo.emp instead of insert as begin set nocount on insert into emp ... select @@identity end The insert statement issued by the ADO.NET DataAdapter (generated on-the-fly by a thin ADO.NET wrapper) tries to retrieve the identity value back into the DataRow: exec sp_executesql N' insert into emp (...) values (...); select id, ... from emp where id = @@identity ' But the DataRow's id-Column is still 0. When I remove the trigger temporarily, it works fine - the id-Column then holds the identity value set by the database. NHibernate on the other hand uses this kind of insert statement: exec sp_executesql N' insert into emp (...) values (...); select scope_identity() ' This works, the NHibernate POCO has its id property correctly set right after flushing. Which seems a little bit counter-intuitive to me, as I expected the trigger to run in a different scope, hence @@identity should be a better fit than scope_identity(). So I thought no problem, I will apply scope_identity() instead of @@identity under ADO.NET as well. But this has no effect, the DataRow value is still not updated accordingly. And now for the best part: When I copy and paste those two statements from SqlServer profiler into a Management Studio query (that is including "exec sp_executesql"), and run them there, the results seem to be inverse! There the ADO.NET version works, and the NHibernate version doesn't (select scope_identity() returns null). I tried several times to verify, but to no avail. Of course this just shows the resultset coming from the database, whatever happens inside NHibernate and ADO.NET is another topic. Also, several session properties defined by T-SQL SET are different in the two scenarios (Management Studio query vs. application at runtime) This is a real puzzle to me. I would be happy about any insights on that. Thank you!

    Read the article

  • Column-oriented DBMS and JOIN operations

    - by André
    From some of the research I've done on NoSQL, column-oriented databases (like HBase or Cassandra) seem to solve the problem of costly JOIN operations, but I don't get how this approach solves this problem. Can anyone explain it to me and/or link me to interesting documentation regarding this area? Thanks

    Read the article

  • How to set two column unique in SQL.

    - by sxingfeng
    I am creating a table ,in the table two column is unique, I mean columnA and columnB do not have same value: such as : Table X A B 1 2(RIGHT,unique) 2 2(RIGHT, unique) 1 3(RIGHT, not unique) 2 3(RIGHT, not unique) 1 2 (WRONG, not unique) How to create such a table? many thanks!

    Read the article

  • Simple 2 column CSS layout with nested divs

    - by Dan
    Hello, I have good familiarity with CSS but for some reason I am unable to achieve the result I want in this case. Here is the link to my test site http://danberinger.com/test.html Keep in mind that I want a 2 column layout and that the background wrapper color (gray) is not showing. Instead the body background color image is being put in place of where the wrapper background should be. Any suggestions would be greatly appreciated.

    Read the article

  • Modify site column(type text) to allow more than 255 characters

    - by alienavatar
    Hi friends I have created custom site column with type text and I included in one of content types. But it is allowing me for 255 characters only. In which way I can extend it, say 1024 characters. I did this before by mentioning somewhere in web.config file but I forgot how i did. Can anyone please tell me how can I achieve this. Thanks in advance.

    Read the article

  • C# Find out what column caused the Sql Exception

    - by PaN1C_Showt1Me
    Hi. I'm getting an exception from SQL Data Reader (MS SQL as datastore) and I'd like to know which column name causes this Exception to be thrown. But I cannot find it in the InnerException.. nowhere. ((System.InvalidOperationException)ex.InnerException).StackTrace: System.Data.SqlClient.SqlDataReader.ReadColumnHeader(Int32 i) System.Data.SqlClient.SqlDataReader.IsDBNull(Int32 i) ... Where is it hidden please ?

    Read the article

  • Why column rename script generated by SSMS uses temporary name?

    - by abatishchev
    When I rename a table column in Designer mode in SQL Server Management Studio 2008 (both R2 and non-R2) and generate a change script it looks like this: EXECUTE sp_rename N'table.column', N'Tmp_columnNew', 'COLUMN' GO EXECUTE sp_rename N'table.Tmp_columnNew', N'columnNew', 'COLUMN' GO What for temporary column name is used? Why don't rename at once?

    Read the article

  • mysql join with multiple values in one column

    - by CYREX
    I need to make a query that creates 3 columns that come from 2 tables which have the following relations: TABLE 1 has Column ID that relates to TABLE 2 with column ID2 In TABLE 1 there is a column called user In TABLE 2 there is a column called names There can be 1 unique user but there can be many names associated to that user. If i do the following i get all data BUT the user column repeats itself for each name it has associated. What i want is for use to appear unique but the names columns appear with all the names associated to the user column but separated by commas, like the following: select user,names from TABLE1 left join TABLE2 on TABLE1.id = TABLE2.id This will show the users repeated everytime a name appears for that user. what i want is to appear like this: USER - NAMES cyrex - pedrox, rambo, zelda homeboy - carmen, carlos, tom, sandra jerry - seinfeld, christine ninja - soloboy etc....

    Read the article

  • MySQL Export with Column Heading

    - by st4nt0n
    Hello - I am very, very, new to mySQL. I've got experience in general technical terms, but not with the syntax or concepts of mySQL. I have been tasked with exporting a table from MySQL into a pipe delimited .txt or .xls that I can use to add 7500 more records to manually, then import back into the table. I tried to use INTO OUTFILE, but I don't get column headings, which I need for reference to merge the new records. Is there a good resource that can explain this to a complete novice? I would usually go down to my bookstore and start learning, but I'm on a bit of a time crunch. Thanks all!

    Read the article

  • Problem with table resizing after automatically removing from jquery one column (this only happens i

    - by user297433
    Hi. I have a table with some columns. Something like this: tr1td1 one remove button tr1td2 one remove button ... The table has the size of the div#outer When I click remove button I remove with jquery the entire column . In Firefox everything's fine the table's columns resize to fill the div but in Internet Explorer the table's columns remain just as they are. It's like the browser doesn't refresh the css style. Because if I refresh the page the table looks just as it shoud be. Any ideas?

    Read the article

  • css display:table first column too wide

    - by Mestore
    I have a css table setup like this: <div class='table'> <div> <span>name</span> <span>details</span> </div> </div> The css for the table is: .table{ display:table; width:100%; } .table div{ text-align:right; display:table-row; border-collapse: separate; border-spacing: 0px; } .table div span:first-child { text-align:right; } .table div span { vertical-align:top; text-align:left; display:table-cell; padding:2px 10px; } As it stands the two columns are split evenly between the space occupied by the width of the table. I'm trying to get the first column only to be as wide as is needed by the text occupying it's cells The table is an unknown width, as are the columns/cells.

    Read the article

  • Investigating on xVelocity (VertiPaq) column size

    - by Marco Russo (SQLBI)
      In January I published an article about how to optimize high cardinality columns in VertiPaq. In the meantime, VertiPaq has been rebranded to xVelocity: the official name is now “xVelocity in-memory analytics engine (VertiPaq)” but using xVelocity and VertiPaq when we talk about Analysis Services has the same meaning. In this post I’ll show how to investigate on columns size of an existing Tabular database so that you can find the most important columns to be optimized. A first approach can be looking in the DataDir of Analysis Services and look for the folder containing the database. Then, look for the biggest files in all subfolders and you will find the name of a file that contains the name of the most expensive column. However, this heuristic process is not very optimized. A better approach is using a DMV that provides the exact information. For example, by using the following query (open SSMS, open an MDX query on the database you are interested to and execute it) you will see all database objects sorted by used size in a descending way. SELECT * FROM $SYSTEM.DISCOVER_STORAGE_TABLE_COLUMN_SEGMENTS ORDER BY used_size DESC You can look at the first rows in order to understand what are the most expensive columns in your tabular model. The interesting data provided are: TABLE_ID: it is the name of the object – it can be also a dictionary or an index COLUMN_ID: it is the column name the object belongs to – you can also see ID_TO_POS and POS_TO_ID in case they refer to internal indexes RECORDS_COUNT: it is the number of rows in the column USED_SIZE: it is the used memory for the object By looking at the ration between USED_SIZE and RECORDS_COUNT you can understand what you can do in order to optimize your tabular model. Your options are: Remove the column. Yes, if it contains data you will never use in a query, simply remove the column from the tabular model Change granularity. If you are tracking time and you included milliseconds but seconds would be enough, round the data source column to the nearest second. If you have a floating point number but two decimals are good enough (i.e. the temperature), round the number to the nearest decimal is relevant to you. Split the column. Create two or more columns that have to be combined together in order to produce the original value. This technique is described in VertiPaq optimization article. Sort the table by that column. When you read the data source, you might consider sorting data by this column, so that the compression will be more efficient. However, this technique works better on columns that don’t have too many distinct values and you will probably move the problem to another column. Sorting data starting from the lower density columns (those with a few number of distinct values) and going to higher density columns (those with high cardinality) is the technique that provides the best compression ratio. After the optimization you should be able to reduce the used size and improve the count/size ration you measured before. If you are interested in a longer discussion about internal storage in VertiPaq and you want understand why this approach can save you space (and time), you can attend my 24 Hours of PASS session “VertiPaq Under the Hood” on March 21 at 08:00 GMT.

    Read the article

  • Investigating on xVelocity (VertiPaq) column size

    - by Marco Russo (SQLBI)
      In January I published an article about how to optimize high cardinality columns in VertiPaq. In the meantime, VertiPaq has been rebranded to xVelocity: the official name is now “xVelocity in-memory analytics engine (VertiPaq)” but using xVelocity and VertiPaq when we talk about Analysis Services has the same meaning. In this post I’ll show how to investigate on columns size of an existing Tabular database so that you can find the most important columns to be optimized. A first approach can be looking in the DataDir of Analysis Services and look for the folder containing the database. Then, look for the biggest files in all subfolders and you will find the name of a file that contains the name of the most expensive column. However, this heuristic process is not very optimized. A better approach is using a DMV that provides the exact information. For example, by using the following query (open SSMS, open an MDX query on the database you are interested to and execute it) you will see all database objects sorted by used size in a descending way. SELECT * FROM $SYSTEM.DISCOVER_STORAGE_TABLE_COLUMN_SEGMENTS ORDER BY used_size DESC You can look at the first rows in order to understand what are the most expensive columns in your tabular model. The interesting data provided are: TABLE_ID: it is the name of the object – it can be also a dictionary or an index COLUMN_ID: it is the column name the object belongs to – you can also see ID_TO_POS and POS_TO_ID in case they refer to internal indexes RECORDS_COUNT: it is the number of rows in the column USED_SIZE: it is the used memory for the object By looking at the ration between USED_SIZE and RECORDS_COUNT you can understand what you can do in order to optimize your tabular model. Your options are: Remove the column. Yes, if it contains data you will never use in a query, simply remove the column from the tabular model Change granularity. If you are tracking time and you included milliseconds but seconds would be enough, round the data source column to the nearest second. If you have a floating point number but two decimals are good enough (i.e. the temperature), round the number to the nearest decimal is relevant to you. Split the column. Create two or more columns that have to be combined together in order to produce the original value. This technique is described in VertiPaq optimization article. Sort the table by that column. When you read the data source, you might consider sorting data by this column, so that the compression will be more efficient. However, this technique works better on columns that don’t have too many distinct values and you will probably move the problem to another column. Sorting data starting from the lower density columns (those with a few number of distinct values) and going to higher density columns (those with high cardinality) is the technique that provides the best compression ratio. After the optimization you should be able to reduce the used size and improve the count/size ration you measured before. If you are interested in a longer discussion about internal storage in VertiPaq and you want understand why this approach can save you space (and time), you can attend my 24 Hours of PASS session “VertiPaq Under the Hood” on March 21 at 08:00 GMT.

    Read the article

  • How to get distinct values from a column with all its corresponding values in another column

    - by Vishnu
    I know the question is bit confusing. Please read below. I have a table table_categories (id INT(11), cname VARCHAR(25),survey_id INT(11)) I want to retrieve the values for the column cname without duplication, that is distinct values but with all the values in the other column. id cname survey_id -- -------- --------- 1 Trader 2 2 Beginner 2 25 Human 1 26 Human 2 From the above example I want to retrieve distinct cnames with all the values of the survey_id. I don't want to use any programming language. Is there any way by using a single query. Please give me a solution in MySQL.

    Read the article

  • Convert a Row to a Column (or Backwards) in Google Docs Spreadsheets

    - by The Geek
    If you have to deal with a lot of spreadsheets, you’re probably really bored right now. You also might be wondering how to turn a row into a column, or a column into a row. Here’s how to do it with Google Docs Spreadsheets. If you’re an Excel user, you’re also in luck, because we’ve already shown you how to turn a row into a column, or vice-versa. It won’t make you any less bored though. Convert a Row to a Column (or backwards) The first thing you’ll need is a column or a row of information that you want to convert into the opposite. For our example, we’ve got this set of data that we created by using the Auto Fill options in Google Docs. Now in another cell, you’ll need to use the TRANSPOSE function, which you can use by simply typing in the following: =TRANSPOSE( And then selecting the cells with the mouse, or manually typing in the range of cells you want to copy. The final function in this example was: =TRANSPOSE(A1:A11) Finish it off with the final ) character to complete the function, hit the Enter key, and there we are… the column was transposed over to the right. You can use the same thing to turn columns into rows, or rows into columns—just change the range you are looking for. Similar Articles Productive Geek Tips How To Use AutoFill on a Google Docs Spreadsheet [Quick Tips]Integrate Google Docs with Outlook the Easy WayHow To Export Documents from Google Docs to Your ComputerConvert a Row to a Column in Excel the Easy WayScroll Backwards From the Ubuntu Server Command Line TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Check Your IMAP Mail Offline In Thunderbird Follow Finder Finds You Twitter Users To Follow Combine MP3 Files Easily QuicklyCode Provides Cheatsheets & Other Programming Stuff Download Free MP3s from Amazon Awe inspiring, inter-galactic theme (Win 7)

    Read the article

  • SQL Developer Quick Tip: Reordering Columns

    - by thatjeffsmith
    Do you find yourself always scrolling and scrolling and scrolling to get to the column you want to see when looking at a table or view’s data? Don’t do that! Instead, just right-click on the column headers, select ‘Columns’, and reorder as desired. Access the Manage Columns dialog Then move up the columns you want to see first… Put them in the order you want – it won’t affect the database. Now I see the data I want to see, when I want to see it – no scrolling. This will only change how the data is displayed for you, and SQL Developer will remember this ordering until you ‘Delete Persisted Settings…’ What IS Remembered Via These ‘Persisted Settings?’ Column Widths Column Sorts Column Positions Find/Highlights This means if you manipulate one of these settings, SQL Developer will remember them the next time you open the tool and go to that table or view. Don’t know what I mean by ‘Find/Highlight?’ Find and highlight values in a grid with Ctrl+F

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >