Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Monday, March 19, 2012

Controls pushed off to the right

This is pretty weird... any controls past the halfway horizontal point of the report get pushed into page 2. The leftmost control is not affected just those to the right of it. It's like there is an invisible tab after the leftmost control. Smaller (not leftmost controls) (not past the middle of the page) are also pushed way to the right (just not into a new page)

Is there some property (that I'm not aware of) that does this? It doesn't matter if I use textboxes or lines. I have not changed any of the default control properties. flow layout is still LTR.
In my current report I have questions and answers on separate lines...I can't place them next to each other or it screws up the pagination.

I start with a new report and it does not do this but as soon as I add 2-3 vertical pages (over 11' x 2) This starts happening.

Has anyone experienced this?

I have experienced this in trying to lay out textboxes next to each other. The one to the right ends up getting pushed much further to the right then I want it to. The I've found to stop this from happening is to put both of my text boxes in a rectangle and then size the rectangle to match the width of the page. Then I can place my text boxes where I want within the rectangle and they'll stay put, for the most part.

Controls pushed off to the right

This is pretty weird... any controls past the halfway horizontal point
of the report get pushed into page 2. The leftmost control is not
affected just those to the right of it. It's like there is an
invisible tab after the leftmost control. Smaller (not leftmost
controls) (not past the middle of the page) are also pushed way to the
right (just not into a new page)
Is there some property (that I'm not aware of) that does this? It
doesn't matter if I use textboxes or lines. I have not changed any of
the default control properties. flow layout is still LTR.
In my current report I have questions and answers on separate
lines...I can't place them next to each other or it screws up the
pagination.
I start with a new report and it does not do this but as soon as I add
2-3 vertical pages (over 11' x 2) This starts happening.
Has anyone experienced this?Select from the menu format->align and left/center/right. I think it should
be with alignment. because you said all the controls comes to left side of
the page.
Amarnath
"tom booster" wrote:
> This is pretty weird... any controls past the halfway horizontal point
> of the report get pushed into page 2. The leftmost control is not
> affected just those to the right of it. It's like there is an
> invisible tab after the leftmost control. Smaller (not leftmost
> controls) (not past the middle of the page) are also pushed way to the
> right (just not into a new page)
> Is there some property (that I'm not aware of) that does this? It
> doesn't matter if I use textboxes or lines. I have not changed any of
> the default control properties. flow layout is still LTR.
> In my current report I have questions and answers on separate
> lines...I can't place them next to each other or it screws up the
> pagination.
> I start with a new report and it does not do this but as soon as I add
> 2-3 vertical pages (over 11' x 2) This starts happening.
> Has anyone experienced this?
>

Control-M vs SQL Server Agent

Hi
We have a plan to migrate from SQL Server Agent to Control for job schedulin
g.
For those who have done this or attempted to it, I would be very grateful if
you could share some of your experience.
I would be interested in:
- Which scripting language did you use for wrapper scripts?
- Did you continue using maintenance plans for backups, dbcc's, re-indixing,
etc.?
- How did you run dts packages from control-M and were you able to report
useful message through control-M?
- Why would you, or would you not, migrate to control-M
Many thanks,Hi
We are at a start of a 300 SQL Server 2000 migration project to Control-M.
It is the corporate standard, so we don't have much choice.
We will probably use PERL for the wrappers, but VBS might still be used.
Everything will be migrated, but we have a toolset of PERL scripts that does
backups, restores, cold loads etc. This will help a lot.
The DTS stuff, well, it will be moved, but I don't think we will get good
error reporting out of it, unless each DTS package logs what it is doing.
In 60 days, we have to be finished.....
Regards
Mike
"dave222" wrote:

> Hi
> We have a plan to migrate from SQL Server Agent to Control for job schedul
ing.
> For those who have done this or attempted to it, I would be very grateful
if
> you could share some of your experience.
> I would be interested in:
> - Which scripting language did you use for wrapper scripts?
> - Did you continue using maintenance plans for backups, dbcc's, re-indixin
g,
> etc.?
> - How did you run dts packages from control-M and were you able to report
> useful message through control-M?
> - Why would you, or would you not, migrate to control-M
> Many thanks,

Control-M vs SQL Server Agent

Hi
We have a plan to migrate from SQL Server Agent to Control for job scheduling.
For those who have done this or attempted to it, I would be very grateful if
you could share some of your experience.
I would be interested in:
- Which scripting language did you use for wrapper scripts?
- Did you continue using maintenance plans for backups, dbcc's, re-indixing,
etc.?
- How did you run dts packages from control-M and were you able to report
useful message through control-M?
- Why would you, or would you not, migrate to control-M
Many thanks,Hi
We are at a start of a 300 SQL Server 2000 migration project to Control-M.
It is the corporate standard, so we don't have much choice.
We will probably use Perl for the wrappers, but VBS might still be used.
Everything will be migrated, but we have a toolset of Perl scripts that does
backups, restores, cold loads etc. This will help a lot.
The DTS stuff, well, it will be moved, but I don't think we will get good
error reporting out of it, unless each DTS package logs what it is doing.
In 60 days, we have to be finished.....
Regards
Mike
"dave222" wrote:
> Hi
> We have a plan to migrate from SQL Server Agent to Control for job scheduling.
> For those who have done this or attempted to it, I would be very grateful if
> you could share some of your experience.
> I would be interested in:
> - Which scripting language did you use for wrapper scripts?
> - Did you continue using maintenance plans for backups, dbcc's, re-indixing,
> etc.?
> - How did you run dts packages from control-M and were you able to report
> useful message through control-M?
> - Why would you, or would you not, migrate to control-M
> Many thanks,

Control-M vs SQL Server Agent

Hi
We have a plan to migrate from SQL Server Agent to Control for job scheduling.
For those who have done this or attempted to it, I would be very grateful if
you could share some of your experience.
I would be interested in:
- Which scripting language did you use for wrapper scripts?
- Did you continue using maintenance plans for backups, dbcc's, re-indixing,
etc.?
- How did you run dts packages from control-M and were you able to report
useful message through control-M?
- Why would you, or would you not, migrate to control-M
Many thanks,
Hi
We are at a start of a 300 SQL Server 2000 migration project to Control-M.
It is the corporate standard, so we don't have much choice.
We will probably use Perl for the wrappers, but VBS might still be used.
Everything will be migrated, but we have a toolset of Perl scripts that does
backups, restores, cold loads etc. This will help a lot.
The DTS stuff, well, it will be moved, but I don't think we will get good
error reporting out of it, unless each DTS package logs what it is doing.
In 60 days, we have to be finished.....
Regards
Mike
"dave222" wrote:

> Hi
> We have a plan to migrate from SQL Server Agent to Control for job scheduling.
> For those who have done this or attempted to it, I would be very grateful if
> you could share some of your experience.
> I would be interested in:
> - Which scripting language did you use for wrapper scripts?
> - Did you continue using maintenance plans for backups, dbcc's, re-indixing,
> etc.?
> - How did you run dts packages from control-M and were you able to report
> useful message through control-M?
> - Why would you, or would you not, migrate to control-M
> Many thanks,

Controlling User Privileges

Hi,
I'm designing an application which uses SQL Server 2000 as
the database. At the application level, I have features to
maintain & control application level users.
Approach-1
Users login to the application using their application
logins and the application will authenticate their
privileges. But internally the application use a SINGLE
SQL Server login to access the database(s) in the server.
Approach-2
At the SQL Server level, we create logins and database
users for each application user and map them. So depending
upon the application user, the corresponding sql server
login/user will be used to access the database(s).
Now, I want to assess the Pros & Cons of these two
approaches.
Sorry for making this posting so big.
Expecting guidance and pointers to any relevant resources.
TIA,
HariHave you considered 3rd possibility - using trusted authentication. i.e.
Windows users and groups? Check the "Managing Security" topics in Bokks
OnLine
(mk:@.MSITStore:C:\Program%20Files\Microsoft%20SQL%20Server\80\Tools\Books\ad
minsql.chm::/ad_security_05bt.htm).
--
Dejan Sarka, SQL Server MVP
Please reply only to the newsgroups.
"Hari" <anonymous@.discussions.microsoft.com> wrote in message
news:09c701c3a421$b9541fc0$a101280a@.phx.gbl...
> Hi,
> I'm designing an application which uses SQL Server 2000 as
> the database. At the application level, I have features to
> maintain & control application level users.
> Approach-1
> Users login to the application using their application
> logins and the application will authenticate their
> privileges. But internally the application use a SINGLE
> SQL Server login to access the database(s) in the server.
> Approach-2
> At the SQL Server level, we create logins and database
> users for each application user and map them. So depending
> upon the application user, the corresponding sql server
> login/user will be used to access the database(s).
> Now, I want to assess the Pros & Cons of these two
> approaches.
> Sorry for making this posting so big.
> Expecting guidance and pointers to any relevant resources.
> TIA,
> Hari|||Hi Hari,
Hope you have considered the number of users logging in and the kind of changes they are going to make through your application?
If the users are going to be Windows Domain users, then you can go for what Dejan has suggested. And if the users are in large numbers and do not have windows domain authentication, it is better to go with your first approach. Beware that you will not know what changes the users are going to make, unless you are logging it somewhere at the application level.
And the second approach will be useful if you want to control user access at the database level.
Thanks
GYK
-- Dejan Sarka wrote: --
Have you considered 3rd possibility - using trusted authentication. i.e.
Windows users and groups? Check the "Managing Security" topics in Bokks
OnLine
(mk:@.MSITStore:C:\Program%20Files\Microsoft%20SQL%20Server\80\Tools\Books\ad
minsql.chm::/ad_security_05bt.htm).
--
Dejan Sarka, SQL Server MVP
Please reply only to the newsgroups.
"Hari" <anonymous@.discussions.microsoft.com> wrote in message
news:09c701c3a421$b9541fc0$a101280a@.phx.gbl...
> Hi,
>> I'm designing an application which uses SQL Server 2000 as
> the database. At the application level, I have features to
> maintain & control application level users.
>> Approach-1
>> Users login to the application using their application
> logins and the application will authenticate their
> privileges. But internally the application use a SINGLE
> SQL Server login to access the database(s) in the server.
>> Approach-2
>> At the SQL Server level, we create logins and database
> users for each application user and map them. So depending
> upon the application user, the corresponding sql server
> login/user will be used to access the database(s).
>> Now, I want to assess the Pros & Cons of these two
> approaches.
>> Sorry for making this posting so big.
>> Expecting guidance and pointers to any relevant resources.
>> TIA,
> Hari

Controlling Trigger actions based on user

Is it possible to control the actions of a trigger based on the user who
updates the record?
In pseudo code, I'm trying to do the following:
on update:
if (updating user = "User_A") and (Artist_Type = "DJ" or "CL") then
{ newrecord.PIC_FIELD = oldrecord.PIC_FIELD }
Could someone shead some light on if/how this could be done in "real" code?
Any help would be GREATLY appreciated.
Thanks,
_KThe trigger's code should look very similar to your pseudo code (not
tested):
IF SUSER_SNAME() = 'User_A'
BEGIN
UPDATE T1
SET PIC_FIELD = D.PIC_FIELD
FROM T1 JOIN deleted AS D
ON T1.key = D.key
WHERE T1.Artist_Type IN('DJ', 'CL')
END
BG, SQL Server MVP
www.SolidQualityLearning.com
"KBryan" <kbryan@.noyouwont.com> wrote in message
news:%237v6ttWNFHA.2716@.TK2MSFTNGP10.phx.gbl...
> Is it possible to control the actions of a trigger based on the user who
> updates the record?
> In pseudo code, I'm trying to do the following:
> on update:
> if (updating user = "User_A") and (Artist_Type = "DJ" or "CL") then
> { newrecord.PIC_FIELD = oldrecord.PIC_FIELD }
>
> Could someone shead some light on if/how this could be done in "real"
> code?
> Any help would be GREATLY appreciated.
> Thanks,
> _K
>|||Thanks VERY much.
Would it still be deleted if this is an update trigger?
"Itzik Ben-Gan" <itzik@.REMOVETHIS.SolidQualityLearning.com> wrote in message
news:%23pug97WNFHA.3560@.TK2MSFTNGP14.phx.gbl...
> The trigger's code should look very similar to your pseudo code (not
> tested):
> IF SUSER_SNAME() = 'User_A'
> BEGIN
> UPDATE T1
> SET PIC_FIELD = D.PIC_FIELD
> FROM T1 JOIN deleted AS D
> ON T1.key = D.key
> WHERE T1.Artist_Type IN('DJ', 'CL')
> END
> --
> BG, SQL Server MVP
> www.SolidQualityLearning.com
>
> "KBryan" <kbryan@.noyouwont.com> wrote in message
> news:%237v6ttWNFHA.2716@.TK2MSFTNGP10.phx.gbl...
>|||Yes; deleted holds the old image of the modified data.
BG, SQL Server MVP
www.SolidQualityLearning.com
"KBryan" <kbryan@.noyouwont.com> wrote in message
news:%23WFXaMXNFHA.1172@.TK2MSFTNGP12.phx.gbl...
> Thanks VERY much.
> Would it still be deleted if this is an update trigger?
>
> "Itzik Ben-Gan" <itzik@.REMOVETHIS.SolidQualityLearning.com> wrote in
> message news:%23pug97WNFHA.3560@.TK2MSFTNGP14.phx.gbl...
>

Controlling toolbar appearance in Webforms Report Viewer Control

I see that the Report Viewer Control has a number of properties that can be
set to control things like the control's border color and width, the
background color of the toolbars, the border and color of the buttons, etc.
However I have some additional formatting requirements:
1. How do I control the font properties (face, color, etc.) for the report
parameter labels and other text in the toolbars?
2. Is there a way that I can force the report parameters to render in a
single column or otherwise control their layout? They normally render across
the page and then down which sometimes results in an unusual order for the
user to see them. I know I could create custom report parameter forms but I
am trying to avoid that.
--
Chris, SSSIHi Steven,
Thank you for your reply. I have some follow up questions:
>>Based on my test, all the text's Font settings can be configured through
>>the ReportViewer control's "Font" property.
1) I see those settings in the Properties window, but how do I set these
font settings programatically?
2) The Microsoft.Reporting.WebForms.ReportViewer class has a Font property,
but it is ReadOnly. So how do I set these settings in code at runtime? Can
the font settings only be set at design time?
>>I've attached a screenshot on the setting of this Font property on my test page.
3) I do not see a screenshot attached to your posting. Did you forget to
attach it?
>>so it won't affect our rendered report's text font.
That is fine and actually the behavior I want.
--
Chris, SSSI
"Steven Cheng[MSFT]" wrote:
> Hello Chris,
> As for the two questions you mentioned, here are my understanding and
> suggestion:
> 1. How do I control the font properties (face, color, etc.) for the report
> parameter labels and other text in the toolbars?
> ==============================================> Based on my test, all the text's Font settings can be configured through
> the ReportViewer control's "Font" property. This property will affect the
> text on every element on reportviewer toolbar, include parameter label,
> parameter input textbox, buttons ...... I've attached a screenshot on
> the setting of this Font property on my test page. BTW, so far I only find
> this very Font setting for the ReportViewer which affect the text on the
> reportViewer's non-ReportClient region, so it won't affect our rendered
> report's text font.
>
> 2. Is there a way that I can force the report parameters to render in a
> single column or otherwise control their layout? They normally render
> across
> the page and then down which sometimes results in an unusual order for the
> user to see them. I know I could create custom report parameter forms but I
> am trying to avoid that.
> ===============================================> I've performed some test and research, it seems the Report parameters panel
> is fixed above the reportViewer control and there is no much individual
> properties to customize it. So far what I can get is the following option:
> 1. Make the "ShowParameterPrompts" and "ShowRefreshButton" to "false" so
> that they won't display on the reportviewr.
> 2. We can add create our own UI (through ASP.NET controls ) to accept
> parameter values
> 3. Also, we need to add our own button and use code to programmtically set
> the parameter from our custom controls into ReportViewer.ServerReport and
> call its Refresh method to rerender it.
> Please let me know if there is anything else you wonder.
> Sincerely,
> Steven Cheng
> Microsoft MSDN Online Support Lead
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
>|||Thanks for your reply Chris,
For your further question:
Yes, we can also programmatically adjust the ReportViewer.Font property
settings. For example:
page classs
{
.............
protected void btnStyle_Click(object sender, EventArgs e)
{
ReportViewer1.Font.Bold = true;
ReportViewer1.Font.Name = "Verdana";
ReportViewer1.Font.Size = FontUnit.Point(24);
ReportViewer1.Font.Underline = true;
}
}
Hope this also helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||Steven,
So then the Intellisense tooltip which says ReportViewer.Font is ReadOnly is
incorrect? Is this bug being fixed?
-- Chris
Chris, SSSI
"Steven Cheng[MSFT]" wrote:
> Thanks for your reply Chris,
> For your further question:
>
> Yes, we can also programmatically adjust the ReportViewer.Font property
> settings. For example:
> page classs
> {
> ..............
> protected void btnStyle_Click(object sender, EventArgs e)
> {
> ReportViewer1.Font.Bold = true;
> ReportViewer1.Font.Name = "Verdana";
> ReportViewer1.Font.Size = FontUnit.Point(24);
> ReportViewer1.Font.Underline = true;
> }
> }
> Hope this also helps.
> Sincerely,
> Steven Cheng
> Microsoft MSDN Online Support Lead
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hi Chris,
Thanks for the reply.
As for the "ReportViewer.Font" property, it is derived from the
"WebControl" class and the VS IDE's intellisense is correct, the property
does be "ReadOnly". This is a common design for some complex properties of
Webcontrol class, such as "WebControl.ControlStyle" and
"WebControl.ControlStyle". For these complex properties, we should
modify their values through their sub-properties instead of directly modify
the property instance itself. This design is also for performance
consideration since replacing a whole complex property instance is much
more expensive than just replacing those sub properties.
Therefore, when we want to customize any webcontrol's "Font" property, we
should access its sub properties instead, like:
ReportViewer1.Font.Bold = true;
ReportViewer1.Font.Name = "Verdana";
#WebControl.Font
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontro
l.font.aspx
BTW, it is recommended that we also follow this pattern when we add custom
properties for webcontrol which is of such complex type.
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hello Chris,
Have you got the issue resolved? Please feel free to let me know if there
is anything else we can help.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

controlling security through stored procedures -- 2005 behaviour

Hi!

I'm trying to control security through sps -- meaning execute permissions are granted on stored procedures, and no users have read/write permissions on tables, etc directly.

Which works fine as long as all objects referenced are in the same db as the procedure.

An issue arises when a stored procedure accesses a table in another database:

Getting a : Msg 229 SELECT permission denied on object 'blah' Even though the procedure is created by sysadmin.

Has this changed since 2000? I'm pretty sure in 2000 it would've worked as the sp would be executed in sp owner's security context.

Moreover, when I try to use EXECUTE AS in the sp as a workaround, I am getting the following, no matter what account I try to impersonate:

Msg 916, Level 14, State 1, Procedure vvv, Line 4
The server principal % is not able to access the database "blah" under the current security context.

any ideas?
Thanks!

Most likely this scenario worked on Windows 2000 with cross-database ownership chaining enabled. Turning on this feature is not recommended, as it may lead to an elevation of privileges (i.e. the DB administrators of the source database may escalate their privileges to become DB administrators on the target DB).

The reason why your stored procedure marked with “execute as” is not working is because the impersonated context is (by default) scoped only to the surrent (source) database, and stripped down from it's server-scoped permissions and privileges. If you wish to use this impersonated context outside the source DB, you need to establish a trust relationship on the target DB.

To solve this problem, you can probably use digital signatures to solve your problem; by signing the stored procedure with a certificate you have a way to ensure that the code has not been tampered with. If at run time the signature matches the code, the certificate can be used in two ways:

* As a secondary identity for the execution context. This means that if there is a user mapped to the signing certificate, the permissions on that user will be used to calculate the permissions on the object.

* When the module (SP) is marked with execute as, the signature will work as an authenticator, that means the signature will be used to vouch for the impersonated context in the stored procedure

Note that for the secondary identity approach, the signature will be added to the current context therefore, if the current context is not a valid one on the server scope (i.e. the caller is an approle), the certificate as secondary identity cannot be used on cross database scenario.

The second approach on the other hand establishes a whole new context on top of the calling context, and it is the signature the one vouching for this new context on the target database.

I am posting a small demo at the end taht I hope will help you.

Thanks a lot for your comments and feedback.

-Raul Garcia
SDE/T
SQL Server Engine
This posting is provided "AS IS" with no warranties, and confers no rights.

-

/*******************************************************************

*

* This posting is provided "AS IS" with no warranties, and
* confers no rights.

*

* Author: Raulga

* Date: 08/24/2005

* Description:

* This demo shows how to use digital signatures to access
* resources on a different database by using digitaly signed stored
* procedures to control the access rather than using cross database
* ownership chaining.

*

* The first SP will be using the siganture as a secondary identity
* on top of the calling context. This means that only a context with
* a server-presence will succeed on this call (i.e. approles will not
* be able to accsss the resources on the target database as they

* don't have a server presence).

*

* The second approach will be by specifying a context switch
* (EXECUTE AS) on the stored procedure and using the signature as an
* authenticator; this means that the signature can vouch for the
* impersonated context (specifid on the module). This mechanism will
* allow to access the resources regardless of the original calling
* context because a new context (vouched by the signature) is placed
* on top of the orginal one, but requires more managment.

*

* (c) 2005 Microsoft Corporation. All rights reserved.

*

***********************************************************************************************/

CREATE DATABASE db_Source

go

CREATE DATABASE db_Target

go

CREATE LOGIN dbo_db_Source WITH PASSWORD = 'My S0uRc3 D8 p@.55W0rD!'

CREATE LOGIN dbo_db_Target WITH PASSWORD = 'My +@.r637 D8 p@.55W0rD!'

go

-- Change the ownership for the source and the target databases

ALTER AUTHORIZATION ON DATABASE::db_Source to dbo_db_Source

ALTER AUTHORIZATION ON DATABASE::db_Target to dbo_db_Target

go

-- This principal will be the data owner, he can access the data on

-- the target database, and he controls the stored procedures on the

-- source database

CREATE LOGIN data_owner WITH PASSWORD = 'd@.+4 0wn3R'

-- This principal should only have access to the data via the stored

-- procedures

CREATE LOGIN someuser WITH PASSWORD = 's0m3 p@.55w0Rd'

go

use db_Target

go

CREATE USER someuser

CREATE USER data_owner WITH DEFAULT_SCHEMA = data_owner

go

CREATE SCHEMA data_owner AUTHORIZATION data_owner

go

CREATE TABLE data_owner.MyTable( data nvarchar(100) )

go

INSERT INTO data_owner.MyTable values ( N'My data' )

go

use db_Source

go

CREATE USER someuser

CREATE USER data_owner WITH DEFAULT_SCHEMA = data_owner

go

CREATE SCHEMA data_owner AUTHORIZATION data_owner

go

-- ALlow someuser to execute any module on the schema called data_owner

GRANT EXECUTE ON SCHEMA::data_owner TO someuser

go

-- Create a stored procedure that uses the default execution context

-- (the caller's context) at runtime

CREATE PROC data_owner.sp_GetMyData01

AS

select * from db_Target.data_owner.MyTable

go

-- Create a stored procedure similar to teh previous one, but this time we will explicitly

-- use the data_owner context via EXECUTE AS

CREATE PROC data_owner.sp_GetMyData02

WITH EXECUTE AS 'data_owner'

AS

select * from db_Target.data_owner.MyTable

go

-

-- Let's see what is the behavior without any signatures

--

-- You can either start new connections or just use the

-- EXECUTE AS LOGIN & REVERT statements I show here for testing

-- Execute as the data owner

-

EXECUTE AS LOGIN = 'data_owner'

go

-- will succeed

EXEC data_owner.sp_GetMyData01

go

-- Will fail as the impersonated context is not trusted on the target
-- database

EXEC data_owner.sp_GetMyData02

go

REVERT

go

-

-- Execute as someuser

-

EXECUTE AS LOGIN = 'someuser'

go

-- will fail due to the lack of permissions on the target database

EXEC data_owner.sp_GetMyData01

-- will fail as the impersonated context is not trusted on the target
-- database

EXEC data_owner.sp_GetMyData02

go

REVERT

go

-

-- Signing the stored procedures

--

-- Create 2 certificates one to sign each SP.

-- Note that I am using passwords to protect the private keys.

-- It is also possible to use a DB master key to protect private the
-- keys, please refer to BOL for more information on the key
-- hierarchy

CREATE CERTIFICATE cert_GetMyData01

ENCRYPTION BY PASSWORD = 'GetMyData01 c3r+ p@.55w0Rd'

WITH SUBJECT = 'Certificate to sign sp_GetMyData01'

go

CREATE CERTIFICATE cert_GetMyData02

ENCRYPTION BY PASSWORD = 'GetMyData02 c3r+ P455W0Rd'

WITH SUBJECT = 'Certificate to sign sp_GetMyData02'

go

-- Now sign the stored procedures, as the cert's

-- private keys are protected by passwords, we have to use the
-- passwords to sign

ADD SIGNATURE TO data_owner.sp_GetMyData01 BY CERTIFICATE cert_GetMyData01

WITH PASSWORD = 'GetMyData01 c3r+ p@.55w0Rd'

go

ADD SIGNATURE TO data_owner.sp_GetMyData02 BY CERTIFICATE cert_GetMyData02

WITH PASSWORD = 'GetMyData02 c3r+ P455W0Rd'

go

-- Let's take a quick look to the metadata for the signed modules

SELECT schema_name( c.schema_id ) as schema_name, c.name,

b.name, a.crypt_property as 'module siganture' FROM

sys.crypt_properties a,

sys.certificates b,

sys.objects c

WHERE a.thumbprint = b.thumbprint AND a.class = 1
AND a.major_id = c.object_id

go

-- Depending on your application and environment, sometimes you may
-- not want to leave the private keys on the database, and either
-- destroy the private keys (this way, they can never be used to
-- sign anything else), or back up a copy of the private keys and
-- store them in a safe place. For this demo I will just destoy the
-- private keys as we don't need them anymore

ALTER CERTIFICATE cert_GetMyData01 REMOVE PRIVATE KEY

ALTER CERTIFICATE cert_GetMyData02 REMOVE PRIVATE KEY

go

-- Now, we need to create a backup for the certificate public data.

-- We will need to import it back on teh target database.

BACKUP CERTIFICATE cert_GetMyData01 TO FILE = 'cert_GetMyData01.cer'

BACKUP CERTIFICATE cert_GetMyData02 TO FILE = 'cert_GetMyData02.cer'

go

use db_Target

go

-- Import the certificates on the target database, note that we don't
-- need the private keys

CREATE CERTIFICATE cert_GetMyData01
FROM FILE = 'cert_GetMyData01.cer'

go


CREATE CERTIFICATE cert_GetMyData02
FROM FILE = 'cert_GetMyData02.cer'

go

-- Now let's create users mapped to each one of the certificates.

-- As permissions can only be granted to principals and not directly

-- to a certificate, we need to map the certificate to a user.

-- Note: The cert-mapped user SID is derived from teh certificate
-- thumbprint

-- therefore any 2+ principals (login or user in any database)
-- mapped to the

-- same certificate will have the same SID and will refer to the same

-- principal for practical purposes.

CREATE USER cert_GetMyData01 FOR CERTIFICATE cert_GetMyData01

go

CREATE USER cert_GetMyData02 FOR CERTIFICATE cert_GetMyData02

go

-- For the first SP, grant the permissions to the cert-mapped
-- user directly

GRANT SELECT ON data_owner.MyTable TO cert_GetMyData01

go

-- For the second SP, we want only AUTHENTICATE permissiion, this
-- will allow teh certificate to vouch for the context only on this
-- database.

-- Note: As the trust is only accross database and not accross the
-- instance, the new context is only valid for database operations,
-- and will not honor any server-scoped permissions.

GRANT AUTHENTICATE TO cert_GetMyData02

go

USE db_Source

go

-

-- Let's see what is the behavior without any signatures

--

-- You can either start new connections or just use the

-- EXECUTE AS LOGIN & REVERT statements I show here for testing

-- Execute as the data owner

-

EXECUTE AS LOGIN = 'data_owner'

go

-- will succeed

EXEC data_owner.sp_GetMyData01

go

-- will succeed as the module is executing as "data_owner"

-- (the module is specifying the context itself), and the

-- signature is vouching for this context

EXEC data_owner.sp_GetMyData02

go

REVERT

go

-

-- Execute as someuser

-

EXECUTE AS LOGIN = 'someuser'

go

-- will succed as the certificate will be granting the required
-- permission to select the data from the table

-- Note that someuser is a valid context accross the server at
-- this point

EXEC data_owner.sp_GetMyData01

-- will succeed as the module is executing as "data_owner"

-- (the module is specifying the context itself), and the

-- signature is vouching for this context

EXEC data_owner.sp_GetMyData02

go

REVERT

go

-

-- cleanup

USE master

go

DROP DATABASE db_Source

go

DROP DATABASE db_Target

go

DROP LOGIN dbo_db_Source

DROP LOGIN dbo_db_Target

DROP LOGIN data_owner

DROP LOGIN someuser

go

|||

Raul -- thanks a lot for taking the time to do this. Excellent explanation and demo!

Controlling Sa

hii
is it possible to control the sa login , so that he cannot view a specific table. is it possible
regds
ramsa has access to everything. why do you wish to prevent the sa from having access to a table?

Controlling Reporting Services Export

Hello,
I have a CSV export that needs some fields qualified by double quotes and
some that do not. How do I control this behavior in Reporting Services?
I have tried specifying a blank text qualifier in rsreportserver.config and
surrounding the applicable fields by double quotes but that doesn't work as
the double quote qualifier gets repeated.
TIA,
Ray
SS2K5On Jan 7, 4:06 pm, raybouk <rayb...@.discussions.microsoft.com> wrote:
> Hello,
> I have a CSV export that needs some fields qualified by double quotes and
> some that do not. How do I control this behavior in Reporting Services?
> I have tried specifying a blank text qualifier in rsreportserver.config and
> surrounding the applicable fields by double quotes but that doesn't work as
> the double quote qualifier gets repeated.
> TIA,
> Ray
> SS2K5
The quickest way to accommodate this is to use casting in SSRS (i.e.,
CStr(Fields!SomeFieldName.Value)). You would cast the fields that you
need to have quotes around. Also, you could use the format part of the
Properties tab for the fields you need to have the quotes around. An
expression similar to this might work: ="''#''" Another alternative
(more reliable, though more work) would be to use a StreamReader and
StreamWriter after the fact (after exporting the report to a given
format) to read in the report file into a string or stringbuilder,
then use String.Replace() (or String.Format()) and then output the
file with the quote identifiers for certain fields. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant

Controlling number of rows to display in a table and matrix on one page

Is there a way to control how many Detail Rows are displayed on one page in Table and Matrix controls?

hii

do you mean to say if there are 100 rows and you want only 10 rows to be shown in one page right without any change in the formatting?

i think the rough way is that you can increase the hight of the detail section but it will change the formatting of the page.still am trying with the issue .

Thanks

Mahasweta

controlling merge syncronisation at subscriber with ActiveX

Hi,
If I am to use the merge activex control to run syncs at the subscriber, in
what system tables will I find merge history, error messages etc ?
I read in another thread about querying the subscriber prior to attempting a
sync to determine if the subscriber db needed reinitialisation (by comparing
version number values in a user table) - so that active x could flag the
subscription for reinitialisation automatically. Any idea how this would
actually be done ?
It would be great to have the sunscriber db be automatically flagged for
reinitialisation when needed, and not require user input.
Thanks for your help
Darren
query the msmerge_history table in the distribution database on the
subscriber if its a pull.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Darren Wallace" <darren@.pcresources.com.au> wrote in message
news:e5pPdbNlEHA.3392@.TK2MSFTNGP14.phx.gbl...
> Hi,
> If I am to use the merge activex control to run syncs at the subscriber,
in
> what system tables will I find merge history, error messages etc ?
> I read in another thread about querying the subscriber prior to attempting
a
> sync to determine if the subscriber db needed reinitialisation (by
comparing
> version number values in a user table) - so that active x could flag the
> subscription for reinitialisation automatically. Any idea how this would
> actually be done ?
> It would be great to have the sunscriber db be automatically flagged for
> reinitialisation when needed, and not require user input.
> Thanks for your help
> Darren
>

Sunday, March 11, 2012

controlling database access

Hi All
I have a scenario where I have several processes (web-farm) that try to
process data in a certain table. I'd like to control access such that only 1
row from the table can be processed at a time regardless of how many
external processes try to access it. I guess I need to lock access so the
right sort of lock is required. Is it possible to lock a row/table based on
a read or does it have to be written to?
Currently using Serializable but it seems overkill.
Also is there a good recommendation for SQL server book that relates to
common SQL server tasks problems/solutions - A sort of patterns book?
Thanks
ShaunShaun Wilde wrote:
> Hi All
> I have a scenario where I have several processes (web-farm) that try
> to process data in a certain table. I'd like to control access such
> that only 1 row from the table can be processed at a time regardless
> of how many external processes try to access it. I guess I need to
> lock access so the right sort of lock is required. Is it possible to
> lock a row/table based on a read or does it have to be written to?
> Currently using Serializable but it seems overkill.
> Also is there a good recommendation for SQL server book that relates
> to common SQL server tasks problems/solutions - A sort of patterns
> book?
> Thanks
> Shaun
You could use an Application Lock. See sp_getapplock and
sp_releaseapplock in BOL.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Did you mean to say only one row to be processed at a time OR a row can be
processed by one and only one process?
Regarding books, this might interest you:
SQL Server 2000 Fast Answers for DBAs and Developers:
http://vyaskn.tripod.com/sql_server...ast_answers.htm
--
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Shaun Wilde" <shaun_wilde@.nospam.nospam> wrote in message
news:OFGDayhZFHA.3152@.TK2MSFTNGP14.phx.gbl...
> Hi All
> I have a scenario where I have several processes (web-farm) that try to
> process data in a certain table. I'd like to control access such that only
1
> row from the table can be processed at a time regardless of how many
> external processes try to access it. I guess I need to lock access so the
> right sort of lock is required. Is it possible to lock a row/table based
on
> a read or does it have to be written to?
> Currently using Serializable but it seems overkill.
> Also is there a good recommendation for SQL server book that relates to
> common SQL server tasks problems/solutions - A sort of patterns book?
> Thanks
> Shaun
>|||Hi Vyas
I mean that only one row can be processed at a time by only one process.
Process A - works on row 1
Process B - works on row 2
Process C sees there is nothing to do and waits (polling)
Shaun
"Narayana Vyas Kondreddi" <answer_me@.hotmail.com> wrote in message
news:u$#Y64hZFHA.3280@.TK2MSFTNGP09.phx.gbl...
> Did you mean to say only one row to be processed at a time OR a row can be
> processed by one and only one process?
> Regarding books, this might interest you:
> SQL Server 2000 Fast Answers for DBAs and Developers:
> http://vyaskn.tripod.com/sql_server...ast_answers.htm
> --
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "Shaun Wilde" <shaun_wilde@.nospam.nospam> wrote in message
> news:OFGDayhZFHA.3152@.TK2MSFTNGP14.phx.gbl...
only
> 1
the
> on
>|||Hi Shaun,
It seems you want the row be modified / updated only by one process while
other is not able to do anything? I am afraid we do not have exactly same
funcation as you needed.
You may check the topic "Isolation Levels" in BOL for more reference,
different isolation level will provide different data access privilege.
However you will have to customize your project manually. For example
1. Add a new column named IsAccess and defaultly set to zero
2. When one process want to use the row, it will have to use a transaction
to update IsAccess column
3. If the column is updated to 1, which means some process is working on
this row and others will have to wait.
Something like realize a lock system yourself, but more complex. You may
refer lock mechanism in operating systems.
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

Controlling Crystal Reports 9.0 Grids with VB

Hello,
I'm new to Crystal reports and am finishing up my first vb app. I need to be able to control the "Draw Custom Line" property of the Crystal Reports grid within VB 6.0. Does anyone know the Grid property I use in VB to control this?
Thanks so much!
Tricia =)aha! After a full day of searching for the answer, I think I found a comparable solution to this problem. =)

Solution: Split Dual Axis Grid
- Bottom axis range from x to alert level
- Upper axis range from alert level to x

Pros:
- The alert level line can be placed on the grid and it can be a variable amount calculated in VB so that we can normalize the data appropriately.

Cons:
- the grid must have 2 data points in order to have the split axis option available. The problem with this is that we need to show the marker for each point in the event of a first time sampling and only one level to show on the grid. I am using the alert level for the second data point and so the markers are showing only the alert level line, but it still looks a bit funky, but at least I have the line!!!

Controling language of returned schedule description

Hi!
When I GetScheduleProperties, I would like to control the language of the
returned schedule description. Any thoughts on how I might accomplish this?
The language of this schedule description changes when I use Report
Manager, so there must be a way to accomplish this.
Thanks in advance for any enlightenment,
BobHi Bob
Did you get anywhere on this one ?
Anybody else manaded to do it ?
"bobhug" wrote:
> Hi!
> When I GetScheduleProperties, I would like to control the language of the
> returned schedule description. Any thoughts on how I might accomplish this?
> The language of this schedule description changes when I use Report
> Manager, so there must be a way to accomplish this.
> Thanks in advance for any enlightenment,
> Bob
>

Control/Limit Memory usage

Hello,

I was wondering if there was a setting or a way to limit or restrict the amount of Memory an SSIS package can use? I know that by default the windows OS limits a process (a package in this case) to 2GB and up to 3GB with AWE enable but what if I wanted to say Limit it to 1GB of memory is there anyway to do that? Is there an SSIS Engine setting or Package property somewhere?

Thanks!

See if this helps you. Check out the Buffer size section in this paper:
http://www.microsoft.com/technet/prodtechnol/sql/2005/ssisperf.mspx

control yank in 2005 Query Designer

How can I assign ctrl+y to remove the line the cursor is on when designing a query in management studio like it was defaulted on in 2000? Muchos gracias.I hate sql 2005 it can suck a duck for all i give a damn please let there be a way to restore my databases back to 2000 how do ctrl+f4 for search this is worse than switching from mssql to oracle on unix why is no backward compatability maintained did apple by these perverts out or something? peace out my ninjas you have been a great lot of help may you eternally be blessed with your just rewards

control where the backup.dat goes

Hey everyone

I have a question for you, I am creating a database as part of the application that I am currently working one. When I create the database the .mdf and .log files go to the Sql directory however the .backup.dat file goes in my application folder. Is there anyway to disable this or have those files be elsewhere programatically.

Thanks

Kenzie

Using the BACKUP statement, you may specifically direct a backup file location.

See Books Online, Topic: BACKUP

You would issue a command similar to this:

BACKUP DATABASE MyDatabase TO DISK = 'D:\MyDataBackups\MyDatabase.bak'

Control w/hidden=true displays as white space

We have a section of a report that should only be displayed if we have data
for it. We have tried putting all of the controls in a rectangle, and then
setting the visibility based on the record count. If we have zero (0) rows,
the controls are hidden, but white space is now displayed equal to the
height of the rectangle that is hidden.
We have tried moving these controls to a sub-report and we exerience the
same thing. However much vertical space the sub-report control consumes at
design time is replaced with whitespace when we hide the report. While this
is a bit better since the height of the sub-report control can be much
smaller than the report itself, it is still frustrating.
Example:
Rec A
Rec B
Rec C
When we hide Rec B, we see:
Rec A
Rec C
What we want is:
Rec A
Rec C
It seems when we hide textboxes, they do not consume any vertical space.
1) How can we also remove the white space when hiding a rectangle or
sub-report?
2) Out of curiosity, what is the rational behind this behavior? Why would
one hide a control and not want subsequent controls "moved up" to take the
hidden controls place.
SQL Server 2000 SP4
MS Reporting Services 1.0 SP2
Visual Studio.NET 2003
Thanks,
Chris?
"Chris Walls" <chwalls@.community.nospam> wrote in message
news:e2jC%23$nMGHA.3648@.TK2MSFTNGP10.phx.gbl...
> We have a section of a report that should only be displayed if we have
> data for it. We have tried putting all of the controls in a rectangle,
> and then setting the visibility based on the record count. If we have
> zero (0) rows, the controls are hidden, but white space is now displayed
> equal to the height of the rectangle that is hidden.
> We have tried moving these controls to a sub-report and we exerience the
> same thing. However much vertical space the sub-report control consumes
> at design time is replaced with whitespace when we hide the report. While
> this is a bit better since the height of the sub-report control can be
> much smaller than the report itself, it is still frustrating.
> Example:
> Rec A
> Rec B
> Rec C
> When we hide Rec B, we see:
> Rec A
> Rec C
> What we want is:
> Rec A
> Rec C
> It seems when we hide textboxes, they do not consume any vertical space.
> 1) How can we also remove the white space when hiding a rectangle or
> sub-report?
> 2) Out of curiosity, what is the rational behind this behavior? Why would
> one hide a control and not want subsequent controls "moved up" to take the
> hidden controls place.
> SQL Server 2000 SP4
> MS Reporting Services 1.0 SP2
> Visual Studio.NET 2003
>
> Thanks,
> Chris
>|||Have you tried using a table instead of independent text boxes to
display your results? If you hide the entire row (not just a single
cell) then the row below moves up.|||Hi Chris (I'm sorry to bother you but I think you could help me)
The reason I'm sending you this email is that I did find a question (see
below) which you did post in this newsgroup for almost a year ago which
indicates that you already have went through the same problem situation as
I'm right now.
May I ask which product you are using when you are merging your PDF
documents into one single document? Are you happy with your choice?
Many thanks and best regards
/Anders
To get around a MS Reporting Service limitation, instead of using
sub-reports, we may have to create individual reports in PDF format and then
merge them into a single PDF report. We have found tools that can merge PDF
files, but this presents us with another issue: page numbers. We want the
resulting merged PDF files to have continous page numbers. Is there a way
to tell MS Reporting Services to start with a specific page number when
rendering a report. Can we some how do this with a report parameter?
"Chris Walls" <chwalls@.community.nospam> wrote in message
news:e2jC%23$nMGHA.3648@.TK2MSFTNGP10.phx.gbl...
> We have a section of a report that should only be displayed if we have
> data for it. We have tried putting all of the controls in a rectangle,
> and then setting the visibility based on the record count. If we have
> zero (0) rows, the controls are hidden, but white space is now displayed
> equal to the height of the rectangle that is hidden.
> We have tried moving these controls to a sub-report and we exerience the
> same thing. However much vertical space the sub-report control consumes
> at design time is replaced with whitespace when we hide the report. While
> this is a bit better since the height of the sub-report control can be
> much smaller than the report itself, it is still frustrating.
> Example:
> Rec A
> Rec B
> Rec C
> When we hide Rec B, we see:
> Rec A
> Rec C
> What we want is:
> Rec A
> Rec C
> It seems when we hide textboxes, they do not consume any vertical space.
> 1) How can we also remove the white space when hiding a rectangle or
> sub-report?
> 2) Out of curiosity, what is the rational behind this behavior? Why would
> one hide a control and not want subsequent controls "moved up" to take the
> hidden controls place.
> SQL Server 2000 SP4
> MS Reporting Services 1.0 SP2
> Visual Studio.NET 2003
>
> Thanks,
> Chris
>