Showing posts with label row. Show all posts
Showing posts with label row. Show all posts

Wednesday, March 28, 2012

How to assign value to a package variable in a data flow task ?

Hi Everyone,

In the data flow task, i have done a group by and now i have a single row.... I want to assign the value in this row to a package variable.... Without using the script component .......Any suggestions ?

Regards,

Manu

You'll have to use the script component.|||

Hi Manu,

I haven't used it myself, yet. But i think you can use the recordset destination to bind a recordset to a variable.

Hope this helps, if so set this post to useful.

Thanks,

Johan Blad

|||

JBlad wrote:

Hi Manu,

I haven't used it myself, yet. But i think you can use the recordset destination to bind a recordset to a variable.

Hope this helps, if so set this post to useful.

Thanks,

Johan Blad

Yes, technically, but you'd still have to work with that recordset in the control flow, as the variable type would be Object. So you'd have to "shred" the recordset to get the real value.

|||Thanks, for me this is an eye-opener. Haven't worked with it and now doubt if i will.sql

How to assign value to a package variable in a data flow task ?

Hi Everyone,

In the data flow task, i have done a group by and now i have a single row.... I want to assign the value in this row to a package variable.... Without using the script component .......Any suggestions ?

Regards,

Manu

You'll have to use the script component.|||

Hi Manu,

I haven't used it myself, yet. But i think you can use the recordset destination to bind a recordset to a variable.

Hope this helps, if so set this post to useful.

Thanks,

Johan Blad

|||

JBlad wrote:

Hi Manu,

I haven't used it myself, yet. But i think you can use the recordset destination to bind a recordset to a variable.

Hope this helps, if so set this post to useful.

Thanks,

Johan Blad

Yes, technically, but you'd still have to work with that recordset in the control flow, as the variable type would be Object. So you'd have to "shred" the recordset to get the real value.

|||Thanks, for me this is an eye-opener. Haven't worked with it and now doubt if i will.

Monday, March 26, 2012

How to append a header row in SELECT

Hi All,

When calling my SELECT statement, I would like to have Column name and Data type as the first record. Is this possible to do?
I would like to make a SP that would select all data from any table(with a header row) with just:

_sp_getData ' table_name'

I looked at sysobjects, and syscolumns tables, but was unable to put it all together. I have over 200+ tables, so creating variables for every column is very cumbersome.

Something like this:


select 0 AS SortCol ,
cast(min(case ordinal_position when 1 then column_name end) as varchar) as col1,
cast(min(case ordinal_position when 2 then column_name end) as varchar) as col2,
cast(min(case ordinal_position when 3 then column_name end) as varchar) as col3,
cast(min(case ordinal_position when 4 then column_name end) as varchar) as col4,
cast(min(case ordinal_position when 5 then column_name end) as varchar) as col5,
cast(min(case ordinal_position when 6 then column_name end) as varchar) as col6,
cast(min(case ordinal_position when 7 then column_name end) as varchar) as col7,
cast(min(case ordinal_position when 8 then column_name end) as varchar) as col8,
cast(min(case ordinal_position when 9 then column_name end) as varchar) as col9
from information_schema.columns where table_name = 'authors'
union all
select 1 , au_id, au_lname, au_fname, phone, address, city, state, zip,
cast(contract as varchar)
from authors


Is not an option.

Thank you very much in advance,
Vla OrlovskyJust an advice: do not do it. THis is not SQL. You add an additional non-data row int data. VERY bad style.

Especially as you then go on and say the one way to do it (union) is not an option.|||Hi Tom,

Thanks for reply.

In my case, I just want to export data into a VB RecordSet and into a CSV text file.
My co-workers want to have the data to be imported into other places.
I just want to create a simple GUI that allows them to get the data without involving me.

Sincerely,
Vlad Orlovsky|||So what?

Before exposrint to a CSV file, write the first line with the names of the columns.

Interesting enough, the information is in the VB recordset.|||If I understand correctly, before you output the actual data to CSV, you can just loop through the fields collection on the first row of your recordset and output the Name and Type property like below:

For intCounter = 0 To oRS.Fields.Count - 1
strName = oRS.Fields(intCounter).Name
strType = oRS.Fields(intCounter).Type
Next|||Hi,

I wanted to get the data the most fastest way posible.(with very little IIS processing)

Sincerely,
Vlad Orlovsky

Wednesday, March 21, 2012

How to add Total to Matrx Column/Row

Hi there,
I have a report with 2 column groupings and 5 row groupings looks like
this:
+Unit
+Time
+Type +Sub_Type +Start +Result +Orig SUM(!Field1.Value)
I want to add "Total" to every column and every row and final total
like this:
+Unit
+Time
+Type +Sub_Type +Start +Result +Orig SUM(!Fieldxx) Total_of_Row
Total_of_Column Total
How can I add a column at the right end and a row at the bottom? What
kind of expression should I use?
Thanks a lot.
HenryHenry,
I'm not sure how far along you are but I found out how to add Row & column
subtotals by accident. In Layout mode, right click your "Row" or "Coumn"
field and select SubTotal. THe problem I am experiencing is you have very
limited control over the style. ie wanting the subtotals to be bolded.
Hope this helps - Glen
"Henry" wrote:
> Hi there,
> I have a report with 2 column groupings and 5 row groupings looks like
> this:
> +Unit
> +Time
> +Type +Sub_Type +Start +Result +Orig SUM(!Field1.Value)
> I want to add "Total" to every column and every row and final total
> like this:
> +Unit
> +Time
> +Type +Sub_Type +Start +Result +Orig SUM(!Fieldxx) Total_of_Row
> Total_of_Column Total
> How can I add a column at the right end and a row at the bottom? What
> kind of expression should I use?
> Thanks a lot.
> Henry
>|||It works well, Thanks a lot.
Henry
"Glen" <Glen@.discussions.microsoft.com> wrote in message news:<27B4E130-0C08-49DA-82B2-8E94B66B0216@.microsoft.com>...
> Henry,
> I'm not sure how far along you are but I found out how to add Row & column
> subtotals by accident. In Layout mode, right click your "Row" or "Coumn"
> field and select SubTotal. THe problem I am experiencing is you have very
> limited control over the style. ie wanting the subtotals to be bolded.
> Hope this helps - Glen
> "Henry" wrote:
> > Hi there,
> >
> > I have a report with 2 column groupings and 5 row groupings looks like
> > this:
> >
> > +Unit
> > +Time
> > +Type +Sub_Type +Start +Result +Orig SUM(!Field1.Value)
> >
> > I want to add "Total" to every column and every row and final total
> > like this:
> >
> > +Unit
> > +Time
> > +Type +Sub_Type +Start +Result +Orig SUM(!Fieldxx) Total_of_Row
> > Total_of_Column Total
> >
> > How can I add a column at the right end and a row at the bottom? What
> > kind of expression should I use?
> > Thanks a lot.
> >
> > Henry
> >

Monday, March 19, 2012

how to add some empty row in table_detail section?

how to do?
Thanks
willingi think i can build a special sql querystring to realize it,
but it's too complex,is there any way?|||This is from RS Books OnLine:
How to insert or delete a row (Report Designer)
To insert a row
1. In Layout view, click the table so that column and row handles appear
above and next to the table.
2. Right-click a row handle where you want to insert a row, and then click
Insert Row Above or Insert Row Below.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com|||i don't meaning this,i just want to export some empty row in my report to
fill the page,for example,i get 2 detail rows from the sqlserver,so,the page
will show this two rows,but now,i want show another eight empty rows below
this 2 rows|||> i don't meaning this,i just want to export some empty row in my report to
> fill the page,for example,i get 2 detail rows from the sqlserver,so,the
page
> will show this two rows,but now,i want show another eight empty rows below
> this 2 rows
Then I think you should go with Select, using UNION ALL to add rows.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com

How to add row number in cryatl report 10?

Hi all,
I am working in crystal report 10. In the report i need to add row numbers in each page starting from 1.
Eg: Page1 row1
row 2
row 3 ..
Page 2 row 1
row 2
row 3 etc..

Colud anyone pls suggest how this can be done? very urgent...

Regards,
AmbiliPut a formula in the page header to reset a row number variable, and one in the detail to increment / display it.|||Always remember

You initialize a vairiable in the Header Section, Increment it in the Details section, Show/Print it in the Footer section

regards
Amarjit

Monday, March 12, 2012

how to add more than one recored to sql table in the same time

i want to add more than one row in the same time i tried to use for loop but didnt work any ideas please

Please post exactly what you want to do with table names.

|||

Can you show us your code and maybe someone can help you figure out why its not working