I have a table that looks like this: ProductId, Color "1", "red, blue, green" "2", null "3", "purple, green" And I want to expand it to this: ProductId, Color 1, red 1, blue 1, green 2, null 3, purple 3, g
i have a table with a column have value seperated by semi colon. the concern is value in the column are not fixed. it starts from 1 and end upto 80 semicolon sepaeration. i am trying to put each individual value to seperate column SQL SERVER 2008 cod
I've an access table like this ID | UserName | CarBrand ------------------------- 0 Peter VW 1 Peter Ferrari 2 Mike Audi 3 Peter Dodge 4 Heidi BMW 5 Heidi Ford I need the names from the CarBrand field as a comma separated list for a report. Is there
Would it be possible to construct SQL to concatenate column values from multiple rows? The following is an example: Table A PID A B C Table B PID SEQ Desc A 1 Have A 2 a nice A 3 day. B 1 Nice Work. C 1 Yes C 2 we can C 3 do C 4 this work! Output of
This question already has an answer here: Java: Insert multiple rows into MySQL with PreparedStatement 6 answers I need to insert multiple rows into SQL Server database (100 at a time) from my Java code. How can I do this? Currently I am inserting on
I just wanted to know, if there is any technique to insert values into multiple tables in sql Server 2008 Database? I've got the following cmd.CommandText = "Insert into tb1 (col1, col2, col3) values (@col1, @col2, @col3); Insert into tb2 (col1, col2
I have a table in SQL Server that has 34 columns. I need sum all column values in a row in SQL Server. Table : [CALEN] Columns: YEAR_ | MONTH_ |D1 | D2 | D3 | D4 | D5 .... | D31 | Days ------------------------------------------------------------ 1392
I have a table tbl_commaseperate with columns ID, MONNAME, IP and POLICY whose values are: ID | MONNAME | IP | POLICY ------------------------------- X | NOV | 1,2,3 | 4,5,6,7 where IP and POLICY have comma separated values. My desired result looks l
I have data that looks like this: CUSTOMER_ID OPERDAYSJUL OPERDAYSAUG OPERDAYSSEP ... OPERDAYSJUN 1 30 15 2 2 5 1 0 3 6 0 12 4 12 5 23 For each customer_id, I want a comma-delimited list indicating which months the customer operates: CUSTOMER_ID OPER
I've got a view for reports, that looks something like this: SELECT a.id, a.value1, a.value2, b.value1, /* (+50 more such columns)*/ FROM a JOIN b ON (b.id = a.b_id) JOIN c ON (c.id = b.c_id) LEFT JOIN d ON (d.id = b.d_id) LEFT JOIN e ON (e.id = d.e_
I have two tables: CONFIRMATION & CONFIRMATION_PRESS CONFORMATION Table looks like following: ID_CONF | ID_LOT | QTY 1005 175 25 1006 175 24 1007 175 23 1008 176 50 CONFIRMATION_PRESS Table looks like following: ID_CONF | ID_PRESS 1005 11 1005 22 100
In SQL Server 2005 I am inserting a row into a table using a stored procedure and I want to fetch the new primary key value just after inserting that row. I am using following approach to get primary key value after insertion row Create Proc Sp_Test
I have a database with a main table (lets call it Owner) and several sub tables with holdings (like Cars, Books etc). For example: Owner has columns: owner_id, name Cars has columns: owner_id (foreign key), brand Books has columns: owner_id (foreign
I'm using SQL Server 2005. I have a series of product and pricing tables from which I draw a view that provides several line items for each product, depending on whether the item's markup is set at item level, category level, or department level. So