显示标签为“disallow”的博文。显示所有博文
显示标签为“disallow”的博文。显示所有博文

2012年3月7日星期三

Disallow connection for a second or two

Hi
Is it possible to prevent users of a database in SQL Server 2005 from
doing anything for a second or two.
Can this be done using a stored procedure.
thanks
Newish
You can put the database into readonly mode. In the proc do a
ALTER DATABASE AdventureWorks SET READ_ONLY
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Newish" <ahussain3@.gmail.com> wrote in message
news:1160218524.169852.196200@.i3g2000cwc.googlegro ups.com...
> Hi
> Is it possible to prevent users of a database in SQL Server 2005 from
> doing anything for a second or two.
> Can this be done using a stored procedure.
> thanks
> Newish
>
|||Thanks Hilary.
Would this scenario work. Use a stored procedure to issue this
command. Then the same procedure writes a couple of pieces of info to
a table and then revoke this statement.
Hence, during the readonly state will the stored procedure be able to
write.
How do you revert back to read and write status.
thanks once again.
Newish
Hilary Cotter wrote:[vbcol=seagreen]
> You can put the database into readonly mode. In the proc do a
> ALTER DATABASE AdventureWorks SET READ_ONLY
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Newish" <ahussain3@.gmail.com> wrote in message
> news:1160218524.169852.196200@.i3g2000cwc.googlegro ups.com...

Disallow connection for a second or two

Hi
Is it possible to prevent users of a database in SQL Server 2005 from
doing anything for a second or two.
Can this be done using a stored procedure.
thanks
NewishYou can put the database into readonly mode. In the proc do a
ALTER DATABASE AdventureWorks SET READ_ONLY
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Newish" <ahussain3@.gmail.com> wrote in message
news:1160218524.169852.196200@.i3g2000cwc.googlegroups.com...
> Hi
> Is it possible to prevent users of a database in SQL Server 2005 from
> doing anything for a second or two.
> Can this be done using a stored procedure.
> thanks
> Newish
>|||Thanks Hilary.
Would this scenario work. Use a stored procedure to issue this
command. Then the same procedure writes a couple of pieces of info to
a table and then revoke this statement.
Hence, during the readonly state will the stored procedure be able to
write.
How do you revert back to read and write status.
thanks once again.
Newish
Hilary Cotter wrote:
> You can put the database into readonly mode. In the proc do a
> ALTER DATABASE AdventureWorks SET READ_ONLY
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Newish" <ahussain3@.gmail.com> wrote in message
> news:1160218524.169852.196200@.i3g2000cwc.googlegroups.com...
> > Hi
> >
> > Is it possible to prevent users of a database in SQL Server 2005 from
> > doing anything for a second or two.
> >
> > Can this be done using a stored procedure.
> >
> > thanks
> >
> > Newish
> >

Disallow connection for a second or two

Hi
Is it possible to prevent users of a database in SQL Server 2005 from
doing anything for a second or two.
Can this be done using a stored procedure.
thanks
NewishYou can put the database into readonly mode. In the proc do a
ALTER DATABASE AdventureWorks SET READ_ONLY
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Newish" <ahussain3@.gmail.com> wrote in message
news:1160218524.169852.196200@.i3g2000cwc.googlegroups.com...
> Hi
> Is it possible to prevent users of a database in SQL Server 2005 from
> doing anything for a second or two.
> Can this be done using a stored procedure.
> thanks
> Newish
>|||Thanks Hilary.
Would this scenario work. Use a stored procedure to issue this
command. Then the same procedure writes a couple of pieces of info to
a table and then revoke this statement.
Hence, during the readonly state will the stored procedure be able to
write.
How do you revert back to read and write status.
thanks once again.
Newish
Hilary Cotter wrote:[vbcol=seagreen]
> You can put the database into readonly mode. In the proc do a
> ALTER DATABASE AdventureWorks SET READ_ONLY
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Newish" <ahussain3@.gmail.com> wrote in message
> news:1160218524.169852.196200@.i3g2000cwc.googlegroups.com...

Disallow administrator access

Can anyone tell me how I can stop a domain administrator from accessing
SQL Server 2000 on Windows 2003 Server.
ToddRemove the builtin\Administrators from the Security - login in SQL server.
Regards
Jonas
"Todd Hazer" <NO_SPAMthazer@.gmail.com> wrote in message
news:%231Tl8k6uEHA.2876@.TK2MSFTNGP12.phx.gbl...
> Can anyone tell me how I can stop a domain administrator from accessing
> SQL Server 2000 on Windows 2003 Server.
> Todd|||Will setting the builtin\Administrators security access to 'Deny' work?
thanks for the reply.
Todd
Jonas Larsen wrote:
> Remove the builtin\Administrators from the Security - login in SQL server.
> Regards
> Jonas
> "Todd Hazer" <NO_SPAMthazer@.gmail.com> wrote in message
> news:%231Tl8k6uEHA.2876@.TK2MSFTNGP12.phx.gbl...
>
>
>|||I have added my domain user account to the security logins and set
myself up as a system administrator. My domain user account is in the
domain Administrators group and in the Domain Admins group.
I just set the SQL Server builtin\Administrators security access setting
to "Deny" and it stopped me from connecting as well. How can I disallow
one administrator without denying myself?
Todd
Jonas Larsen wrote:
> Remove the builtin\Administrators from the Security - login in SQL server.
> Regards
> Jonas
> "Todd Hazer" <NO_SPAMthazer@.gmail.com> wrote in message
> news:%231Tl8k6uEHA.2876@.TK2MSFTNGP12.phx.gbl...
>
>
>|||Remove the builtin\Administrators from the SQL Server instead of deny. And
the add you own domain account as system admin in SQL.
Jonas
"Todd Hazer" <NO_SPAMthazer@.gmail.com> wrote in message
news:%23JM86O7uEHA.3276@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
> I have added my domain user account to the security logins and set
> myself up as a system administrator. My domain user account is in the
> domain Administrators group and in the Domain Admins group.
> I just set the SQL Server builtin\Administrators security access setting
> to "Deny" and it stopped me from connecting as well. How can I disallow
> one administrator without denying myself?
> Todd
> Jonas Larsen wrote:
server.[vbcol=seagreen]|||You can remove the builtin\administrators group from SQL
Server but that can sometimes introduce other problems.
Whether you get problems or not depends. The following
article has more information on removing the
builtin\administrators group as well as a section with links
to some issues that could come up:
INF: How to impede Windows NT administrators from
administering a clustered instance of SQL Server
http://support.microsoft.com/?id=263712
-Sue
On Tue, 26 Oct 2004 15:18:08 -0700, Todd Hazer
<NO_SPAMthazer@.gmail.com> wrote:

>Can anyone tell me how I can stop a domain administrator from accessing
>SQL Server 2000 on Windows 2003 Server.
>Todd

2012年2月19日星期日

Disable temporary table creation

Dear,
Is there a way to disallow a user to create a temporary table?
Thanks,
PeterYou could set explicit access-denied permissions for that user on tempdb,
but in so doing you would break numerous system stored procedures, ADO
functions, and a large number of applications and tools out there, for that
user.
-Mark
<pgp.coppens@.pandora.be> wrote in message
news:1115628367.375613.173760@.g14g2000cwa.googlegroups.com...
> Dear,
> Is there a way to disallow a user to create a temporary table?
> Thanks,
> Peter
>|||pgp.coppens,
Why would you want to do that? Could you describe your situation further?
Perhaps you should disallow all direct access to SQL Server tables and only
allow access to data through stored procedures and/or views.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
"pgp.coppens@.pandora.be" wrote:

> Dear,
> Is there a way to disallow a user to create a temporary table?
> Thanks,
> Peter
>|||Mark Allison schreef:
> pgp.coppens,
> Why would you want to do that? Could you describe your situation
further?
> Perhaps you should disallow all direct access to SQL Server tables
and only[vbcol=seagreen]
> allow access to data through stored procedures and/or views.
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602m.html
>
>
> "pgp.coppens@.pandora.be" wrote:
>
Actually I am trying to create an apparently very artificial
environment so that I can document the error messages a user might get
when his server does not allow him to create temporary tables and the
application (I am trying to document) attempts it.
But from the looks of the reactions not many SQLServer servers will be
configured in such a way I guess, so it might not be worth the effort.
Thanks for all your reactions.
Peter

2012年2月17日星期五

disable implicit casting

Is there a way do disable/disallow implicit casting in Sql Server 2000?

Say for example:

if ' ' = 0 select getdate()

This wil print out the current date and time.

But ' ' (a string, varchar, whatever) is not the same type as 0 (say, int). Implicit casting is nice, but is there also an off switch?

I've looked at the book Itzik Ben-Gan (T-SQL Programming). On the paragraph about implicit conversion he doesn't cite any way to switch it off. He also suggests that in some case may be useful to explicit cast data to sql_variant and reports the following example, that maybe can suggest a workaround:

select
case
when 1>1 then 10
when 1=1 then 'abc'

when 1<1 then 10
end;

select

case

when 1>1 then cast(10 as sql_variant)

when 1=1 then cast('abc' as sql_variant)

when 1<1 then cast(10 as sql_variant)

end;

MS help says also that "Implicit conversions are not visible to the user", so I guess there's no way to disable it.

Take a look also at the following docs:
http://msdn2.microsoft.com/en-us/library/ms191530.aspx
http://msdn2.microsoft.com/en-us/library/ms190309.aspx|||

Thanks.

It's really weird. I would have suspected an feature like 'option strict' like there is in VB (and for a good reason). It's a shame it's not there in T-SQL.