Showing posts with label output. Show all posts
Showing posts with label output. Show all posts

Wednesday, March 28, 2012

how to ''create new/overwrite existing'' worksheets in xls output?

anyone know how you can do this?

Yes, If I'm not wrong you can use Execute Sql Task in order to create a new one using Excel Connection Manager:

Example:

CREATE TABLE `Z` (
`CODIGO_TERRITORIAL` Byte ,
`CODIGO_REGIONAL` Byte)

|||

Enric is right, you can create the sheet via execute sql task. In order to override it, the easiest way I know is to delete/move the file so the next time the file gets create again. There are lot of threads that tlaks about that.

I have an example that can help you:

http://rafael-salas.blogspot.com/2006/12/import-header-line-tables-into-dynamic_22.html

Wednesday, March 7, 2012

how to count this ?

Hi,
This is my table structure ,

Name

John
John
Raj
John
Raj

From the above table i want to count the repeated name and my output should be

Name Count

John 3
Raj 2

since no of jone in my table is 3 and number of Raj is 2 .
how to write the query for this ?

try it like this:

SELECT [Name],COUNT(*)AS [Count]FROM yourTableGROUP BY [Name]

How to Count the Items In Dataregion With out writing Query

Hi Group,
How to Count the items
Sample:
ID TestColumn
1 Coding
2 Design
3 Coding
4 Coding
5 Requirement
6 Coding
My Output Should be
Requirements Count Design Count Coding Count
1 1 4If you make a group on the Testcolumn, you may use one of the Count()
functions to count the rows...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Manoj.Pasumarthi" <ManojPasumarthi@.discussions.microsoft.com> wrote in
message news:19D19F77-093A-4A54-BC72-4520693088F1@.microsoft.com...
> Hi Group,
> How to Count the items
> Sample:
> ID TestColumn
> 1 Coding
> 2 Design
> 3 Coding
> 4 Coding
> 5 Requirement
> 6 Coding
> My Output Should be
> Requirements Count Design Count Coding Count
> 1 1 4|||You might also consider these expressions:
=Sum(iif(Fields!TestColumn.Value = "Coding", 1, 0))
=Sum(iif(Fields!TestColumn.Value = "Design", 1, 0))
=Sum(iif(Fields!TestColumn.Value = "Requirement", 1, 0))
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:OmdPRQTrEHA.1952@.TK2MSFTNGP12.phx.gbl...
> If you make a group on the Testcolumn, you may use one of the Count()
> functions to count the rows...
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Manoj.Pasumarthi" <ManojPasumarthi@.discussions.microsoft.com> wrote in
> message news:19D19F77-093A-4A54-BC72-4520693088F1@.microsoft.com...
> > Hi Group,
> >
> > How to Count the items
> >
> > Sample:
> > ID TestColumn
> > 1 Coding
> > 2 Design
> > 3 Coding
> > 4 Coding
> > 5 Requirement
> > 6 Coding
> >
> > My Output Should be
> > Requirements Count Design Count Coding Count
> > 1 1 4
>