Showing posts with label column. Show all posts
Showing posts with label column. Show all posts

Tuesday, March 6, 2012

Accuracy of Host column on SS 2000 Enterprise Manager Current Activity Process Info Screen

Yesterday and today, the Process Info screen in Enterprise Manager indicates that the "Host", a single workstation on our network, is generating around 50 connections to the database. This particular application is well-behaved and typically generates only 2 to 5 connections per instance. Furthermore, we cannot find this particular workstation/host on our network because we retired it off the network some time ago.

Anyone know of the accuracy of the Hosts column on this Enterprise Manager screen? We're suspecting that the network address column is correct but the Hosts column is incorrect. There are about 10 different network addresses pertaining to this particular Host (1-5 connections per network address).

Can you check the mAC Address for that host and find on the network?|||I have also been having that problem. I was able to use the MAC address to track down the PC when I first saw the problem, but found that the computer name was not what was displayed in SQL EM. Additionally, I am continuing to have the same problem but have found that different MAC addresses are being listed all with the same Host name. Should you find more information regarding this issue please post your results here.

Accuracy of Host column on SS 2000 Enterprise Manager Current Activity Process Info Screen

Yesterday and today, the Process Info screen in Enterprise Manager indicates that the "Host", a single workstation on our network, is generating around 50 connections to the database. This particular application is well-behaved and typically generates only 2 to 5 connections per instance. Furthermore, we cannot find this particular workstation/host on our network because we retired it off the network some time ago.

Anyone know of the accuracy of the Hosts column on this Enterprise Manager screen? We're suspecting that the network address column is correct but the Hosts column is incorrect. There are about 10 different network addresses pertaining to this particular Host (1-5 connections per network address).

Can you check the mAC Address for that host and find on the network?|||I have also been having that problem. I was able to use the MAC address to track down the PC when I first saw the problem, but found that the computer name was not what was displayed in SQL EM. Additionally, I am continuing to have the same problem but have found that different MAC addresses are being listed all with the same Host name. Should you find more information regarding this issue please post your results here.

accumulation column

If my query returns the following result:

NAME1 10
NAME2 20
NAME3 15
NAME4 5
NAME5 25

is there any way (without using cursors) to add a column that adds the numbers so that I get the following result:

NAME1 10 10
NAME2 20 30
NAME3 15 45
NAME4 5 50
NAME5 25 75

? thanks in advanceyes, with a theta joinselect t1.name
, t1.num
, sum(t2.num) as accum
from yourtable as t1
inner
join yourtable as t2
on t1.name >= t2.name
group
by t1.name
, t1.num
order by t1.namenotice the inequality in the join condition

Accumulate values in an aditional column

Hi I have a table like this:

CLIENT Value

a 12
b 11
c 8
d 5
e 4

I want to accumulate this values in an aditional column


CLIENT Value ACUM
a 12 12
b 11 12 + 11 = 23
c 8 23 + 8 = 31
d 5 31 + 5 = 36
e 4 36 + 4 = 40

Thks for your help

Rgds

Harry

CREATE TABLE dbo.RunningTotal

(

Entry int

,RunningTotal int

)

INSERT INTO dbo.RunningTotal (Entry,RunningTotal)VALUES(100,NULL)

INSERT INTO dbo.RunningTotal (Entry,RunningTotal)VALUES(200,NULL)

INSERT INTO dbo.RunningTotal (Entry,RunningTotal)VALUES(300,NULL)

INSERT INTO dbo.RunningTotal (Entry,RunningTotal)VALUES(400,NULL)

INSERT INTO dbo.RunningTotal (Entry,RunningTotal)VALUES(500,NULL)

UPDATE dbo.RunningTotal

SET RunningTotal = RT2.RunningTotal

FROM dbo.RunningTotal RT1

INNER JOIN

(

SELECT Entry

,(SELECT SUM(Entry) FROM dbo.RunningTotal WHERE Entry <= rt.Entry) As RunningTotal

FROM dbo.RunningTotal rt

) RT2

ON RT1.Entry = RT2.Entry

SELECT * FROM dbo.RunningTotal

Resultset:

Entry RunningTotal

100 100

200 300

300 600

400 1000

500 1500

|||

What would I have to do if i want to decrement this values?

CLIENT Value ACUM
a 12 12
b 11 11-12 = -1
c 8 8-11 = -3
d 10 10-8 = 2
e 4 4 -10 = -6

Hope to recieve some news soon

Rgds & a lot of thks

Harry

|||

There are endless variations depending on table structure, data and what you want to do with the data.

Here is one other example:

CREATE TABLE dbo.Balance

(

ID int

,Entry int

,RunningTotal int

)

TRUNCATE TABLE dbo.Balance

INSERT INTO dbo.Balance (ID,Entry,RunningTotal)VALUES(1,500,NULL)

INSERT INTO dbo.Balance (ID,Entry,RunningTotal)VALUES(2,-400,NULL)

INSERT INTO dbo.Balance (ID,Entry,RunningTotal)VALUES(3,-300,NULL)

INSERT INTO dbo.Balance (ID,Entry,RunningTotal)VALUES(4,-200,NULL)

INSERT INTO dbo.Balance (ID,Entry,RunningTotal)VALUES(5,-100,NULL)

UPDATE dbo.Balance

SET RunningTotal = RT2.RunningTotal

FROM dbo.Balance RT1

INNER JOIN

(

SELECT Entry

,(SELECT -SUM(-Entry) FROM dbo.Balance WHERE ID <= rt.ID ) As RunningTotal

FROM dbo.Balance rt

) RT2

ON RT1.Entry = RT2.Entry

SELECT * FROM dbo.Balance

IDEntryRunningTotal

1500500

2-400100

3-300-200

4-200-400

5-100-500

|||

I try this , but the values only are growing

the table with this input values must be

ID Entry RunningTotal

1 500 500

2 -400 -400 - 500 = -900

3 -300 -300-(-900) = 600

4 -200 -200-(-300) = 100

5 -100 -100 - 100 = -200

How coud I do this?

|||

That is a good method and works perfectly for relatively small number of records

Unfortunatly for a large number it is too slow ,,, :(:(:( do you have another faster method ?

I'm a little desparate

Thanks

|||Yes. do it in your front end application or reporting tool.

Accumulate values in an aditional column

Hi I have a table like this:

CLIENT Value

a 12
b 11
c 8
d 5
e 4

I want to accumulate this values in an aditional column


CLIENT Value ACUM
a 12 12
b 11 12 + 11 = 23
c 8 23 + 8 = 31
d 5 31 + 5 = 36
e 4 36 + 4 = 40

Thks for your help

Rgds

Harry

CREATE TABLE dbo.RunningTotal

(

Entry int

,RunningTotal int

)

INSERT INTO dbo.RunningTotal (Entry,RunningTotal)VALUES(100,NULL)

INSERT INTO dbo.RunningTotal (Entry,RunningTotal)VALUES(200,NULL)

INSERT INTO dbo.RunningTotal (Entry,RunningTotal)VALUES(300,NULL)

INSERT INTO dbo.RunningTotal (Entry,RunningTotal)VALUES(400,NULL)

INSERT INTO dbo.RunningTotal (Entry,RunningTotal)VALUES(500,NULL)

UPDATE dbo.RunningTotal

SET RunningTotal = RT2.RunningTotal

FROM dbo.RunningTotal RT1

INNER JOIN

(

SELECT Entry

,(SELECT SUM(Entry) FROM dbo.RunningTotal WHERE Entry <= rt.Entry) As RunningTotal

FROM dbo.RunningTotal rt

) RT2

ON RT1.Entry = RT2.Entry

SELECT * FROM dbo.RunningTotal

Resultset:

Entry RunningTotal

100 100

200 300

300 600

400 1000

500 1500

|||

What would I have to do if i want to decrement this values?

CLIENT Value ACUM
a 12 12
b 11 11-12 = -1
c 8 8-11 = -3
d 10 10-8 = 2
e 4 4 -10 = -6

Hope to recieve some news soon

Rgds & a lot of thks

Harry

|||

There are endless variations depending on table structure, data and what you want to do with the data.

Here is one other example:

CREATE TABLE dbo.Balance

(

ID int

,Entry int

,RunningTotal int

)

TRUNCATE TABLE dbo.Balance

INSERT INTO dbo.Balance (ID,Entry,RunningTotal)VALUES(1,500,NULL)

INSERT INTO dbo.Balance (ID,Entry,RunningTotal)VALUES(2,-400,NULL)

INSERT INTO dbo.Balance (ID,Entry,RunningTotal)VALUES(3,-300,NULL)

INSERT INTO dbo.Balance (ID,Entry,RunningTotal)VALUES(4,-200,NULL)

INSERT INTO dbo.Balance (ID,Entry,RunningTotal)VALUES(5,-100,NULL)

UPDATE dbo.Balance

SET RunningTotal = RT2.RunningTotal

FROM dbo.Balance RT1

INNER JOIN

(

SELECT Entry

,(SELECT -SUM(-Entry) FROM dbo.Balance WHERE ID <= rt.ID ) As RunningTotal

FROM dbo.Balance rt

) RT2

ON RT1.Entry = RT2.Entry

SELECT * FROM dbo.Balance

IDEntryRunningTotal

1500500

2-400100

3-300-200

4-200-400

5-100-500

|||

I try this , but the values only are growing

the table with this input values must be

ID Entry RunningTotal

1 500 500

2 -400 -400 - 500 = -900

3 -300 -300-(-900) = 600

4 -200 -200-(-300) = 100

5 -100 -100 - 100 = -200

How coud I do this?

|||

That is a good method and works perfectly for relatively small number of records

Unfortunatly for a large number it is too slow ,,, :(:(:( do you have another faster method ?

I'm a little desparate

Thanks

|||Yes. do it in your front end application or reporting tool.

Monday, February 13, 2012

accessing SQL 2000 table from within Excel

Hi,

I have a need to process a column of data and get information from SQL
2000 and return it to the Excel Spread Sheet.

The data will be a list of order numbers in column 1. I need to look
up each order number and return infomration relating to the order from
SQL.

Can anyone point me to the right process?

thanks in advance,Tim <tbertw@.n-o-s-p-a-m.tenbuckplans.com> wrote in message news:<k6qrb0p2jet65kcm67fia0f5fptgsf8fia@.4ax.com>...
> Hi,
> I have a need to process a column of data and get information from SQL
> 2000 and return it to the Excel Spread Sheet.
> The data will be a list of order numbers in column 1. I need to look
> up each order number and return infomration relating to the order from
> SQL.
> Can anyone point me to the right process?
> thanks in advance,

Data menu - Get External Data - New Database Query, then create a new
source or use an existing one to connect to the server. Or at least
that works for Excel 2000 - you didn't mention which version you have.

Simon

Sunday, February 12, 2012

Accessing Report Properties in Embedded Code

Is it possible to access report properties in embedded code? An earlier post
was looking to set the visible property of a table column depending on the
"RenderFormat" of the current output. I am also interested in doing this and
began playing in the embedded code window with code similar to..
Public Function MyType()
Return RenderedOutputFile.Type
End
This would fail with a RenderedOutputFile not declared message. I noticed
that the term "Me" works at the field level. Is there a similar way to
reference the current report instance?All properties are read-only. RS BOL contains information about all report
properties accessible within a report:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rscreate/htm/rcr_creating_expressions_v1_7ilv.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"vmp_pdx" <vmppdx@.discussions.microsoft.com> wrote in message
news:564F2973-B890-4C0E-8C97-92D8213916DE@.microsoft.com...
> Is it possible to access report properties in embedded code? An earlier
post
> was looking to set the visible property of a table column depending on the
> "RenderFormat" of the current output. I am also interested in doing this
and
> began playing in the embedded code window with code similar to..
> Public Function MyType()
> Return RenderedOutputFile.Type
> End
> This would fail with a RenderedOutputFile not declared message. I noticed
> that the term "Me" works at the field level. Is there a similar way to
> reference the current report instance?
>