Tuesday, March 27, 2012
Accessing grouped values "inside" fields
I'm struggling to make operations on results obtained from grouping by
specific dimensions. To be more specific, I'd like to substract value of
e.g. sales for some product for one year from values from the preceding
year.
I'd like to somehow access the resulting recordset from grouping and make
some operations on these values, just like the SUBTOTAL function does.
Thanks in advance for any help.
Best wishes,
Marek T³uczekOne correction to my question:
> I'd like to somehow access the resulting recordset from grouping and make
> some operations on these values, just like the SUBTOTAL function does.
I meant not recordset, but set of fields.
> Thanks in advance for any help.
> Best wishes,
> Marek T³uczek
>
>
Sunday, March 25, 2012
accessing fake data inside an INSTEAD OF trigger
Is it possible to access inserted data through an UPDATE INSTEAD OF
trigger if the condition of the query does not match any row in a
table?
For example :
UPDATE myTable SET myColumn1 = 'abc' WHERE myColumn2 = 'xyz'
If there is no row inside myTable matching the condition "WHERE
myColumn2 = 'xyz'", the INSTEAD OF trigger is activated without any
error but the inserted table remains empty.
Is there a way to access the value 'abc' in such a situation?
thank you
sNo, you do not have access to the originating command, nor any
parameters of that command. What you have access to are the DELETED
and INSERTED tables, and the table that was updated.
Roy Harvey
Beacon Falls, CT
On 2 Mar 2006 15:34:44 -0800, "steven" <stevenshawk@.gmail.com> wrote:
>Hello,
>Is it possible to access inserted data through an UPDATE INSTEAD OF
>trigger if the condition of the query does not match any row in a
>table?
>For example :
>UPDATE myTable SET myColumn1 = 'abc' WHERE myColumn2 = 'xyz'
>If there is no row inside myTable matching the condition "WHERE
>myColumn2 = 'xyz'", the INSTEAD OF trigger is activated without any
>error but the inserted table remains empty.
>Is there a way to access the value 'abc' in such a situation?
>thank you
>s|||OK ... but this data should exist somewhere.
I mean if the server returns an empty cursor when I do a SELECT * FROM
INSERTED within the trigger, it is because it has access to myColumn2 =
'xyz'. Any API to access the query content, even if it does not match
anything in the table?
thank you
Roy Harvey wrote:
> No, you do not have access to the originating command, nor any
> parameters of that command. What you have access to are the DELETED
> and INSERTED tables, and the table that was updated.
> Roy Harvey
> Beacon Falls, CT
>
> On 2 Mar 2006 15:34:44 -0800, "steven" <stevenshawk@.gmail.com> wrote:
>|||On 3 Mar 2006 07:30:03 -0800, "steven" <stevenshawk@.gmail.com> wrote:
>OK ... but this data should exist somewhere.
>I mean if the server returns an empty cursor when I do a SELECT * FROM
>INSERTED within the trigger, it is because it has access to myColumn2 =
>'xyz'. Any API to access the query content, even if it does not match
>anything in the table?
>thank you
Nothing like that I've ever heard of. Or imagined, for that matter.
Roy Harvey
Beacon Falls, CT
Sunday, March 11, 2012
Access to Windows Registry
is it possible, inside T-SQL, to access and set keys in Windows
Registry?
Thanks for your help.
MassimoSure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.
Access to Windows Registry
is it possible, inside T-SQL, to access and set keys in Windows
Registry?
Thanks for your help.
Massimo
Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
Access to Windows Registry
is it possible, inside T-SQL, to access and set keys in Windows
Registry?
Thanks for your help.
MassimoSure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.
Access to the database file is not allowed.
The issue I'm having is that under Vista and when running inside IE7 I get the error in the title. However there is no problems with IE7 under windows XP, or with Firefox and MSN Messenger under XP or Vista!
When selecting to run IE as administrator, the problem dissapears, however when using the LogonUser API to impersonate an administrator it doesnt.
This would seem like a permissions issue, strange though that Firefox under vista has no problems.. Also, the following code throws no SecurityException under either browser, indicating the code is running with full trust.
new PermissionSet(PermissionState.Unrestricted).Demand();
Any input would be a huge help, I've been banging my head against this all day..
I can now confirm this same behaviour on VS08 Beta 2 and SqlCe 3.5
Any ideas? Anybody point me in the direction of a better place to ask as this seems more like something specific to IE7 and Vista than SqlCe as such?
Many thanks
|||To answer my own question, by default in Vista, IE runs in protected mode and is a "low integrity" process, it has even less priveleges than the logged on user, including a logged on but not elevated administrator.
Since my .sdf file was a medium integrity resource... Access Denied!
For reference, further details here.
Access to the database file is not allowed.
The issue I'm having is that under Vista and when running inside IE7 I get the error in the title. However there is no problems with IE7 under windows XP, or with Firefox and MSN Messenger under XP or Vista!
When selecting to run IE as administrator, the problem dissapears, however when using the LogonUser API to impersonate an administrator it doesnt.
This would seem like a permissions issue, strange though that Firefox under vista has no problems.. Also, the following code throws no SecurityException under either browser, indicating the code is running with full trust.
new PermissionSet(PermissionState.Unrestricted).Demand();
Any input would be a huge help, I've been banging my head against this all day..
I can now confirm this same behaviour on VS08 Beta 2 and SqlCe 3.5
Any ideas? Anybody point me in the direction of a better place to ask as this seems more like something specific to IE7 and Vista than SqlCe as such?
Many thanks
|||To answer my own question, by default in Vista, IE runs in protected mode and is a "low integrity" process, it has even less priveleges than the logged on user, including a logged on but not elevated administrator.
Since my .sdf file was a medium integrity resource... Access Denied!
For reference, further details here.
Tuesday, March 6, 2012
Access to datasources in custom code
I'm wondering if there is any way to access the datasources inside
your custom code of a VS 2005.NET report. My datasources are made up
of custom business objects, thus you can imagine wanting to manipulate
them from the report. In this particular case I want to build up a TOC
during the build of the report, which right now I build up in a
database table.
DaveYou would have to write a data processing extension (non-trivial). Read up
on this in Books OnLine.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"dnote" <mrdnote@.yahoo.com> wrote in message
news:1170692326.111173.53510@.s48g2000cws.googlegroups.com...
> Hi there!
> I'm wondering if there is any way to access the datasources inside
> your custom code of a VS 2005.NET report. My datasources are made up
> of custom business objects, thus you can imagine wanting to manipulate
> them from the report. In this particular case I want to build up a TOC
> during the build of the report, which right now I build up in a
> database table.
> Dave
>
Saturday, February 25, 2012
Access shared data source inside custom assembly
I have a database connection string hard-coded in a SQL Server 2005 Reporting Services custom assembly. Since the connection string is environment-specific (dev/prod), I would like to read the connections string from a settings file, like is typically done for web.config. Using the shared data source is also a good option.
How do I accomplish this?
I looked into trying to use DataSourceReference(), but that does not seem to be allowed inside of a custom assembly. Thank you.
Only private data sources can be expression-based. You can think of the Report Server as a web application since it runs under IIS. Therefore, you can put your config settings in the C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\web.config just like you would do with a regular ASP.NET app. Assuming you've deployed your report to the report catalog, you can read these settings at runtime . Additional considerations:
1. This technique is not supported.
2. Since there is no HttpContext in in the VS.NET Report Designer, you need to check for this condition and default your settings so you report works in design mode. I have a report in this download that demostrates how you can do this.
Access shared data source inside custom assembly
I have a database connection string hard-coded in a SQL Server 2005 Reporting Services custom assembly. Since the connection string is environment-specific (dev/prod), I would like to read the connections string from a settings file, like is typically done for web.config. Using the shared data source is also a good option.
How do I accomplish this?
I looked into trying to use DataSourceReference(), but that does not seem to be allowed inside of a custom assembly. Thank you.
Check Jason's blog here
http://weblogs.asp.net/jgaylord/archive/2005/05/12/406639.aspx
HTH
Regards
Thank you. I read that blog, but it just seems to mention connection strings in general. The issue I am facing is that the Reporting Services assembly does not seem to allow me to access web.config, even though there is a web.config associated with RS. When I try to write "Imports System.Web.Configuration," VS2005 says it is not available and that the WebConfigurationManager is not available.
|||Ok, simply add the System.Configurations.Dll as a reference in your project.
Let me know if you need further help.
Regards
Access Script Task
Hi,
How to access the Package inside the Script Taks. for example
IF intStatus = 1 Then
//Execute Package1
Else
//Execute Package2
End IF
in the above sample what is the property to get the Package1 object in script
Thanks & Regards
Jegan.T
You should use the Execute Package Task in order to execute other packages. Any reason why this doesn't work for you?
-Jamie
|||If i use Execute Package i have to supply all the connection string details.we have the requirement is like this we have to excute the package based on a routine or function execution .its more like using batch file in Data Stage.
Jegan.T
|||Sorry, I don't know anything about DataStage.
The connection string for the package tells you where it is located. Surely you need the same information in order to execute from the Script Task?
-Jamie
|||Hi Jamie
Thanks for your reply . but the Script Task does not have any provison for connection string .
i have the design like this in the control flow
Script Task -> DataFlow1 --> DataFlow2
we have to write a routine in the script editor which will decied which DataFlow it has to execute
Script Editor
--
Public Sub Main()
'Code to Invoke DataFlow1 or DataFlow2
End Sub
How to achive this in the script editor ?
Thanks
Jegan.T
|||I'm confused. At the start of this thread you said you were trying to execute a package.
NOW you say you are trying to decide which data-flow to execute.
The two are completely different so which is it? Perhaps you can explain exactly what it is you are trying to do.
If what you are trying to do is conditionally execute a data-flow then you are going about it the wrong way. You do not need to use a script task - use conditional precedence constraits which are described here: http://www.sqlis.com/default.aspx?306
-Jamie
Friday, February 24, 2012
Access Reports using ASP.net application?
Hi,
I am currently exploring Reporting services. I have created a simple report and would like to give access to my reports inside my asp.net application.
Can someone help me on how to go about doing this.
Thanks.
Hi eeyore21
The easiest way to do this is to create an IFRAME obtject and point the souce to the reportserver URL.
You could check out posting 'Adding Parameters from .ASPX file'on this forum. I posted some simular info there
,L0n3i200n
and search for Reporting Services Rendering. They have examples thatwill allow you to use reports in your asp.net app. I actually havearound 14 reports that are a part of a web app that I created inASP.Net that use this method.