.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Asad Ali
Fauzul Azmi
Post New Web Links

Converting Rows into Columns

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :Sql Server
 

I have the data stored in the table stored in the the following format

RuleNum          Condtion       CValue    Action      AValue

4.1                    STATE             TX           SA           0043
4.1                    STATE             NM           SA          0031
4.1                    STATE     &nbs


View Complete Post


More Related Resource Links

Converting rows to columns

  

Hi,

I have the following temp table and I want insert each rows as columns in to another table

 

2007 1 1
2007 3 5

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

  
If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

Adding Multiple Columns and Rows in GridView without using a Database

  
This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

return only rows - no columns

  
Hi all, I'm using the below query to retrieve one vendor information. I dont want the columns and I need the query to return me one row with no column header. what would be the syntax for that. I'm trying to use this on SAP BW system - if that really matters. I tried tweaking the code, but SAP didnt seem to like it and the error message isnt helpful either. The code below works just fine - but I want to get rid of the column header SELECT [Measures].MEMBERS ON COLUMNS, NON EMPTY [0VENDOR].[LEVEL01].MEMBERS DIMENSION PROPERTIES [0VENDOR].[20VENDOR] ON ROWS FROM [OPOMCHS0/ZQT_GPO_PO_CHNG_REP_SUMM_3]WHERE[0VENDOR].[ABCD] Please help. Thanks in advance.

Hiding rows/columns completely in SSRS tablix even when they have data

  
I have several columns and rows in my tablix.  I don't want to see all of them at once.  I am using a parameter that controls the visibility of the columns or rows of the tablix.  The issue is that it hides but the white space is left.  How do i take out that white space?

How do i convert rows to columns?

  

hi friends,

the fucntion splits the csv value : hello there, 1, 1  and returns as one column three row table

hello there

1

1

How do convert this table of one column and three rows in to 1 row and 3 columns?

then i need to insert that to a table @tmp with definiton declare @tmp (txt nvarchar(max), corr int, is_act int)

thanks

 


Using Cursors to bring one table's rows into another table's columns.

  

hi

i have 2 tables; the first one records information about shapes. this table has 3 fields where the primary key is a composite one with the shapeID and DimensionName. 

one shape has 3 records in this table since there can only be 3 values as DimensionName for a given shape (weight, price and color)

 

the second table has the shape ID , weight, price and color as its columns. where the shapeID is the primary key.

 

now what i need to do is i need to map the first table's 3 columns in to 1 column of the second table. i am allowed to use cursors for this.

 

can anyone please explain how can a approach thisproblem?? code snippets are warmly welcomed. :)

 

please referr the image for further clarification. to view the image, click this link http://i53.tinypic.com/2rcal2x.png

 

thanks in advance

 


Urgent:Create/Update Winforms grid columns and rows with config file values

  

I have legacy winforms datagrid , I have to add/replace columns with new values, My new column names and row values are changes as per new requirements , so I am looking to update datagrid form any config file , so in future for any new requirements , If I update my config file , it hast update existing datagrid.

Please suggest me the code; I am trying from 4 days and its urgent now.

 Thanks

Satya


Urgent:Create/Update Winforms grid columns and rows with config file values

  

I have legacy winforms datagrid , I have to add/replace columns with new values, My new column names and row values are changes as per new requirements , so I am looking to update datagrid form any config file , so in future for any new requirements , If I update my config file , it hast update existing datagrid.

Please suggest me the code; I am trying from 4 days and its urgent now.

 Thanks

Satya


Satya

columns and rows of grid generate dynamically

  

hi

i am developing the applicaton, from which i have a grid and that grid i want to use for the insert data,

i have a page default.aspx page, in this i have a dropdownlist, according to selection of the dropdownlist, grid's cols and rows created dynamically in insert.aspx. so in page load of the insert.aspx the grid will automatically have that much of cols and rows and that all cell contain the textbox.

how can i set that dynamically....

please help me....

thanks in advance

waiting for the reply.....


Switch columns and rows in SSRS

  

Hi,

I have a report with static columns that looks something like this:

-------------------------------------------------------------------------------------------------

Date                      Column 1             Column2                           Column30

-------------------------------------------------------------------------------------------------

Rows into Columns

  

Hi guys, Quick question on the best way to achieve the following:

Have have GL Balanaces as at End of month stored in a table.

 The columns i have are:   Year, Amount, Jan, Feb |To| Dec

Example values:

Year  Amount Jan Feb Mar Apr

2010 1500 100 250 150 300

 I would like to get the data out in a Year/Month Cumulitive Totals: Ie:

2010 Jan 1600 (Amount + Jan)

2010 Feb 1850 (Amount + Jan + Feb)

2010 Mar 2000 (Amount + Jan + Feb + Mar)

2010 Apr 2300 (Amount + Jan + Feb + Mar + Apr)

What is the best wayu to achieve this?? Im was thinking some sort of Case statement, but im not sure how to write it.. All advice would be great! Thanks Scotty


Scott Lancaster - Sys Admin


updating multiple rows for multiple columns of the table from other table

  

HI,

I have source table called customer. And data from this table is transfered to another database  with same table name.

that is database1(customer table) ----> database 2(customer table)

now in database 2, First time my program runs and it randomly get any name and ssn and then updates the first name, last name, ssn of all the customer_ID's in the customer table (I use RAND function)

Now second when i run the program, it recreates the name and ssn again but different, for the same customer_id.

So i want that once the particular customer_ID is updated, next time if i run the program. it shold not update the those updated customer id's

Thanks, Any help is appreciated.

 


How to interchange columns to rows in datatable

  
I have datatable with following structure

Column1 Column2 Column3 Column4

Row1

Row2

Row3

Row4


But I want to have data like this

Row1 Row2 Row3 Row4

Column1

Column2

Column3

Column4

How could we do this in ADO.net

Dataset has one field, populate a table 2 columns wide n rows deep

  

Hello,

A dataset returns a single field of child names, instead of presenting this as a single column table, I would like it to be multi column.

Dataset returns:

Child1
Child2
Child3
Child4
Child5

I would like to display it as:

Child1 Child2 
Child3 Child4
Child5

 


Turn SQL Rows into columns (to use as a dimension)

  
Hi, 
I have a table which contains the following:
ReportID    Name
1794 Richard
1794 Robert
1794 Steve
1794 NULL
1146 Gemma
1146 Lucy
1146 Katy
1146 Michelle


I need a select query to generate the following, so I can create dimensions of Name1, Name2, Name3.....

ReportID Name1     Name2     Name3     Name4    
1146 Richard Robert Steve NULL
1794 Gemma Lucy Katy Michelle

Any ideas chaps?


rows to fixed number columns

  

if result is 11 single column rows, need it formatted as 3 rows 4 columns each.  besides brute force, what can I do?

 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend