Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Monday, March 26, 2012

Rights assigned to Windows\Power Users in SQL Express.

Hi,

In SQL Server Express Edition, what are the rights that are assigned to a Normal Windows User and PowerUser by default ?

When I install SQL Express on a clean machine and login as Power User I can add/edit/delete data but when I login as Normal Windows User I can see the data but not change it.

Please help me in this regard.

Thanks and Regards,
Gautham.

What do you mean exactly by the ability to add/edit/delete data; what kind of data is that?

In SQL Server Express, members of Builtin\Administrators are members of the sysadmin server role. Members of Builtin\Users are only granted the connect sql permission. There is no special provisioning for Builtin\Power Users, so they would just have the same right on SQL Server Express as a "normal" user.

To verify if a principal has a special permission, you can use the has_perms_by_name builtin. For example, to check if a user has select on table t, you can execute:

select has_perms_by_name ('t', 'object', 'select')

while connected as that user.

For additional information, you can check the following catalogs:

sys.server_principals
sys.server_permissions
sys.login_token
sys.database_principals
sys.database_permissions
sys.user_token

Thanks
Laurentiusql

Friday, March 23, 2012

Right Alignment in SQL

Hi all,
By default all the values in the result set are left aligned. But
I want to align a column in a result set of a query to right side...
Is it possible in SQL?
Example:
Charges
11145.00
171.00
26.00
6.00
Result should be
Charges
11145.00
171.00
26.00
6.00
Please advise
Thanks,
Souraselect str(charges,10,2) from tb
-oj
"SouRa" <SouRa@.discussions.microsoft.com> wrote in message
news:AFB802C8-4C26-43CA-A1A4-3F9AF28EF8EB@.microsoft.com...
> Hi all,
> By default all the values in the result set are left aligned. But
> I want to align a column in a result set of a query to right side...
> Is it possible in SQL?
> Example:
> Charges
> 11145.00
> 171.00
> 26.00
> 6.00
> Result should be
> Charges
> 11145.00
> 171.00
> 26.00
> 6.00
> Please advise
> Thanks,
> Soura|||Hi
This is really dependent on the client tool, for example SQL Server
Management studio has an option to right align numeric values in the results
to text option settings.
John
"SouRa" wrote:

> Hi all,
> By default all the values in the result set are left aligned. But
> I want to align a column in a result set of a query to right side...
> Is it possible in SQL?
> Example:
> Charges
> 11145.00
> 171.00
> 26.00
> 6.00
> Result should be
> Charges
> 11145.00
> 171.00
> 26.00
> 6.00
> Please advise
> Thanks,
> Soura

Right Alignment in SQL

Hi all,
By default all the values in the result set are left aligned. But
I want to align a column in a result set of a query to right side...
Is it possible in SQL?
Example:
Charges
11145.00
171.00
26.00
6.00
Result should be
Charges
11145.00
171.00
26.00
6.00
Please advise
Thanks,
Souraselect str(charges,10,2) from tb
--
-oj
"SouRa" <SouRa@.discussions.microsoft.com> wrote in message
news:AFB802C8-4C26-43CA-A1A4-3F9AF28EF8EB@.microsoft.com...
> Hi all,
> By default all the values in the result set are left aligned. But
> I want to align a column in a result set of a query to right side...
> Is it possible in SQL?
> Example:
> Charges
> 11145.00
> 171.00
> 26.00
> 6.00
> Result should be
> Charges
> 11145.00
> 171.00
> 26.00
> 6.00
> Please advise
> Thanks,
> Soura|||Hi
This is really dependent on the client tool, for example SQL Server
Management studio has an option to right align numeric values in the results
to text option settings.
John
"SouRa" wrote:
> Hi all,
> By default all the values in the result set are left aligned. But
> I want to align a column in a result set of a query to right side...
> Is it possible in SQL?
> Example:
> Charges
> 11145.00
> 171.00
> 26.00
> 6.00
> Result should be
> Charges
> 11145.00
> 171.00
> 26.00
> 6.00
> Please advise
> Thanks,
> Soura|||how do i enter a new question?
i click new and nothing happens
--
thank you
ms. soto
"SouRa" wrote:
> Hi all,
> By default all the values in the result set are left aligned. But
> I want to align a column in a result set of a query to right side...
> Is it possible in SQL?
> Example:
> Charges
> 11145.00
> 171.00
> 26.00
> 6.00
> Result should be
> Charges
> 11145.00
> 171.00
> 26.00
> 6.00
> Please advise
> Thanks,
> Soura|||Hi
That will depend on how you are using the newsgroup, for instance if you are
using the technet communities
http://www.microsoft.com/technet/community/newsgroups/server/sql.mspx you
will need to create a profile and use a passport to sign in before adding new
messages or replying to existing messages. As you can reply then it looks
like you have this, in which case you would need to select the new button
which is just beneath the "search for:" area. If you are using Outlook
Express choose the New Post button or File/New/News Message from the menu.
HTH
John
"ms. soto" wrote:
> how do i enter a new question?
> i click new and nothing happens
> --
> thank you
> ms. soto
>
> "SouRa" wrote:
> > Hi all,
> >
> > By default all the values in the result set are left aligned. But
> > I want to align a column in a result set of a query to right side...
> > Is it possible in SQL?
> >
> > Example:
> >
> > Charges
> > 11145.00
> > 171.00
> > 26.00
> > 6.00
> >
> > Result should be
> >
> > Charges
> > 11145.00
> > 171.00
> > 26.00
> > 6.00
> >
> > Please advise
> >
> > Thanks,
> > Soura

Tuesday, March 20, 2012

Revoking All Permissions - Secure by Default

I am designing my software to be 'secure by default'.

I only grant permissions to entities that actually require them, to help prevent unexpected attacks like injection attacks. To do this, I have a SQL script that configures all the permissions on my database. It is basically a series of GRANT commands. Every time I modify a stored procedure or perform a similar action that causes the permissions on an object to be lost, I run the script and it reconfigures all the security correctly, on every object.

Over time, permissions have been granted that are not necessary, or no longer required. This may have happened for many reasons, development and testing not least.

At the top of my script, I want to REVOKE all permissions explicitly granted or denied to my user (for the purposes of this question, PUBLIC) so that I know that only permissions explicitly granted in the script will be given to the user.

There are too many objects in my database to maintain a list of "REVOKE ALL ON <object> TO PUBLIC" commands with any reliability. The statement "REVOKE ALL ON ALL TO PUBLIC" does not work either.

Is there a simple way to do this?

Maybe.|||

You can probably write a script to query the catalogs, find the permissions granted or denied to public, and issue a revoke statement for each of them. There isn't a simple statement to do this.

Another way would be to collect all the grants/denies made to public in your scripts and issue revokes for them.

Thanks
Laurentiu

|||

I almost expected that this would be the only answer. Thanks.

Scripts are acceptable, but not 'my style', if you get my meaning. I will probably write a stored procedure that I can call to do this for me - which will have to be deployed to each of my databases - unfortunately.

Thanks.