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


Top 5 Contributors of the Month
david stephan
Post New Web Links

return only rows - no columns

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
 
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.


View Complete Post


More Related Resource Links

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.

Query to return TOP n with 'Other' grouping for all remaining rows

  
Hi all, I've been given a specific type of report to produce, and am having difficulty in getting my SQL right to return the data as needed. I need to return TOP n Categories based on amount of sales (which I can do) but then a final category with a sum of all other sales. The purpose would be to capture all of the small sales values into one 'Other' category so that the chart I'll produce does not have lots and lots of small-value columns. I found the following post which seems to come close: SELECT TOP 10 CompanyID, CompanyName, SUM(GrossSales) [GrossSales] FROM CompanySales GROUP BY CompanyID, CompanyName ORDER BY SUM(GrossSales) desc UNION SELECT -1, 'Other' [CompanyName], SUM(GrossSales) [GrossSales] FROM CompanySales WHERE CompanyID NOT IN ( SELECT TOP 10 CompanyID, CompanyName, SUM(GrossSales) [GrossSales] FROM CompanySales GROUP BY CompanyID, CompanyName ORDER BY SUM(GrossSales) desc ) But this gives a syntax error on UNION, which I'm guessing is due to the ORDER BY clauses. However I think the ORDER BY is needed to ensure I return the results in the correct order. Does anyone have any ideas of how to do this? Thanks for any assistance Matt

return rows with constant interval

  
what function should we use to return all alternate/ or rows that come after some constant number.   Please advice

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?

function or query to return continuous span of months $ years as rows in query

  

Hello,

I am using SS2008.

There are many situations in which I need to return a table where the rows are EVERY calendar month between two dates, not just the months where there is data present.

Is there a function that would take a beginning and end date mmddyyyy which would do this?

For example if I wanted 1/2004 through 8/2010?

1/2004

2/2004

3/2004

and so on to

........

6/2010

7/2010

8/2010

Thanks in advance,

John

 

 


How to return looped procedure results so that they display as multiple rows of a single output inst

  

I understand that the below fragment will return a separate 1-row results set for each successful loop (also unnecessarily repeating the column header each time). How can I alter my procedure so that each value returned by the loop is appended underneath the previous value as multiple rows of a single results set? Do I have to store each return value in a temp table or someother storage object? It would be nice to just be able to spit them out row by row as each loop returned. Possible? Easy? Hard? I really appreciate the help I've received here so far.

DECLARE techCursor CURSOR 
FOR 
SELECT (whatever)

OPEN techCursor;
FETCH NEXT FROM techCursor INTO @techNumLoop;
WHILE @@FETCH_STATUS = 0
BEGIN
EXECUTE pr_FindExpenses4Tech @techNumLoop, @itemCount OUTPUT
SELECT @itemCount Item_Count
F

Conditional insert: If select return rows, insert rows to table otherwise insert specific row indica

  
This is what I have

Insert into ReportDetail( Partcipantid, Reportid)  

select distinct ParticipantID , 9 from OpenCredit

      except select ParticipantID, 9 from StoreCredit where Closed = 0

 Issue is that when above select statement returns no row, it seems like no record is

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

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

 


Converting Rows into Columns

  

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

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

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

Revised Question XML Value Method Return Multiple Rows

  

Question earlier asked and answered to run query to collect sql data from xml schema

was able to collect the scheme from node but query did not return data but xml string

question

I ran this query

select x.col.value ('

 

 

FROM PATIENTTRAC_SUBMISSION_HISTORY

cross apply

PATIENTTRAC_EDI_SUBMISSION.nodes('

(
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