Showing posts with label box. Show all posts
Showing posts with label box. Show all posts

Thursday, March 29, 2012

Distributed insert on oracle DB does not work from within a transaction.

Dear All,

I have MS SQL 2000 on Windows 2000 box and Oracle 9i on RH Linux 9.

I wanna write a trigger on MS SQL which inserts a record in the Oracle table.

So I have configured a Linked server on MS SQL using Microsoft OLE DB provider MSDAORA and am able to insert into (Single insert st) oracle table successfully from the Query Analyzer.

However the insert does not work when I code it in the trigger. Basically insert on the Oracle DB does not work from a transaction.
I receive the foll error when the trigger executes -

Server: Msg 7391, Level 16, State 1, Procedure AIN_sql2ora, Line 14
The operation could not be performed because the OLE DB provider 'MSDAORA' was unable to begin a distributed transaction.

Can anyone help me on this ?

Regards,
Azhar.set implicit transactions off

Tuesday, March 27, 2012

Distinguishing Processors in Server Properties

I have a SQL 2005 64 bit Standard box running on Windows Server 2003.
It has 4 dual core processors (with hyperthreading) and I would like to
scale it back to 2 dual cores. When I look at the processors in server
properties, it lists:
CPU0
CPU1
etc...
My assumption is that 0-3 are all from the first CPU (1 * dual core *
hyper thread). But I do not want to assume, I want to know which
processors I am picking for use and I can not find any documentation on
how those names map. Does anybody know?
PT
The more I think about it, I am thinking SQL 2005 does not know the
details of the physical processors, and is just told by the OS that
there are X logical processors. Anyhow, I would still like to know.
|||You are correct. SQL sees logical processors only. Plus, there aren't ane
"real" and "virtual" processors. They are all virtual. You have to turn
off hyperthreading at the BIOS level to get "real" processors.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Paul T." <weluvpaul@.hotmail.com> wrote in message
news:1163116200.511102.129730@.k70g2000cwa.googlegr oups.com...
> The more I think about it, I am thinking SQL 2005 does not know the
> details of the physical processors, and is just told by the OS that
> there are X logical processors. Anyhow, I would still like to know.
>
|||Paul
Check out this link - it provides an decent explanation
http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/28/477.aspx
Cheers
Bil
"Geoff N. Hiten" wrote:

> You are correct. SQL sees logical processors only. Plus, there aren't ane
> "real" and "virtual" processors. They are all virtual. You have to turn
> off hyperthreading at the BIOS level to get "real" processors.
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
>
> "Paul T." <weluvpaul@.hotmail.com> wrote in message
> news:1163116200.511102.129730@.k70g2000cwa.googlegr oups.com...
>
>
|||You shouldn't worry about whch core maps to which socket. Each core is a real
processor, and there is not much you can or should do with that mapping. So
let's just call a core a physical processor. However, there is some
interesting issue with mapping a physical processor to a hyperthreaded (or
logical) one.
Ideally, you should be able to tell because BIOS assigns the first 'logical'
processor for each physical one before looping back to assign the second one
after it has gone through all the physical processors. This is all good.
However, Perfmon lists and numbers the logical processors differently. So you
could end up seeing CPU consumption on each alternate processor in Perfmon.
Microsoft has a little utility called htdump.exe that is distributed as part
of MPS Reports. This utility gives you the physical-to-logical mapping as
reported by Perfmon. Now, this was something we encountered about a year ago.
Things may have changed since then.
Linchi
"Paul T." wrote:

> I have a SQL 2005 64 bit Standard box running on Windows Server 2003.
> It has 4 dual core processors (with hyperthreading) and I would like to
> scale it back to 2 dual cores. When I look at the processors in server
> properties, it lists:
> CPU0
> CPU1
> etc...
> My assumption is that 0-3 are all from the first CPU (1 * dual core *
> hyper thread). But I do not want to assume, I want to know which
> processors I am picking for use and I can not find any documentation on
> how those names map. Does anybody know?
> PT
>

Distinguishing Processors in Server Properties

I have a SQL 2005 64 bit Standard box running on Windows Server 2003.
It has 4 dual core processors (with hyperthreading) and I would like to
scale it back to 2 dual cores. When I look at the processors in server
properties, it lists:
CPU0
CPU1
etc...
My assumption is that 0-3 are all from the first CPU (1 * dual core *
hyper thread). But I do not want to assume, I want to know which
processors I am picking for use and I can not find any documentation on
how those names map. Does anybody know?
PTThe more I think about it, I am thinking SQL 2005 does not know the
details of the physical processors, and is just told by the OS that
there are X logical processors. Anyhow, I would still like to know.|||You are correct. SQL sees logical processors only. Plus, there aren't ane
"real" and "virtual" processors. They are all virtual. You have to turn
off hyperthreading at the BIOS level to get "real" processors.
--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Paul T." <weluvpaul@.hotmail.com> wrote in message
news:1163116200.511102.129730@.k70g2000cwa.googlegroups.com...
> The more I think about it, I am thinking SQL 2005 does not know the
> details of the physical processors, and is just told by the OS that
> there are X logical processors. Anyhow, I would still like to know.
>|||Paul
Check out this link - it provides an decent explanation
http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/28/477.aspx
--
Cheers
Bil
"Geoff N. Hiten" wrote:
> You are correct. SQL sees logical processors only. Plus, there aren't ane
> "real" and "virtual" processors. They are all virtual. You have to turn
> off hyperthreading at the BIOS level to get "real" processors.
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
>
> "Paul T." <weluvpaul@.hotmail.com> wrote in message
> news:1163116200.511102.129730@.k70g2000cwa.googlegroups.com...
> > The more I think about it, I am thinking SQL 2005 does not know the
> > details of the physical processors, and is just told by the OS that
> > there are X logical processors. Anyhow, I would still like to know.
> >
>
>|||Inter recommends that HT is implemented such as:
They you have two physical processors. This will surface as 4 processors to the OS. So, the
processors are presented to the OS should be:
CPU0 - Phy CPU0
CPU1 - Phy CPU1
CPU2 - Phy CPU0
CPU3 - Phy CPU1
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Paul T." <weluvpaul@.hotmail.com> wrote in message
news:1163112570.239503.214220@.i42g2000cwa.googlegroups.com...
>I have a SQL 2005 64 bit Standard box running on Windows Server 2003.
> It has 4 dual core processors (with hyperthreading) and I would like to
> scale it back to 2 dual cores. When I look at the processors in server
> properties, it lists:
> CPU0
> CPU1
> etc...
> My assumption is that 0-3 are all from the first CPU (1 * dual core *
> hyper thread). But I do not want to assume, I want to know which
> processors I am picking for use and I can not find any documentation on
> how those names map. Does anybody know?
> PT
>|||You shouldn't worry about whch core maps to which socket. Each core is a real
processor, and there is not much you can or should do with that mapping. So
let's just call a core a physical processor. However, there is some
interesting issue with mapping a physical processor to a hyperthreaded (or
logical) one.
Ideally, you should be able to tell because BIOS assigns the first 'logical'
processor for each physical one before looping back to assign the second one
after it has gone through all the physical processors. This is all good.
However, Perfmon lists and numbers the logical processors differently. So you
could end up seeing CPU consumption on each alternate processor in Perfmon.
Microsoft has a little utility called htdump.exe that is distributed as part
of MPS Reports. This utility gives you the physical-to-logical mapping as
reported by Perfmon. Now, this was something we encountered about a year ago.
Things may have changed since then.
Linchi
"Paul T." wrote:
> I have a SQL 2005 64 bit Standard box running on Windows Server 2003.
> It has 4 dual core processors (with hyperthreading) and I would like to
> scale it back to 2 dual cores. When I look at the processors in server
> properties, it lists:
> CPU0
> CPU1
> etc...
> My assumption is that 0-3 are all from the first CPU (1 * dual core *
> hyper thread). But I do not want to assume, I want to know which
> processors I am picking for use and I can not find any documentation on
> how those names map. Does anybody know?
> PT
>sql

Distinguishing Processors in Server Properties

I have a SQL 2005 64 bit Standard box running on Windows Server 2003.
It has 4 dual core processors (with hyperthreading) and I would like to
scale it back to 2 dual cores. When I look at the processors in server
properties, it lists:
CPU0
CPU1
etc...
My assumption is that 0-3 are all from the first CPU (1 * dual core *
hyper thread). But I do not want to assume, I want to know which
processors I am picking for use and I can not find any documentation on
how those names map. Does anybody know?
PTThe more I think about it, I am thinking SQL 2005 does not know the
details of the physical processors, and is just told by the OS that
there are X logical processors. Anyhow, I would still like to know.|||You are correct. SQL sees logical processors only. Plus, there aren't ane
"real" and "virtual" processors. They are all virtual. You have to turn
off hyperthreading at the BIOS level to get "real" processors.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Paul T." <weluvpaul@.hotmail.com> wrote in message
news:1163116200.511102.129730@.k70g2000cwa.googlegroups.com...
> The more I think about it, I am thinking SQL 2005 does not know the
> details of the physical processors, and is just told by the OS that
> there are X logical processors. Anyhow, I would still like to know.
>|||Paul
Check out this link - it provides an decent explanation
http://rentacoder.com/CS/blogs/real.../04/28/477.aspx
Cheers
Bil
"Geoff N. Hiten" wrote:

> You are correct. SQL sees logical processors only. Plus, there aren't an
e
> "real" and "virtual" processors. They are all virtual. You have to turn
> off hyperthreading at the BIOS level to get "real" processors.
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
>
> "Paul T." <weluvpaul@.hotmail.com> wrote in message
> news:1163116200.511102.129730@.k70g2000cwa.googlegroups.com...
>
>|||Inter recommends that HT is implemented such as:
They you have two physical processors. This will surface as 4 processors to
the OS. So, the
processors are presented to the OS should be:
CPU0 - Phy CPU0
CPU1 - Phy CPU1
CPU2 - Phy CPU0
CPU3 - Phy CPU1
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Paul T." <weluvpaul@.hotmail.com> wrote in message
news:1163112570.239503.214220@.i42g2000cwa.googlegroups.com...
>I have a SQL 2005 64 bit Standard box running on Windows Server 2003.
> It has 4 dual core processors (with hyperthreading) and I would like to
> scale it back to 2 dual cores. When I look at the processors in server
> properties, it lists:
> CPU0
> CPU1
> etc...
> My assumption is that 0-3 are all from the first CPU (1 * dual core *
> hyper thread). But I do not want to assume, I want to know which
> processors I am picking for use and I can not find any documentation on
> how those names map. Does anybody know?
> PT
>|||You shouldn't worry about whch core maps to which socket. Each core is a rea
l
processor, and there is not much you can or should do with that mapping. So
let's just call a core a physical processor. However, there is some
interesting issue with mapping a physical processor to a hyperthreaded (or
logical) one.
Ideally, you should be able to tell because BIOS assigns the first 'logical'
processor for each physical one before looping back to assign the second one
after it has gone through all the physical processors. This is all good.
However, Perfmon lists and numbers the logical processors differently. So yo
u
could end up seeing CPU consumption on each alternate processor in Perfmon.
Microsoft has a little utility called htdump.exe that is distributed as part
of MPS Reports. This utility gives you the physical-to-logical mapping as
reported by Perfmon. Now, this was something we encountered about a year ago
.
Things may have changed since then.
Linchi
"Paul T." wrote:

> I have a SQL 2005 64 bit Standard box running on Windows Server 2003.
> It has 4 dual core processors (with hyperthreading) and I would like to
> scale it back to 2 dual cores. When I look at the processors in server
> properties, it lists:
> CPU0
> CPU1
> etc...
> My assumption is that 0-3 are all from the first CPU (1 * dual core *
> hyper thread). But I do not want to assume, I want to know which
> processors I am picking for use and I can not find any documentation on
> how those names map. Does anybody know?
> PT
>

Wednesday, March 21, 2012

displaying vertical text in details section using sql reporting service

Nico,
U can change the "WritingMode" property of text box to set display
vertically.
I have another problem with the same, i want to display a text in the
details section spanning multiple rows.
below is example
S_NO NAME VERTICAL_TEXT
_______________________________
1 ABC S
2 CDE A
3 FGH M
4 IJK P
L
E
Appreciate any help!!..
VenkatCan anyone help on this?..
venkat.oar@.gmail.com wrote:
> Nico,
> U can change the "WritingMode" property of text box to set display
> vertically.
> I have another problem with the same, i want to display a text in the
> details section spanning multiple rows.
> below is example
> S_NO NAME VERTICAL_TEXT
> _______________________________
> 1 ABC S
> 2 CDE A
> 3 FGH M
> 4 IJK P
> L
> E
> Appreciate any help!!..
> Venkat

Sunday, March 11, 2012

Displaying records from today on (filtering out the old)

I am trying to filter out old records from a search. I tried this but
it still seems to display the old records.
gofind is the input box text query and it passes through fine. It
searches perfectly, just doesn't filter out old records.
It should show everything from today and into the future.
dDate = Date()-1
SELECT * FROM events WHERE title LIKE '%" & gofind & "%' AND date >= "
& dDate & " AND active='yes' OR comments LIKE '%" & gofind & "%' AND
date >= " & dDate & " AND active='yes' ORDER BY date ASC
Can someone help please?You need to enclose the two sections of your where clause in
parentheses. Try something like this:
SELECT * FROM events WHERE (title LIKE '%" & gofind & "%' AND date >= "
& dDate & " AND active='yes') OR (comments LIKE '%" & gofind & "%' AND
date >= " & dDate & " AND active='yes') ORDER BY date ASC
As it was written simply a match with the comments LIKE '%" & gofind &
"%' would result in an evaluation of true.
james.shearer@.gmail.com wrote:
> I am trying to filter out old records from a search. I tried this but
> it still seems to display the old records.
> gofind is the input box text query and it passes through fine. It
> searches perfectly, just doesn't filter out old records.
> It should show everything from today and into the future.
> dDate = Date()-1
> SELECT * FROM events WHERE title LIKE '%" & gofind & "%' AND date >= "
> & dDate & " AND active='yes' OR comments LIKE '%" & gofind & "%' AND
> date >= " & dDate & " AND active='yes' ORDER BY date ASC
> Can someone help please?
>|||Thanks Steve but that doesn't seem to make any difference.
The query works fine apart from the part:
date >= " & dDate & "
That doesn't seem to make any difference at all.
It should show records dated from a date greater than yesterday but it
just shows everything that meets the rest of the criteria ignoring the
date request.
Any idea?|||On 8 Nov 2005 20:05:09 -0800, james.shearer@.gmail.com wrote:

>Thanks Steve but that doesn't seem to make any difference.
>The query works fine apart from the part:
>date >= " & dDate & "
>That doesn't seem to make any difference at all.
>It should show records dated from a date greater than yesterday but it
>just shows everything that meets the rest of the criteria ignoring the
>date request.
>Any idea?
Hi James,
I don't know what front end you are using. Best would be to pass the
date as a parameter instead of passing it as text. That would prevent
any possible conversion problems, since native date/time datatypes will
be used.
If you must pass it as text, then the best way to troubleshoot this is
to display the query string instead of executing it. The part with the
date comparison should look like this:
date >= '20051109'
or
date >= '2005-11-09T22:40:34.550'
That is: the date string must be enclosed in single quotes, and it must
adhere to one of the unambigous date formats, which are:
* yyyymmdd for date only
(note: no dashes, slashes, dots, or other punctuation)
* yyyy-mm-ddThh:mm:ss for date and time
(note: dashes in the date, colons in the time and an uppercase T [not
a space!] between the two parts)
* yyyy-mm-ddThh:mm:ss.mmm for date and time with millisecond precision
(note: same as above; add a dot and then the milliseconds)
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Wednesday, March 7, 2012

Displaying Data of a Cube over Web

When you use BI Dev Studio or SS Management Studio to process an Analysis Services database or object, there's a nice dialog box that shows very robust status and progress information.

Is there any way to capture this information if you are processing something programmatically? Specifically interested in both the ability to capture and display this information to a user when processing via a custom application. Also interested in whether or not there's a way to capture this information to a log (or table) for display and analysis after the fact (or if the custom application is running in a batch mode via a schedule).

Thanks,
Dave FacklerI've been looking for the same thing. Were you able to find where this information is stored/logged?

Thanks!|||One simple way to do this is using the SQL Server Profiler tool which has the option of logging trace information to files or tables as well as the UI. You can also do this programmatically using the AMO using Server.SessionTrace or by adding custom traces to Server.Traces.|||

Using the AMO, you can listen Session Trace. Sample code is following:

this.sessionTrace = server.SessionTrace;

this.sessionTrace.OnEvent += new TraceEventHandler(sessionTrace_TraceEventHandler);

this.sessionTrace.Stopped += new TraceStoppedEventHandler(sessionTrace_Stopped);

if (!this.sessionTrace.IsStarted)

{

this.sessionTrace.Start();

}

|||

You can use AMO (Microsoft.AnalysisServices.dll from "%ProgramFiles%\Microsoft SQL Server\90\SDK\Assemblies") to subscribe to trace events. Sample code below. The code formatting might be lost when posting, but copy paste in VS, and then "Edit -> Advanced -> Format Document" should fix it.

//=====================================================================
//
// File: Program.cs
// Summary: Sample code for using traces with AMO.
// Date: 2006-05-23
//
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
//=====================================================================
using System;
using Microsoft.AnalysisServices;

namespace Microsoft.AnalysisServices.CodeSamples
{
/// <summary>
/// Demonstrates use of traces with AMO.
/// </summary>
/// <remarks>
/// This code requires the "Adventure Works" database to be present on the Analysis Services server
/// and also the "AdventureWorksDW" relational database on SQL Server (for processing objects to
/// generate trace events).
/// </remarks>
class AmoTrace
{
static int Main(string[] args)
{
//--
// There are 2 types of traces that AMO programmer can use:
// - the session trace: provides the events from the current session (established
// on Connect)
// - the custom traces: they allow to choose the particular event classes and
// columns to be traced. Unlike the session trace, a custom trace needs to be
// created and saved to server explicitly (as any other AMO object, like a
// Dimension or a Cube).
//
// This is the plan of the code:
// 1. we'll connect to an Analysis Services server
// 2. we'll locate the "Product" dimension from the "Adventure Works DW" database
// (we'll process it to generate trace events)
// 3. we'll use the session trace
// 4. we'll create, use and then delete a custom trace
//--

string connectionString = "Data Source=localhost";
string databaseName = "Adventure Works DW"; // use "Adventure Works DW Standard Edition" if you have the standard edition installed

try
{
//--
// STEP 1: connect to Analysis Services server.
//--
Server server = new Server();
server.Connect(connectionString);

try
{
//--
// STEP 2: locate the "Product" dimension.
//--
Database database = server.Databases.FindByName(databaseName);
if (database == null)
{
Console.Error.WriteLine("The [{0}] database is missing.", databaseName);
return 1;
}

Dimension productDimension = database.Dimensions.FindByName("Product");
if (productDimension == null)
{
Console.Error.WriteLine("The [Product] dimension is missing.");
return 1;
}

//--
// STEP 3: use the session trace.
//--
UseSessionTrace(server, productDimension);

//--
// STEP 4. create, use and then delete a custom trace.
//--
UseCustomTrace(server, productDimension);

return 0;
}
finally
{
server.Disconnect();
}
}
catch (Exception e)
{
Console.Error.WriteLine(e.ToString());
return 1;
}
}

/// <summary>
/// Demonstrates the use of session trace.
/// </summary>
private static void UseSessionTrace(Server server, Dimension dimensionToProcess)
{
//--
// 1. Subscribe to the session trace events.
//--
SessionTrace sessionTrace = server.SessionTrace;
TraceEventHandler onTraceEvent = new TraceEventHandler(OnTraceEvent);
TraceStoppedEventHandler onTraceStopped = new TraceStoppedEventHandler(OnTraceStopped);

sessionTrace.OnEvent += new TraceEventHandler(OnTraceEvent);
sessionTrace.Stopped += new TraceStoppedEventHandler(OnTraceStopped);
sessionTrace.Start(); // this method is not blocking, it starts a separate thread to listen for events from server


//--
// 2. Process the dimension; this will generate events that we'll display to
// the Console.
//--
try
{
dimensionToProcess.Process(ProcessType.ProcessFull); // this method blocks; while processing, events are received
}
finally
{
//--
// 3. Un-subscribe from the trace.
//--
sessionTrace.Stop();
sessionTrace.OnEvent -= onTraceEvent;
sessionTrace.Stopped -= onTraceStopped;
}
}

/// <summary>
/// Demonstrates the use of a custom trace.
/// </summary>
private static void UseCustomTrace(Server server, Dimension dimensionToProcess)
{
//--
// 1. Create and save to server a custom trace with only the
// ProgressReportBegin, ProgressReportCurrent and ProgressReportEnd events
// and the EventClass and EventSubclass columns.
//--
Trace trace = server.Traces.Add(); // a Name and ID will be generated for the new Trace
TraceEvent event1 = trace.Events.Add(TraceEventClass.ProgressReportBegin);
TraceEvent event2 = trace.Events.Add(TraceEventClass.ProgressReportCurrent);
TraceEvent event3 = trace.Events.Add(TraceEventClass.ProgressReportEnd);

event1.Columns.Add(TraceColumn.EventClass);
event1.Columns.Add(TraceColumn.EventSubclass);

event2.Columns.Add(TraceColumn.EventClass);
event2.Columns.Add(TraceColumn.EventSubclass);

event3.Columns.Add(TraceColumn.EventClass);
event3.Columns.Add(TraceColumn.EventSubclass);

// Save the newly created Trace to the server; others could use it (unlike the session
// trace which is specific to a particular session).
trace.Update();


//--
// 2. Subscribe to the newly create trace.
//--
TraceEventHandler onTraceEvent = new TraceEventHandler(OnTraceEvent);
TraceStoppedEventHandler onTraceStopped = new TraceStoppedEventHandler(OnTraceStopped);

trace.OnEvent += new TraceEventHandler(OnTraceEvent);
trace.Stopped += new TraceStoppedEventHandler(OnTraceStopped);
trace.Start(); // this method is not blocking, it starts a separate thread to listen for events from server

//--
// 3. Process the dimension; this will generate events that we'll display to
// the Console.
//--
try
{
dimensionToProcess.Process(ProcessType.ProcessFull); // this method blocks; while processing, events are received
}
finally
{
//--
// 3. Un-subscribe from the trace.
//--
trace.Stop();
trace.OnEvent -= onTraceEvent;
trace.Stopped -= onTraceStopped;
}


//--
// 4. Cleanup: delete the trace from the server. We could leave it (to be used
// in the future or by other users), but we'll delete it since it was only a
// sample.
//--
trace.Drop();
}

/// <summary>
/// Event handler for trace events, called on a separate thread by the AMO trace.
/// </summary>
/// <remarks>
/// When the Start() method is called on a Trace, AMO creates a separate thread
/// that listens for events from the server; when an event is read, this method is
/// called on that thread. There should be no heavy calculations in this method
/// because the trace thread will be blocked and events might overflow the connection's
/// buffer(s), resulting in loss of events.
/// </remarks>
private static void OnTraceEvent(object sender, TraceEventArgs e)
{
Console.WriteLine("Event ({0}, {1})", e.EventClass, e.EventSubclass);
}

/// <summary>
/// Event handler for trace stop events, called on a separate thread by the AMO trace when
/// a trace is stopped (by the user, by the server or by an exception).
/// </summary>
/// <remarks>
/// There are 3 main reasons for a trace to be stopped:
/// - the user called the Stop() method
/// - the server ended the trace (because somebody deleted it meanwhile for example)
/// - an exception occured during parsing of events (because of a network disconnect for example)
/// </remarks>
private static void OnTraceStopped( ITrace sender, TraceStoppedEventArgs e )
{
Console.WriteLine("Trace Stopped: Cause = {0}, Exception = {1}", e.StopCause, e.Exception);
}
}
}

Adrian Dumitrascu.

|||Does anyone know if there is anyway of figuring out which events support which columns from the object model? At the moment I have had to resort to hard coding the columns supported by a given event.|||Thanks for all the responses and the sample code!

I would like to capture this information using SSIS. Of course, the script tasks only supports VB as well. Is there an easy way to capture trace information from the cube processing within SSIS?

Thanks again for all the help!|||

AMO doesn't provide the list of supported columns for a particular trace event. But, there are 2 other places containing the associations:

- the "tracedefinition90.xml" file (search for it in "%ProgramFiles%\Microsoft SQL Server"). You will need to parse it to generate a user-friendlier map. But please note that this file might change in the future (probably not the xml schema, but columns/events might be added/removed/changed).

- SQL Profiler; when you create a new AS2005 trace, in the 'Trace Properties' window, see the 'Events Selection' tab (generated from the trace definition file)

Adrian Dumitrascu

|||

I don't have yet a sample VB.NET code for using AMO traces, but a work-around is to have a separate assembly containing the trace code (written in C# from the sample posted previously) and use this assembly from the VB.NET script task in SSIS.

Adrian Dumitrascu

|||

You could try running the sample code through one of the online C# to VB.NET converters (eg. http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx). They are not perfect, but they can get you pretty close.

I don't know if the event handling code will work inside an SSIS script task. In this case one option might be to configure the trace to log to a file.

|||

Thanks Adrian, the tracedefinitions90.xml looks like it could be very useful.

The other thing I just found was that by going File -> Export -> Script Trace Definition. I can get an xmla script that will create the server side trace.

This might suit my needs as I can configure the trace using the profiler GUI, script it out and then just get my app to execute the xmla and then connect to the server side trace.

|||

Hi,

I have created an analysis services project using SQL Server 2005, in which I have included a cube, dimension, data source and data view. Now using the Analysis services Browser tab of cube I can see the Pivot table exactly the way I want where I can drag & drop table fields as per my requirements. But I am struggling to display the same cube over the Web. Can any please tell me that how I can publish the contents of Cube i.e. Pivot table on a web application so that end user can use this. I want the same functionality, which I can see in the Browser tab of Cube in AS2005 i.e. user should have freedom to drag & drop the fields exactly like in Excel Pivot table.

Any help would be highly appreciated.

Thanks in advance.

|||

Take a look at the following link on Mosha's website. It contains a set of links to web-based browsers and applications. You can probably use them as a guide to developing your own custom web-based app for doing this (or perhaps use one of the listed applications directly).

http://www.mosha.com/msolap/util.htm#ThinClients

HTH,

Dave Fackler

Saturday, February 25, 2012

Display textbox on each page of the report

Hi,
I have created a multi-page report. I want to display a text box on each
page of the report. How to do so?
Note that I cannot make the text box as a part of data region (like list).
Its a kind of header information that need to be outputed in each page.
I cannot place the text box in header of the page since it takes value from
a database field. The header doesn't accept database fields.
regards,
Sachin.I think this is a difficult thing to do. One approach is to ensure that a
database field in a textbox is on each page of the report body. You may
then reference the textbox in the headder or footer with the ReportItems!
collection. We have reports that extend multiple pages when exported to PDF
format. I tried making a really tall and narrow textbox and this would work
for the first two pages, but when the matrix at the bottom of the report
grew onto a third page, the third page would not have a textbox and the
reference would be empty.
We took another approach, we passed in the ReportItems collection to a
custom assembly and kept a 'last known good' reference to it. We would then
call this method on each page and retrieve the last known good. I had to
pass in the whole ReportItems collection because passing in just the report
item would result in an #Error for pages that didn't contain the hidden text
box. From what I can tell all references in an expression are resolved
which is why I passed the collection. I think this would also work in code
behind without the custom assembly, but haven't tried it.
Hidden textbox in report body:
txtSchoolNameHidden
=First(Fields!OrganizationName.Value, "GetOrgInfo")
Expression in footer:
=Code.loc.SchoolName(ReportItems)
Code in Custom Assembly (because we are using a property, had to create an
instance, rather than static method)
private string _SchoolName;
public string
SchoolName(Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItems
input)
{
string ReturnVal = null;
try
{
Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItem
rptItemSchoolNameHidden = null;
rptItemSchoolNameHidden = input["txtSchoolNameHidden"];
if (rptItemSchoolNameHidden != null)
{
_SchoolName = rptItemSchoolNameHidden.Value.ToString();
}
}
catch
{
//ignore report item not found error.
}
return _SchoolName;
}
Seems like a lot of work for something simple. Any other ideas would be
appreciated.
Aaarrrghhh! Runs fine in SSRS2005 web window, when I export it to PDF only
the first page has my database field in the footer.
Steve MunLeeuw
"Sachin Laddha" <SachinLaddha@.discussions.microsoft.com> wrote in message
news:6866232F-21F1-42BB-A593-FCD33A2BE344@.microsoft.com...
> Hi,
> I have created a multi-page report. I want to display a text box on each
> page of the report. How to do so?
> Note that I cannot make the text box as a part of data region (like list).
> Its a kind of header information that need to be outputed in each page.
> I cannot place the text box in header of the page since it takes value
> from
> a database field. The header doesn't accept database fields.
> regards,
> Sachin.
>|||A text box can't take a database field directly in the header or footer, but
it can take a report parameter. That parameter in turn can be filled with
the value of a field in a dataset.
"Sachin Laddha" <SachinLaddha@.discussions.microsoft.com> wrote in message
news:6866232F-21F1-42BB-A593-FCD33A2BE344@.microsoft.com...
> Hi,
> I have created a multi-page report. I want to display a text box on each
> page of the report. How to do so?
> Note that I cannot make the text box as a part of data region (like list).
> Its a kind of header information that need to be outputed in each page.
> I cannot place the text box in header of the page since it takes value
> from
> a database field. The header doesn't accept database fields.
> regards,
> Sachin.
>|||I put a call to a custom assembly in a textbox expression in the footer.
When I appendend a counter for each call I was suprised to find the first
page expression was getting called 6 times, then one additional time for
each page when exported to PDF. I didn't go back and do the comparison for
the browser view with interactive height, and therefore different number of
pages as pdf.
The following code works.
static string _SchoolName;
public string
SchoolName(Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItems
input)
{
string ReturnVal = null;
try
{
Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItem
rptItemSchoolNameHidden = null;
rptItemSchoolNameHidden = input["txtSchoolNameHidden"];
if (rptItemSchoolNameHidden != null)
{
if (rptItemSchoolNameHidden.Value.ToString().Length > 0)
{
_SchoolName = rptItemSchoolNameHidden.Value.ToString();
}
}
}
catch
{
//ignore report item not found error.
}
return _SchoolName;
}
"Steve MunLeeuw" <smunson@.clearwire.net> wrote in message
news:ORGfb5LNGHA.2300@.TK2MSFTNGP15.phx.gbl...
>I think this is a difficult thing to do. One approach is to ensure that a
>database field in a textbox is on each page of the report body. You may
>then reference the textbox in the headder or footer with the ReportItems!
>collection. We have reports that extend multiple pages when exported to
>PDF format. I tried making a really tall and narrow textbox and this would
>work for the first two pages, but when the matrix at the bottom of the
>report grew onto a third page, the third page would not have a textbox and
>the reference would be empty.
> We took another approach, we passed in the ReportItems collection to a
> custom assembly and kept a 'last known good' reference to it. We would
> then call this method on each page and retrieve the last known good. I
> had to pass in the whole ReportItems collection because passing in just
> the report item would result in an #Error for pages that didn't contain
> the hidden text box. From what I can tell all references in an expression
> are resolved which is why I passed the collection. I think this would
> also work in code behind without the custom assembly, but haven't tried
> it.
> Hidden textbox in report body:
> txtSchoolNameHidden
> =First(Fields!OrganizationName.Value, "GetOrgInfo")
> Expression in footer:
> =Code.loc.SchoolName(ReportItems)
>
> Code in Custom Assembly (because we are using a property, had to create an
> instance, rather than static method)
> private string _SchoolName;
> public string
> SchoolName(Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItems
> input)
> {
> string ReturnVal = null;
> try
> {
> Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItem
> rptItemSchoolNameHidden = null;
> rptItemSchoolNameHidden = input["txtSchoolNameHidden"];
> if (rptItemSchoolNameHidden != null)
> {
> _SchoolName = rptItemSchoolNameHidden.Value.ToString();
> }
> }
> catch
> {
> //ignore report item not found error.
> }
> return _SchoolName;
> }
>
> Seems like a lot of work for something simple. Any other ideas would be
> appreciated.
> Aaarrrghhh! Runs fine in SSRS2005 web window, when I export it to PDF
> only the first page has my database field in the footer.
>
>
> Steve MunLeeuw
>
>
> "Sachin Laddha" <SachinLaddha@.discussions.microsoft.com> wrote in message
> news:6866232F-21F1-42BB-A593-FCD33A2BE344@.microsoft.com...
>> Hi,
>> I have created a multi-page report. I want to display a text box on each
>> page of the report. How to do so?
>> Note that I cannot make the text box as a part of data region (like
>> list).
>> Its a kind of header information that need to be outputed in each page.
>> I cannot place the text box in header of the page since it takes value
>> from
>> a database field. The header doesn't accept database fields.
>> regards,
>> Sachin.
>|||The parameter technique is better, I will use that.
"Steve MunLeeuw" <smunson@.clearwire.net> wrote in message
news:ORGfb5LNGHA.2300@.TK2MSFTNGP15.phx.gbl...
>I think this is a difficult thing to do. One approach is to ensure that a
>database field in a textbox is on each page of the report body. You may
>then reference the textbox in the headder or footer with the ReportItems!
>collection. We have reports that extend multiple pages when exported to
>PDF format. I tried making a really tall and narrow textbox and this would
>work for the first two pages, but when the matrix at the bottom of the
>report grew onto a third page, the third page would not have a textbox and
>the reference would be empty.
> We took another approach, we passed in the ReportItems collection to a
> custom assembly and kept a 'last known good' reference to it. We would
> then call this method on each page and retrieve the last known good. I
> had to pass in the whole ReportItems collection because passing in just
> the report item would result in an #Error for pages that didn't contain
> the hidden text box. From what I can tell all references in an expression
> are resolved which is why I passed the collection. I think this would
> also work in code behind without the custom assembly, but haven't tried
> it.
> Hidden textbox in report body:
> txtSchoolNameHidden
> =First(Fields!OrganizationName.Value, "GetOrgInfo")
> Expression in footer:
> =Code.loc.SchoolName(ReportItems)
>
> Code in Custom Assembly (because we are using a property, had to create an
> instance, rather than static method)
> private string _SchoolName;
> public string
> SchoolName(Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItems
> input)
> {
> string ReturnVal = null;
> try
> {
> Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItem
> rptItemSchoolNameHidden = null;
> rptItemSchoolNameHidden = input["txtSchoolNameHidden"];
> if (rptItemSchoolNameHidden != null)
> {
> _SchoolName = rptItemSchoolNameHidden.Value.ToString();
> }
> }
> catch
> {
> //ignore report item not found error.
> }
> return _SchoolName;
> }
>
> Seems like a lot of work for something simple. Any other ideas would be
> appreciated.
> Aaarrrghhh! Runs fine in SSRS2005 web window, when I export it to PDF
> only the first page has my database field in the footer.
>
>
> Steve MunLeeuw
>
>
> "Sachin Laddha" <SachinLaddha@.discussions.microsoft.com> wrote in message
> news:6866232F-21F1-42BB-A593-FCD33A2BE344@.microsoft.com...
>> Hi,
>> I have created a multi-page report. I want to display a text box on each
>> page of the report. How to do so?
>> Note that I cannot make the text box as a part of data region (like
>> list).
>> Its a kind of header information that need to be outputed in each page.
>> I cannot place the text box in header of the page since it takes value
>> from
>> a database field. The header doesn't accept database fields.
>> regards,
>> Sachin.
>

Friday, February 24, 2012

Display text as HTML?

Is it possible to display text saved with HTML tags as true HTML inside a text box? For example I have some text saved that displays in red when viewed on a web page, but in the report it actually prints the HTML tags that set the color to red. Any ideas? Thanks!
JeffNOPE. Reporting Services just prints out the text AS IS and is not parsed by the browser. I have spent a very good amount of time on this issue for one of the projects I worked on.
I even brought it up during one of the MSDN events with a Microsoft SQL Server MVP speaker. He asked me to email him in detail about it and when I did he never replied back.|||Thanks for the reply. That's what I was afraid of. Guess I'll probably end up using Active Reports for now. Thanks again!

display reporting services objects only during printing

Hi all
Is there a way to suppress the text box, table etc in a reportin
services report while displaying it on the browser and display the
when the report is printed
Thanks
ringnot today.
there is no way to know how the report is rendered (HTML, PDF, print...)
its an important feature and everyone wait for it
"rings" <sridevi3@.hotmail-dot-com.no-spam.invalid> wrote in message
news:i8udnSeuL747JU3fRVn_vg@.giganews.com...
> Hi all,
> Is there a way to suppress the text box, table etc in a reporting
> services report while displaying it on the browser and display them
> when the report is printed?
> Thanks,
> rings
>

Friday, February 17, 2012

Display multi value parm in text box

Is there a way to dsiplay all the values of a multi value parm in a text box?

Yes. Set value to =Join(Parameter!Name.Value,", ")

This will give you a comma seperated list. If you want another seperator, simply change what is in the quotes.

Display multi value parameter LABEL

Hello.
I have a multi value parameter in my report.
I want to know how can I display all of the selected values in this
parameter in a text box.
Whan I try to use this parameter in a textBox it automaticly take the
value:
Parameter.param.Value(0) Whice take only the first select value.
Is there a simple way of doing it?
Thanks.Ok.
I found it -
=3DJoin(Parameter!param1.value,",")
Thanks.
nicknack =D7=9B=D7=AA=D7=91:
> Hello.
> I have a multi value parameter in my report.
> I want to know how can I display all of the selected values in this
> parameter in a text box.
> Whan I try to use this parameter in a textBox it automaticly take the
> value:
> Parameter.param.Value(0) Whice take only the first select value.
> Is there a simple way of doing it?
> Thanks.|||On Mar 6, 7:26 am, "nicknack" <roezo...@.gmail.com> wrote:
> Ok.
> I found it -
> =3DJoin(Parameter!param1.value,",")
> Thanks.
> nicknack =D7=9B=D7=AA=D7=91:
> > Hello.
> > I have a multi value parameter in my report.
> > I want to know how can I display all of the selected values in this
> > parameter in a text box.
> > Whan I try to use this parameter in a textBox it automaticly take the
> > value:
> > Parameter.param.Value(0) Whice take only the first select value.
> > Is there a simple way of doing it?
> > Thanks.
Good thing to know.
Regards,
Enrique Martinez
Sr. SQL Server Developer|||What if the user selects All and the list of items is very long. For example
vendors you sell their items? How can you show "All Vendors" instead of the
very long list of names. It overruns the report.
--
cjm
"EMartinez" wrote:
> On Mar 6, 7:26 am, "nicknack" <roezo...@.gmail.com> wrote:
> > Ok.
> > I found it -
> > =Join(Parameter!param1.value,",")
> >
> > Thanks.
> >
> > nicknack ×?ת×?:
> >
> > > Hello.
> > > I have a multi value parameter in my report.
> > > I want to know how can I display all of the selected values in this
> > > parameter in a text box.
> > > Whan I try to use this parameter in a textBox it automaticly take the
> > > value:
> > > Parameter.param.Value(0) Whice take only the first select value.
> >
> > > Is there a simple way of doing it?
> >
> > > Thanks.
>
> Good thing to know.
> Regards,
> Enrique Martinez
> Sr. SQL Server Developer
>|||If, for example, you had a list of 25 vendors you could use:
= IIF(Parameters!Vendors.Count = 25, "All Vendors",
(JOIN(Parameters!Vendors.Label, ", ")))
Just adjust the number the .Count equals to the total number of values in
your parameter list.
"cmayers" wrote:
> What if the user selects All and the list of items is very long. For example
> vendors you sell their items? How can you show "All Vendors" instead of the
> very long list of names. It overruns the report.
> --
> cjm
>
> "EMartinez" wrote:
> > On Mar 6, 7:26 am, "nicknack" <roezo...@.gmail.com> wrote:
> > > Ok.
> > > I found it -
> > > =Join(Parameter!param1.value,",")
> > >
> > > Thanks.
> > >
> > > nicknack ×?ת×?:
> > >
> > > > Hello.
> > > > I have a multi value parameter in my report.
> > > > I want to know how can I display all of the selected values in this
> > > > parameter in a text box.
> > > > Whan I try to use this parameter in a textBox it automaticly take the
> > > > value:
> > > > Parameter.param.Value(0) Whice take only the first select value.
> > >
> > > > Is there a simple way of doing it?
> > >
> > > > Thanks.
> >
> >
> > Good thing to know.
> >
> > Regards,
> >
> > Enrique Martinez
> > Sr. SQL Server Developer
> >
> >

Tuesday, February 14, 2012

Display first record occurance in textbox in RB

Dear Anyone,

I would like to display the first occurance of a record as a text box outside that of the report. I would like to do this in Report Builder. Is this possible?

Thanks,
Joseph

Try:

Use an expression like

= First(Fields!FieldName.Value, "DataSet1")

where field name = the mane of your record field; and DataSet1 is your dataset name.|||

It doesnt seem to work. I'm using this on a new textbox in RB. Am I doing it wrong?

|||Heres the error that gets displayed:

The Value expression for the textbox ‘textbox’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. (rsInvalidAggregateScope)|||If you just want the dataset scope, leave out the second parameter:

= First(Fields!FieldName.Value)

RB doesn't expose the RDL field names directly, so you'll have to guess that part. It's usually equal to or a predictable variant of the text in the column header.

Display first record occurance in textbox in RB

Dear Anyone,

I would like to display the first occurance of a record as a text box outside that of the report. I would like to do this in Report Builder. Is this possible?

Thanks,
Joseph

Try:

Use an expression like

= First(Fields!FieldName.Value, "DataSet1")

where field name = the mane of your record field; and DataSet1 is your dataset name.|||

It doesnt seem to work. I'm using this on a new textbox in RB. Am I doing it wrong?

|||Heres the error that gets displayed:

The Value expression for the textbox ‘textbox’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. (rsInvalidAggregateScope)|||If you just want the dataset scope, leave out the second parameter:

= First(Fields!FieldName.Value)

RB doesn't expose the RDL field names directly, so you'll have to guess that part. It's usually equal to or a predictable variant of the text in the column header.