Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Friday, March 30, 2012

more problems with unique sequences

I have another different schema with the same data, but this one its like this

Code Snippet

CREATE Table events (
id INT not null,
PxMiss Real Not Null,
PyMiss Real Not Null,
filenames Varchar(50));

ALTER TABLE events
ADD CONSTRAINT pk_particle PRIMARY KEY (id,filenames);

GO

CREATE Table Muon (
idap INT Not Null,
id INT Not Null,
eventid INT Not Null,
Px Real,
Py Real,
Pz Real,
Kf Real,
Ee Real);

GO

CREATE Table Electron(
idap INT Not Null,
id INT NOT NULL,
eventid INT Not Null,
Px Real,
Py Real,
Pz Real,
Kf Real,
Ee Real);

GO

CREATE Table Jet (
idap INT Not Null,
id INT NOT NULL,
eventid INT Not Null,
Px Real,
Py Real,
Pz Real,
Kf Real,
Ee Real);

GO

Create View lepton AS
select * from Muon
Union all
select * from Electron;
GO

Create View particle AS
select * from lepton
Union all
select * from Jet;
GO

I need that every particle had a different idap, but all the date is filled in muon, electron and jet. and then is joined in a view called particle.

The way that you are going about this is likely to cause some problems.

For example, while it is possible to create a VIEW that would provide a unique idap for for each Particle, since it is a view and will be re-constituted at every execution, there is no certainity that the idap will be the same at each execution. (In my opinion -that is a big issue. -but maybe not for your situation...)

It seems more stable if you were to create a Particle idap that was the combination of each constituent Identifier + idap. Something like this for example:

CREATE VIEW Particle
AS

SELECT
'M' + cast( idap AS varchar(12)),
id,
eventid,
Px,
Py
Pz
Kf,
Ee
FROM Muon

UNION ALL

SELECT
'E' + cast( idap AS varchar(12),
id,
eventid,
Px,
Py,
Pz,
Kf,
Ee
FROM Electron

UNION ALL

SELECT
'J' + cast( idap AS varchar(12),
id,
eventid,
Px,
Py,
Pz,
Kf,
Ee
FROM Jet
GO

With this example, each idap will be unique, and also give you a clue about the constitutent component.

Monday, March 26, 2012

More code access issues again

Upgrading our Custom Data Extension from SQL 2000 Reporting Services to 2005
has necessitated dealing with code access security to a new degree. My
extension is actually a complex set of interdependant DLLs:
1. My managed assembly that implements the Data Extension and two delivery
extensions. This calls into...
2. A set of third party UNmanaged DLLs. Via a callback mechanism, these
call into...
3. Another of my managed assemblies.
By doing the following, my Data extension now runs perfectly in the browser
(via the report manager interface):
A. Create a Code Group in the policy config file.
B. Add AllowPartiallyTrustedCallers attribute to all my managed assemblies
C. Put my assemblies in the GAC
While my extension now works in the browser, it fails when run as a
scheduled report. My managed assembly #1 and the unmanaged DLLs #2 seem to
load, but in the log files I see:
Could not load file or assembly <my managed assembly #3, above> Failed to
grant minimum permission requests. (Exception from HRESULT: 0x80131417)
So I guess my question comes down to this: Why would the code access
security context be different when the report is run on a schedule as
opposed to being run on the server?
Thanks for you help!Hello Stephen,
How about turned off the Caspol by running command caspol -s off?
Also, please try to create a new code group.
1. On the Web server, open Administrative Tools, and then double-click
Microsoft
.NET Framework Configuration 2.0.
2. Expand Runtime Security Policy, expand Machine, and then expand Code
Groups.
3. Right-click All_Code, and then click New.
4. Select Create a new code group. Give your code group a relevant name,
such as
the name of the applications share.
5. Click Next.
6. In the Choose the condition type for this code group list, select GAC.
7. Click Next. On the next page, select Use an existing permission set, and
then
8. select FullTrust.
9. Click Next, and then click Finish.
Once these steps have been done, plese turn off the caspol and restart the
server.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||I can not do "caspol -s off" in this environment, but I believe your other
comments have pointed me in the right direction. Thanks!
"Wei Lu [MSFT]" <weilu@.online.microsoft.com> wrote in message
news:1krHN%23KzGHA.4340@.TK2MSFTNGXA01.phx.gbl...
> Hello Stephen,
> How about turned off the Caspol by running command caspol -s off?
> Also, please try to create a new code group.
> 1. On the Web server, open Administrative Tools, and then double-click
> Microsoft
> NET Framework Configuration 2.0.
> 2. Expand Runtime Security Policy, expand Machine, and then expand Code
> Groups.
> 3. Right-click All_Code, and then click New.
> 4. Select Create a new code group. Give your code group a relevant name,
> such as
> the name of the applications share.
> 5. Click Next.
> 6. In the Choose the condition type for this code group list, select GAC.
> 7. Click Next. On the next page, select Use an existing permission set,
> and
> then
> 8. select FullTrust.
> 9. Click Next, and then click Finish.
> Once these steps have been done, plese turn off the caspol and restart the
> server.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>

Wednesday, March 7, 2012

Monitor Replication with vb code

I have to write a little vb6 app to monitor sql 2000 replication. The app must run on the same desktop as the subscriber.

I've tried the samples that comes with sql (replsampl) but that is to do the replication, I need to just monitor replication that was set up in sql 2000.

With monitor I mean to show a red light when replication is busy, so that the user doesn't disconnect from the network while replication is in progress.

Any ideas?Are there at least some sql 2000 command line statements that I can use to do this?

Saturday, February 25, 2012

Monitor Connection sessions etc.

Hey all!

i've got SQL 2000 on a server with 1GB ram. JSP & CF code is accessing this server & DB's. We are finding that a lot of connections are staying persistant for a long time (especially with the JAVA Apps).

I'm currently able to monitor this using sp_who2, performance monitor and the following SQL call:

SELECT * FROM master..sysperfinfo
WHERE
(object_name = 'SQLServer:General Statistics' and counter_name = 'User Connections') OR
(object_name = 'SQLServer:Memory Manager' and counter_name = 'Connection Memory (KB)')

My questions are:

Is there a better way to monitor this?
Is there a way to terminate a session and how can i tell it's idle time?

Any performance tweaks you can offer as well would be MOST appreciated.another note here. i came into work this morning and had 108 connections to the SQL server. and it was useing abou 300KB of mem. currently it's at 103 connections and 2920 KB of mem. I've got a dual processor system with 1 GB of ram and my applications are dragging.. it only gets this way when my connections get above 100. any ideas?