Showing posts with label object. Show all posts
Showing posts with label object. Show all posts

Thursday, March 29, 2012

EnumObjectPermissions on a ApplicationRole and DatabaseRole objects returns o entries

HI,

Call to EnumObjectPermissions method on a SMO ApplicationRole or DatabseRole object returns an empty collection, however, a call to EnumDatabaseRoleMember on a DatabaseRole object using DMO returns the correct list of membership. Please clarify.

Regards,

Joginder

Hmm I had the same problem with SMO, but I did not try DMO.

I found a workaround. Use the similar method at the Database level, and supply the role name as a string.

using Microsoft.SqlServer.Management.Smo;

using Microsoft.SqlServer.Management.Common;

Database dbHold = smoServer.Databases["YourDB"];

String holdString;

foreach( DatabaseRole dr in dbHold.Roles)

{

ObjectPermissionInfo[] ra = dr.EnumObjectPermissions(); // mysteriously returns null!!

foreach (ObjectPermissionInfo opi in dbHold.EnumObjectPermissions(dr.Name))

{

holdString = String.Format("-OPIRole:{0} has {1}{2}{3}", dr.Name, opi.Grantor, opi.Grantee, opi.ObjectName);

}

}

}

Regards,

Chip

EnumObjectPermissions on a ApplicationRole and DatabaseRole objects returns o entries

HI,

Call to EnumObjectPermissions method on a SMO ApplicationRole or DatabseRole object returns an empty collection, however, a call to EnumDatabaseRoleMember on a DatabaseRole object using DMO returns the correct list of membership. Please clarify.

Regards,

Joginder

Hmm I had the same problem with SMO, but I did not try DMO.

I found a workaround. Use the similar method at the Database level, and supply the role name as a string.

using Microsoft.SqlServer.Management.Smo;

using Microsoft.SqlServer.Management.Common;

Database dbHold = smoServer.Databases["YourDB"];

String holdString;

foreach( DatabaseRole dr in dbHold.Roles)

{

ObjectPermissionInfo[] ra = dr.EnumObjectPermissions(); // mysteriously returns null!!

foreach (ObjectPermissionInfo opi in dbHold.EnumObjectPermissions(dr.Name))

{

holdString = String.Format("-OPIRole:{0} has {1}{2}{3}", dr.Name, opi.Grantor, opi.Grantee, opi.ObjectName);

}

}

}

Regards,

Chip

EnumErrorlogs using SQLDMO

I am wanting to use the EnumErrorlogs method of the SQLServer object to
identify which of the error logs have been written to in a specified period.
I also need to be able to deploy this to any of our SQL Servers which could
all be running with different locales.
The Date column in the QueryResults output shows this but not in the date
format that I expected. My server is set to English(Australian), my default
language for my login in SQL Server is British English ... i.e. everything is
configured to return dates in the D/M/Y format. However, the date string
returned from EnumErrorlogs is in a M/D/Y format which then messes up the
remainder of my processing.
Is the result ALWAYS returned in M/D/Y ? If so then I could at least code
for that, but if it is possible for it to be in the D/M/Y format then I need
to know where this is set so that I can test for it before continuing to
process the logs.
Can anyone direct me to information about this?
I was hoping it was something to do with the current holder of the ashes (ie
you could have waited about a year for it to fix itself),
but I'm seeing the same here in the UK on totally UK Server. The description
is a bit vague in BOL , going to try a few things.
cheers,
Andy.
"MartinC" <MartinC@.discussions.microsoft.com> wrote in message
news:79DF19A6-89D7-4464-92BF-EC7F6E6B78BB@.microsoft.com...
>I am wanting to use the EnumErrorlogs method of the SQLServer object to
> identify which of the error logs have been written to in a specified
> period.
> I also need to be able to deploy this to any of our SQL Servers which
> could
> all be running with different locales.
> The Date column in the QueryResults output shows this but not in the date
> format that I expected. My server is set to English(Australian), my
> default
> language for my login in SQL Server is British English ... i.e. everything
> is
> configured to return dates in the D/M/Y format. However, the date
> string
> returned from EnumErrorlogs is in a M/D/Y format which then messes up the
> remainder of my processing.
> Is the result ALWAYS returned in M/D/Y ? If so then I could at least
> code
> for that, but if it is possible for it to be in the D/M/Y format then I
> need
> to know where this is set so that I can test for it before continuing to
> process the logs.
> Can anyone direct me to information about this?
|||tried
- Service Account as interactive user with Brit English / UK locale
- changing / reapplying default to UK DD/MM/YY and reboot
giving up, attached is a noddy func to fix
bloody septics :-)
cheers,
Andy.
"Andy Ball" <ng@.spamno77greenfell.com> wrote in message
news:ua3F10v%23FHA.1028@.TK2MSFTNGP11.phx.gbl...
>I was hoping it was something to do with the current holder of the ashes
>(ie
> you could have waited about a year for it to fix itself),
> but I'm seeing the same here in the UK on totally UK Server. The
> description
> is a bit vague in BOL , going to try a few things.
> cheers,
> Andy.
>
> "MartinC" <MartinC@.discussions.microsoft.com> wrote in message
> news:79DF19A6-89D7-4464-92BF-EC7F6E6B78BB@.microsoft.com...
>
begin 666 ConvertErrorlogDate.txt
M( T*)R!A<R!E<G)O<FQO9R!I;B!M+V0O>2!F;W)M870@.:6X@.16YU ;45R<F]R
M3&]G<PT*1G5N8W1I;VX@.0V]N=F5R=$5R<F]R3&]G1&%T92A%<G)O<DQO9T1A
M=&4I#0H)0V]N=F5R=$5R<F]R3&]G1&%T92 ](&-3='(H36ED*$5R<F]R3&]G
M1&%T92PT+#(I("L@.(B\B("L@.;6ED*$5R<F]R3&]G1&%T92P@.,2PR*2 K("(O
J(B K(&UI9"A%<G)O<DQO9T1A=&4L(#<L,C I*0T*16YD($9U;F-T:6]N
`
end

Friday, February 24, 2012

Enterprise Manager Collision

Is there a setting for enterprise manager, to prevent two instances
from having the same stored procedure or any other object open and
overwritting one another?Hi

No. As you could submit code through ISQL, OSQL, Query Analyzer, Enterprise
Manager, ADO etc.

Team co-ordination is required, usually only 1 person is allowed to make
changes to the development server after the other developers submit their
code to him.

Regards
----------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: mike@.epprecht.net

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/

<jw56578@.gmail.com> wrote in message
news:1114556996.995967.159010@.z14g2000cwz.googlegr oups.com...
> Is there a setting for enterprise manager, to prevent two instances
> from having the same stored procedure or any other object open and
> overwritting one another?|||What you are hinting at is an underlying problem that every development
shop faces when more than one person needs to modify the same schema at
the same time.

I would ask the question "How do you manage changes for the non SQL
code in the system?" the answer to which *should* be the same in any
development team - "we use the source control system". Using source
control is obvious for C++, Java, HTML etc. but not for SQL code as it
has some unique requirements, not least of which being that you cannot
simply drop and replace a target database with a brand new one that has
no data in it!

What you need is to be able to simply modify the schema creation
scripts under source control to regulate multiple developers modifying
the same schema. This, for example, is the way you would work if you
were developing a brand new database that doesn't exist in production
yet. To release the latest version of the database you simply build a
brand new one from the create scripts and deliver that.

But what if you already have a production database? You can't just
throw it away, you need to carefully modify it to bring it up to the
new schema level.

This is where a tool called DB Ghost (www.dbghost.com) comes in. It
will build a brand new database from the scripts in source control,
which verifies that no syntax or dependency problems exist. It then
uses that database as the source for a compare and upgrade of an
existing database i.e. production. This keeps all data in place and
means that you will have a target schema that absolutely matches a
defined, labelled set of create scripts under source control.

This is called the "DB Ghost Process" and it is simply the best change
management solution I have ever seen as it is the only tool that works
with source code.

The more people use the product, the more they love it as it makes so
much sense.|||No. Use a source control system such as Microsoft Source Safe for that.

--
David Portas
SQL Server MVP
--

Wednesday, February 15, 2012

Enterprise class not registered 6.5

Today morning i tried connecting to sql 6.5 through enterprise edition got the following error
SQL ole object could not be registered class not registered (80040154)
I did shut down and restart, stopped and restarted the servicesAs obvious this is a problem with the class or the associated OLE dll not being registered in the registry properly . You can use the regsvr32 utility to re-register it :-

regsvr32 (path)\binn\sqlole65.dll

And replace (path) with the full drive/directory that SQL Server is installed into.|||Thanks works very good

One more question

How best to display data on web without knowing any language|||I think its not possible to work if you don't know any language ( in terms of IT). Can you rephrase your question agian.|||I just know sql and html the basic

any one language i can use to represent data on web and easy too learn

like combination or reporting tools ( crystal report) and something else too|||Then no issues in representing the data on a web page.
ASP with SQL is best combination I've seen so far (as I'm concerned).

Refer to MSDN & Technet for SQL for further information.|||Representing data using sql and asp is enough

I mean will it allow the user to choose say dates if i represent it on a drop down menu ( can asp do it i mean)

In short will i be able to represents most of the data using ASP (JUST)

OFCOURSE BESIDE SQL IN PROCEDURE OR FUNCTION