Showing posts with label block. Show all posts
Showing posts with label block. Show all posts

Sunday, March 11, 2012

Blocking updates of a table

Hi,
I've been trying to design a way for me to issue a transaction that:
    Block all inserts on a table when row X has a certain value (call it A)
    Add a row to the table with row X containing A Add rows to another table Unblock inserts Commit transaction
Is this possible? Can anyone give me some pointers as to what to do?
Thanks in advance!

For (1) and (2)
While inserting the row that has a certain value (A), you can request a TABLOCKX. This will acquire X lock on the table and there by block other inserts by other concurrent transactions.

For (3): Is it like any other insert to another table? In that case, nothing special needs to be done

Thanks
Sunil Agarwal

|||For 3 that is what I meant.
For 1 and 2, it sounds like TABLOCKX locks the whole table exclusively (from what I can find in Books Online) - have I read it correctly? Is there any way to block other transactions from inserting rows (while the first transaction is not yet commited) when a table key column (A in my original post) is a certain value (X in my original post) - rather than just locking the whole table?
Thanks for your help!
|||For 1 and 2, it sounds like TABLOCKX locks the whole table exclusively (from what I can find in Books Online) - have I read it correctly

sunil> yes

Is there any way to block other transactions from inserting rows (while the first transaction is not yet commited) when a table key column (A in my original post) is a certain value (X in my original post) - rather than just locking the whole table?

sunila> if you only want to block inserts by other transactions under the condition you have mentioned but allow updates/selects, then there is no way.
thanks,|||I assume you only want to block Inserts but not Updates, Deletes and SELECTS.

You could try using an Insert trigger that would rollback the other transactions until a condition has been achieved.

Blocking UDP Port 1434

In order to protect from 'slammer' kind of virus, we are
planning to block UDP Port 1434 on all gateways. Named
instances seem to rely on UDP Port 1434. Since TCP port
the sql instance is listening on can be re-assigned, Can
we reassign the UDP port 1434 as well? Any input will be
appreciated. Thank you!No. You can use client aliases to enable clients to resolve named instance
network endpoints
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Wayne" <anonymous@.discussions.microsoft.com> wrote in message
news:15ca401c41699$7b2a65c0$a301280a@.phx
.gbl...
> In order to protect from 'slammer' kind of virus, we are
> planning to block UDP Port 1434 on all gateways. Named
> instances seem to rely on UDP Port 1434. Since TCP port
> the sql instance is listening on can be re-assigned, Can
> we reassign the UDP port 1434 as well? Any input will be
> appreciated. Thank you!
>|||We are talking about thousands of clients and I am not
sure all applications support the use of aliases. Is there
an easy way out? Will the use of Proxy Server be a better
choice? Thanks for your input!

>--Original Message--
>No. You can use client aliases to enable clients to
resolve named instance
>network endpoints
>--
>HTH
>Jasper Smith (SQL Server MVP)
>I support PASS - the definitive, global
>community for SQL Server professionals -
>http://www.sqlpass.org
>
>"Wayne" <anonymous@.discussions.microsoft.com> wrote in
message
> news:15ca401c41699$7b2a65c0$a301280a@.phx
.gbl...
>
>.
>|||Not sure if this is of use to you. But still... You can configure SQL Server
to Listen on multiple ports. Refer to the KB article :
http://support.microsoft.com/defaul...kb;en-us;294453 for further
information.
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
"Wayne" <anonymous@.discussions.microsoft.com> wrote in message
news:15eb901c416ab$59b613a0$a501280a@.phx
.gbl...
> We are talking about thousands of clients and I am not
> sure all applications support the use of aliases. Is there
> an easy way out? Will the use of Proxy Server be a better
> choice? Thanks for your input!
>
> resolve named instance
> message

Blocking UDP Port 1434

In order to protect from 'slammer' kind of virus, we are
planning to block UDP Port 1434 on all gateways. Named
instances seem to rely on UDP Port 1434. Since TCP port
the sql instance is listening on can be re-assigned, Can
we reassign the UDP port 1434 as well? Any input will be
appreciated. Thank you!Don't know that you can change the SQL Server Resolution
Service running on UDP port 1434. However, you can still
connect without using the resolution service as long as the
client knows the port to go through. You don't have to HAVE
to go through UDP 1434 to connect to a named instance.
-Sue
On Tue, 30 Mar 2004 12:55:25 -0800, "Wayne"
<anonymous@.discussions.microsoft.com> wrote:

>In order to protect from 'slammer' kind of virus, we are
>planning to block UDP Port 1434 on all gateways. Named
>instances seem to rely on UDP Port 1434. Since TCP port
>the sql instance is listening on can be re-assigned, Can
>we reassign the UDP port 1434 as well? Any input will be
>appreciated. Thank you!|||Thank you, Sue, for the input. I thought for named
instances, tcp ports can be coded on server and clients,
but NOT UDP port 1434. The following is what I get from
BOL. If it can be done without using UDP port 1434, how
should I configure the client to go through gateways?
'Have the network administrator configure the firewall to
forward the IP address and TCP port the instance of SQL
Server is listening on (using either 1433 for a default
instance, or the TCP port you configured a named instance
to listen on). Also configure the firewall to forward
requests for UDP port 1434 on the same IP address. SQL
Server 2000 uses UDP port 1434 to establish communications
links from applications.'
--

>--Original Message--
>Don't know that you can change the SQL Server Resolution
>Service running on UDP port 1434. However, you can still
>connect without using the resolution service as long as
the
>client knows the port to go through. You don't have to
HAVE
>to go through UDP 1434 to connect to a named instance.
>-Sue
>On Tue, 30 Mar 2004 12:55:25 -0800, "Wayne"
><anonymous@.discussions.microsoft.com> wrote:
>
>.
>|||You can use the client network utility to set up an alias and specify the
port or you can specify it in a connection string
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
<anonymous@.discussions.microsoft.com> wrote in message
news:115da01c416a0$77cbcd40$a001280a@.phx
.gbl...
> Thank you, Sue, for the input. I thought for named
> instances, tcp ports can be coded on server and clients,
> but NOT UDP port 1434. The following is what I get from
> BOL. If it can be done without using UDP port 1434, how
> should I configure the client to go through gateways?
> --
> 'Have the network administrator configure the firewall to
> forward the IP address and TCP port the instance of SQL
> Server is listening on (using either 1433 for a default
> instance, or the TCP port you configured a named instance
> to listen on). Also configure the firewall to forward
> requests for UDP port 1434 on the same IP address. SQL
> Server 2000 uses UDP port 1434 to establish communications
> links from applications.'
> --
>
> the
> HAVE|||Like Jasper said...you can code the port in the connection
or use an alias
Just to add a little clarification for you,
UDP 1434 is used to find the port number for the instance.
It's not used by the SQL Server instance or directly by
clients to connect to SQL Server. It's just to enumerate the
instances on a server and find the listening port for the
specific instance.
If you try to connect to SomeServer\MyNamedInstance and
that's what you specify for the connection, it hits UDP 1434
to use the SQL Server Resolution Service to find what port
number SomeServer\MyNamedInstance is listening on. You can
bypass that by specifying the port yourself and then there
is no need to go through UDP 1434.
-Sue
On Tue, 30 Mar 2004 13:46:33 -0800,
<anonymous@.discussions.microsoft.com> wrote:
>Thank you, Sue, for the input. I thought for named
>instances, tcp ports can be coded on server and clients,
>but NOT UDP port 1434. The following is what I get from
>BOL. If it can be done without using UDP port 1434, how
>should I configure the client to go through gateways?
>--
>'Have the network administrator configure the firewall to
>forward the IP address and TCP port the instance of SQL
>Server is listening on (using either 1433 for a default
>instance, or the TCP port you configured a named instance
>to listen on). Also configure the firewall to forward
>requests for UDP port 1434 on the same IP address. SQL
>Server 2000 uses UDP port 1434 to establish communications
>links from applications.'
>--
>
>the
>HAVE|||THANK YOU for the clarification. I guess there is no easy
way out but to hardcode each client with a specific port
number if UDP 1434 is blocked. It would be nice if the
enumeration port UDP 1434 can be changed...

>--Original Message--
>Like Jasper said...you can code the port in the connection
>or use an alias
>Just to add a little clarification for you,
>UDP 1434 is used to find the port number for the instance.
>It's not used by the SQL Server instance or directly by
>clients to connect to SQL Server. It's just to enumerate
the
>instances on a server and find the listening port for the
>specific instance.
>If you try to connect to SomeServer\MyNamedInstance and
>that's what you specify for the connection, it hits UDP
1434
>to use the SQL Server Resolution Service to find what port
>number SomeServer\MyNamedInstance is listening on. You can
>bypass that by specifying the port yourself and then there
>is no need to go through UDP 1434.
>-Sue
>On Tue, 30 Mar 2004 13:46:33 -0800,
><anonymous@.discussions.microsoft.com> wrote:
>
to
instance
communications
are
port
Can
be
>.
>|||I have tow laptops and accessing the server as SomeServer\MyNamedInstance. O
ne laptop goes directly to port 1433, the other one goes to port 1434 first
and fails to connect. Where is this option which makes the second laptop go
to port 1434 first?
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine sup
ports Post Alerts, Ratings, and Searching.

Blocking Telnet command for SQL Server Detection 1433/1434

Any ideas how I can I block telnet connections to SQL Server ports ?

The only way is to turn of TCP/IP connections for SQL Server on the server.

HTH, jens SUessmeyer.

http://www.sqlserver2005.de

Blocking sa user

Hi All,
I have a hypothetical scenario. I have few developers who all know the sa password. I want to block one developer from accessing the SQL server eventhough he knows the sa password.

Do we have any mechanism in SQL Server 2000 to block client based on the IP address of the client?

SQl Server is installed on Windows 2000 server. It uses SQL Server & Windows authentication.

Regards,
AnandChange the sa password|||Thanks for the reply.
I know that would be the best alternative :)
But currently I am not in a position to change it immediately.

Can you suggest something else

Regards,
Anand|||sa login is built-in login as well as assigned sysadmin fixed server role. You can change sa password, but if someone knows the password he/she can login the SQL Server.

Use mixed mode security or give separate SQL Login to the developers with the db_owner or db_ddladmin database role, according to your requirement.|||How about VPN, router settings, IP or MAC filtering?|||You can filter ports to keep an IP address from making any connection to a SQL Server database, but that's rather drastic for limiting a developer. There are solutions to this problem, but all of the ones that I can think of require intimate knowledge of the problem... I don't know of any generic answer to this kind of problem.

-PatP|||change the f'n sa password

sa shouldn't be used...some writers have even suggested creating a very strong password...write it down, put it in a safe and never use it..and create a new, "unknown" login that has sa rights|||change the f'n sa password

sa shouldn't be used...some writers have even suggested creating a very strong password...write it down, put it in a safe and never use it..and create a new, "unknown" login that has sa rights

Yep. First thing I do. Select newid() (on a different server). Copy and paste results into the install screen. Forget about it. Never use sa for anything.

Regards,

hmscott|||Yep. First thing I do. Select newid() (on a different server). Copy and paste results into the install screen. Forget about it. Never use sa for anything.

Regards,

hmscott

Humm... really unique password..! :rolleyes:

Blocking ms-access

Hi,
There is a way to block all request that come from a ms-
access ?
I am working for a company where users always connects to a SQL database to get information they need (because applications don't provide them).
The problem is when the users run queries, they lock almost all database preventing others users to work.
I can't remove SQL permissions because the application depends on it to run and i can't uninstall ms-access from the users because they need the information to do their job.
I am configuring a log shipping environment with "read-
only" permission and trying to identify users running ms-
access querying sysprocesses (to change the odbc to another server) but not everyone that uses ms-access are logged in sysprocesses as "Microsoft=AE Access", sometimes the application in sysprocesses is empty and i can't identify what user is running.
Any suggetion ?
Thanks,
Julio CarvalhoYours is probably the best solution. If another SQL Server isn't an
option due to cost or whatever, the data could always be pushed out to
an Access mdb and users could run reports by linking to it instead of
the server.
-- Mary
Microsoft Access Developer's Guide to SQL Server
http://www.amazon.com/exec/obidos/ASIN/0672319446
On Tue, 22 Jul 2003 15:26:18 -0400, "Stefan" <st@.email.net> wrote:
>Julio,
>I have exactly the same environment here. We had to set up another server
>and use transactional replication to push data. Then all Access clients were
>pointed to this new box where they could run their reports without
>disturbing any other production application.
>"Julio Carvalho" <jc.carvalho@.terra.com.br> wrote in message
>news:01ec01c3507c$b7fbb8c0$a401280a@.phx.gbl...
>Hi,
>There is a way to block all request that come from a ms-
>access ?
>I am working for a company where users always connects to
>a SQL database to get information they need (because
>applications don't provide them).
>The problem is when the users run queries, they lock
>almost all database preventing others users to work.
>I can't remove SQL permissions because the application
>depends on it to run and i can't uninstall ms-access from
>the users because they need the information to do their
>job.
>I am configuring a log shipping environment with "read-
>only" permission and trying to identify users running ms-
>access querying sysprocesses (to change the odbc to
>another server) but not everyone that uses ms-access are
>logged in sysprocesses as "Microsoft® Access", sometimes
>the application in sysprocesses is empty and i can't
>identify what user is running.
>Any suggetion ?
>Thanks,
>Julio Carvalho
>

blocking items dependent on words within a field

I am sitting here with both my Crystal 8.5 and my SQL guides out and still can not find the answers I am looking for...

I know that if I want to block an item that starts with a certain phrase I can use the code
Code:
------------------------

not({item.itm_desc} startswith ["cement","interpore","collagraft","mesh"])
------------------------
... however, my problem is that the items that I want to block do not START the description... the words are within the description - just not at the beginning of it . I know it is still possible to block items based on those words, but I can not remember how to code the report to do so...

Also - just to make life a little more interesting - there is 1 item that begins with the word "mesh" that i DO want to show up on this report. is there coding that says something to the effect of "ignore all items beginning with "mesh" EXCEPT item # 54446" ?

Does anyone have any ideas? Any suggestions would be greatly appreciated...i just wanted to let yall know someone gave me the following suggestion in regard to the second question and it worked great:
Code:
------------------------

If {Item_no}="54446" then {item.itm_desc}={item.itm_desc} elsenot({item.itm_desc}startswith "mesh")
------------------------

i am still searching for the first answer, but at least the second one has been put to rest...

thanks

Thursday, March 8, 2012

blocking and deadlock detection

I'm using sql 2005 standard. There's a that a 3rd party app that I suspect
may be causing either some sort of block or deadlock when certain operations
are performed. Can anyone suggest a good way of configuring the profiler (or
any other method) to help in identifying problem spids?
tia
MG
Have a look here: http://support.microsoft.com/default.aspx/kb/271509
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Hurme" <michael.geles@.thomson.com> wrote in message
news:6927521C-B6AC-4B6F-B506-4D29039AE885@.microsoft.com...
> I'm using sql 2005 standard. There's a that a 3rd party app that I suspect
> may be causing either some sort of block or deadlock when certain
> operations
> are performed. Can anyone suggest a good way of configuring the profiler
> (or
> any other method) to help in identifying problem spids?
> tia
> --
> MG
|||You can also enable a trace flag to get detailed information about
deadlocks. See here: http://msdn2.microsoft.com/en-us/library/ms178104.aspx
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:eCd19JDaIHA.220@.TK2MSFTNGP04.phx.gbl...
> Have a look here: http://support.microsoft.com/default.aspx/kb/271509
>
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
> "Hurme" <michael.geles@.thomson.com> wrote in message
> news:6927521C-B6AC-4B6F-B506-4D29039AE885@.microsoft.com...
>
|||Hi
http://blogs.msdn.com/bartd/archive/2006/09/09/747119.aspx
http://blogs.msdn.com/bartd/archive/2006/09/25/770928.aspx
"Hurme" <michael.geles@.thomson.com> wrote in message
news:6927521C-B6AC-4B6F-B506-4D29039AE885@.microsoft.com...
> I'm using sql 2005 standard. There's a that a 3rd party app that I suspect
> may be causing either some sort of block or deadlock when certain
> operations
> are performed. Can anyone suggest a good way of configuring the profiler
> (or
> any other method) to help in identifying problem spids?
> tia
> --
> MG

blocking and deadlock detection

I'm using sql 2005 standard. There's a that a 3rd party app that I suspect
may be causing either some sort of block or deadlock when certain operations
are performed. Can anyone suggest a good way of configuring the profiler (or
any other method) to help in identifying problem spids?
tia
--
MGHave a look here: http://support.microsoft.com/default.aspx/kb/271509
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Hurme" <michael.geles@.thomson.com> wrote in message
news:6927521C-B6AC-4B6F-B506-4D29039AE885@.microsoft.com...
> I'm using sql 2005 standard. There's a that a 3rd party app that I suspect
> may be causing either some sort of block or deadlock when certain
> operations
> are performed. Can anyone suggest a good way of configuring the profiler
> (or
> any other method) to help in identifying problem spids?
> tia
> --
> MG|||You can also enable a trace flag to get detailed information about
deadlocks. See here: http://msdn2.microsoft.com/en-us/library/ms178104.aspx
--
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:eCd19JDaIHA.220@.TK2MSFTNGP04.phx.gbl...
> Have a look here: http://support.microsoft.com/default.aspx/kb/271509
>
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
> "Hurme" <michael.geles@.thomson.com> wrote in message
> news:6927521C-B6AC-4B6F-B506-4D29039AE885@.microsoft.com...
>> I'm using sql 2005 standard. There's a that a 3rd party app that I
>> suspect
>> may be causing either some sort of block or deadlock when certain
>> operations
>> are performed. Can anyone suggest a good way of configuring the profiler
>> (or
>> any other method) to help in identifying problem spids?
>> tia
>> --
>> MG
>|||Hi
http://blogs.msdn.com/bartd/archive/2006/09/09/747119.aspx
http://blogs.msdn.com/bartd/archive/2006/09/25/770928.aspx
"Hurme" <michael.geles@.thomson.com> wrote in message
news:6927521C-B6AC-4B6F-B506-4D29039AE885@.microsoft.com...
> I'm using sql 2005 standard. There's a that a 3rd party app that I suspect
> may be causing either some sort of block or deadlock when certain
> operations
> are performed. Can anyone suggest a good way of configuring the profiler
> (or
> any other method) to help in identifying problem spids?
> tia
> --
> MG

Blocking Alert

I'm trying to set up an alert for when a block occurs on a database. I
thought I could use error 1229, but that doesn't appear to be the correct
one, as it never fires, even tho we do get an occassional block.
Is there another error number I should be using? Is it possible to do what
I'm trying to do? Ideally, I would like an email to be sent when a block
occurs, so I can analyze the situation and make necessary changes.
Thanks for any advice,
TomT
Tom,
Are you refering to a database lock or a lock on an object in the database
that might be causing blocking? Might want to check out the SQL Server
Agent - Performance Condition Alerts - SQL Server:Locks.
HTH
Jerry
"TomT" <tomt@.newsgroup.nospam> wrote in message
news:581B2CA0-D62A-4DF0-BC06-8E597404D971@.microsoft.com...
> I'm trying to set up an alert for when a block occurs on a database. I
> thought I could use error 1229, but that doesn't appear to be the correct
> one, as it never fires, even tho we do get an occassional block.
> Is there another error number I should be using? Is it possible to do what
> I'm trying to do? Ideally, I would like an email to be sent when a block
> occurs, so I can analyze the situation and make necessary changes.
> Thanks for any advice,
> TomT
|||Jerry,
Thanks for your response. I'm talking about a block that shows up in EM,
under Current Activity\Process Info. There's a column for Blocking and
Blocked By.
"Jerry Spivey" wrote:

> Tom,
> Are you refering to a database lock or a lock on an object in the database
> that might be causing blocking? Might want to check out the SQL Server
> Agent - Performance Condition Alerts - SQL Server:Locks.
> HTH
> Jerry
> "TomT" <tomt@.newsgroup.nospam> wrote in message
> news:581B2CA0-D62A-4DF0-BC06-8E597404D971@.microsoft.com...
>
>
|||Check the following Knowledge Base article for a sample
script on setting this up:
How to monitor SQL Server 2000 blocking
http://support.microsoft.com/?id=271509
-Sue
On Wed, 14 Sep 2005 15:08:04 -0700, "TomT"
<tomt@.newsgroup.nospam> wrote:

>I'm trying to set up an alert for when a block occurs on a database. I
>thought I could use error 1229, but that doesn't appear to be the correct
>one, as it never fires, even tho we do get an occassional block.
>Is there another error number I should be using? Is it possible to do what
>I'm trying to do? Ideally, I would like an email to be sent when a block
>occurs, so I can analyze the situation and make necessary changes.
>Thanks for any advice,
>TomT
|||Sue,
thanks very much for the link. Out of curiosity, is it possible to also set
an alert for this? Is there to your knowledge a specific error number for
this event?
thanks,
Tom
"Sue Hoegemeier" wrote:

> Check the following Knowledge Base article for a sample
> script on setting this up:
> How to monitor SQL Server 2000 blocking
> http://support.microsoft.com/?id=271509
> -Sue
> On Wed, 14 Sep 2005 15:08:04 -0700, "TomT"
> <tomt@.newsgroup.nospam> wrote:
>
>
|||TomT wrote:
> Sue,
> thanks very much for the link. Out of curiosity, is it possible to
> also set an alert for this? Is there to your knowledge a specific
> error number for this event?
Blocking is not really an error condition. It's a normal part of RDBMS
operation. You are always going to have blocking going on in some
fashion. In a healthly system, the blocks are so short they are never
noticed. On a system with problems these blocks are more pronounced. The
blocking scipts Sue mentioned will help you determine when extended
blocks are occurring in the database.
You can set a lock timeout in you application if you want. With a lock
timeout, the application will only wait for a specific maximum time when
blocked before cancelling the query. A cancelled query throws an
attention event, which can be captured with Profiler or using a
server-side trace.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Hi Tom,
Since many communities and MVP provide great answers, I wanted to post a
quick note to see if you would like additional assistance or information
regarding this particular issue. We appreciate your patience and look
forward to hearing from you!
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.

Blocking Alert

I'm trying to set up an alert for when a block occurs on a database. I
thought I could use error 1229, but that doesn't appear to be the correct
one, as it never fires, even tho we do get an occassional block.
Is there another error number I should be using? Is it possible to do what
I'm trying to do? Ideally, I would like an email to be sent when a block
occurs, so I can analyze the situation and make necessary changes.
Thanks for any advice,
TomTTom,
Are you refering to a database lock or a lock on an object in the database
that might be causing blocking? Might want to check out the SQL Server
Agent - Performance Condition Alerts - SQL Server:Locks.
HTH
Jerry
"TomT" <tomt@.newsgroup.nospam> wrote in message
news:581B2CA0-D62A-4DF0-BC06-8E597404D971@.microsoft.com...
> I'm trying to set up an alert for when a block occurs on a database. I
> thought I could use error 1229, but that doesn't appear to be the correct
> one, as it never fires, even tho we do get an occassional block.
> Is there another error number I should be using? Is it possible to do what
> I'm trying to do? Ideally, I would like an email to be sent when a block
> occurs, so I can analyze the situation and make necessary changes.
> Thanks for any advice,
> TomT|||Jerry,
Thanks for your response. I'm talking about a block that shows up in EM,
under Current Activity\Process Info. There's a column for Blocking and
Blocked By.
"Jerry Spivey" wrote:

> Tom,
> Are you refering to a database lock or a lock on an object in the database
> that might be causing blocking? Might want to check out the SQL Server
> Agent - Performance Condition Alerts - SQL Server:Locks.
> HTH
> Jerry
> "TomT" <tomt@.newsgroup.nospam> wrote in message
> news:581B2CA0-D62A-4DF0-BC06-8E597404D971@.microsoft.com...
>
>|||Check the following Knowledge Base article for a sample
script on setting this up:
How to monitor SQL Server 2000 blocking
http://support.microsoft.com/?id=271509
-Sue
On Wed, 14 Sep 2005 15:08:04 -0700, "TomT"
<tomt@.newsgroup.nospam> wrote:

>I'm trying to set up an alert for when a block occurs on a database. I
>thought I could use error 1229, but that doesn't appear to be the correct
>one, as it never fires, even tho we do get an occassional block.
>Is there another error number I should be using? Is it possible to do what
>I'm trying to do? Ideally, I would like an email to be sent when a block
>occurs, so I can analyze the situation and make necessary changes.
>Thanks for any advice,
>TomT|||Sue,
thanks very much for the link. Out of curiosity, is it possible to also set
an alert for this? Is there to your knowledge a specific error number for
this event?
thanks,
Tom
"Sue Hoegemeier" wrote:

> Check the following Knowledge Base article for a sample
> script on setting this up:
> How to monitor SQL Server 2000 blocking
> http://support.microsoft.com/?id=271509
> -Sue
> On Wed, 14 Sep 2005 15:08:04 -0700, "TomT"
> <tomt@.newsgroup.nospam> wrote:
>
>|||TomT wrote:
> Sue,
> thanks very much for the link. Out of curiosity, is it possible to
> also set an alert for this? Is there to your knowledge a specific
> error number for this event?
Blocking is not really an error condition. It's a normal part of RDBMS
operation. You are always going to have blocking going on in some
fashion. In a healthly system, the blocks are so short they are never
noticed. On a system with problems these blocks are more pronounced. The
blocking scipts Sue mentioned will help you determine when extended
blocks are occurring in the database.
You can set a lock timeout in you application if you want. With a lock
timeout, the application will only wait for a specific maximum time when
blocked before cancelling the query. A cancelled query throws an
attention event, which can be captured with Profiler or using a
server-side trace.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Hi Tom,
Since many communities and MVP provide great answers, I wanted to post a
quick note to see if you would like additional assistance or information
regarding this particular issue. We appreciate your patience and look
forward to hearing from you!
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.

Blocking Alert

I'm trying to set up an alert for when a block occurs on a database. I
thought I could use error 1229, but that doesn't appear to be the correct
one, as it never fires, even tho we do get an occassional block.
Is there another error number I should be using? Is it possible to do what
I'm trying to do? Ideally, I would like an email to be sent when a block
occurs, so I can analyze the situation and make necessary changes.
Thanks for any advice,
TomTTom,
Are you refering to a database lock or a lock on an object in the database
that might be causing blocking? Might want to check out the SQL Server
Agent - Performance Condition Alerts - SQL Server:Locks.
HTH
Jerry
"TomT" <tomt@.newsgroup.nospam> wrote in message
news:581B2CA0-D62A-4DF0-BC06-8E597404D971@.microsoft.com...
> I'm trying to set up an alert for when a block occurs on a database. I
> thought I could use error 1229, but that doesn't appear to be the correct
> one, as it never fires, even tho we do get an occassional block.
> Is there another error number I should be using? Is it possible to do what
> I'm trying to do? Ideally, I would like an email to be sent when a block
> occurs, so I can analyze the situation and make necessary changes.
> Thanks for any advice,
> TomT|||Jerry,
Thanks for your response. I'm talking about a block that shows up in EM,
under Current Activity\Process Info. There's a column for Blocking and
Blocked By.
"Jerry Spivey" wrote:
> Tom,
> Are you refering to a database lock or a lock on an object in the database
> that might be causing blocking? Might want to check out the SQL Server
> Agent - Performance Condition Alerts - SQL Server:Locks.
> HTH
> Jerry
> "TomT" <tomt@.newsgroup.nospam> wrote in message
> news:581B2CA0-D62A-4DF0-BC06-8E597404D971@.microsoft.com...
> > I'm trying to set up an alert for when a block occurs on a database. I
> > thought I could use error 1229, but that doesn't appear to be the correct
> > one, as it never fires, even tho we do get an occassional block.
> >
> > Is there another error number I should be using? Is it possible to do what
> > I'm trying to do? Ideally, I would like an email to be sent when a block
> > occurs, so I can analyze the situation and make necessary changes.
> >
> > Thanks for any advice,
> >
> > TomT
>
>|||Check the following Knowledge Base article for a sample
script on setting this up:
How to monitor SQL Server 2000 blocking
http://support.microsoft.com/?id=271509
-Sue
On Wed, 14 Sep 2005 15:08:04 -0700, "TomT"
<tomt@.newsgroup.nospam> wrote:
>I'm trying to set up an alert for when a block occurs on a database. I
>thought I could use error 1229, but that doesn't appear to be the correct
>one, as it never fires, even tho we do get an occassional block.
>Is there another error number I should be using? Is it possible to do what
>I'm trying to do? Ideally, I would like an email to be sent when a block
>occurs, so I can analyze the situation and make necessary changes.
>Thanks for any advice,
>TomT|||Sue,
thanks very much for the link. Out of curiosity, is it possible to also set
an alert for this? Is there to your knowledge a specific error number for
this event?
thanks,
Tom
"Sue Hoegemeier" wrote:
> Check the following Knowledge Base article for a sample
> script on setting this up:
> How to monitor SQL Server 2000 blocking
> http://support.microsoft.com/?id=271509
> -Sue
> On Wed, 14 Sep 2005 15:08:04 -0700, "TomT"
> <tomt@.newsgroup.nospam> wrote:
> >I'm trying to set up an alert for when a block occurs on a database. I
> >thought I could use error 1229, but that doesn't appear to be the correct
> >one, as it never fires, even tho we do get an occassional block.
> >
> >Is there another error number I should be using? Is it possible to do what
> >I'm trying to do? Ideally, I would like an email to be sent when a block
> >occurs, so I can analyze the situation and make necessary changes.
> >
> >Thanks for any advice,
> >
> >TomT
>|||TomT wrote:
> Sue,
> thanks very much for the link. Out of curiosity, is it possible to
> also set an alert for this? Is there to your knowledge a specific
> error number for this event?
Blocking is not really an error condition. It's a normal part of RDBMS
operation. You are always going to have blocking going on in some
fashion. In a healthly system, the blocks are so short they are never
noticed. On a system with problems these blocks are more pronounced. The
blocking scipts Sue mentioned will help you determine when extended
blocks are occurring in the database.
You can set a lock timeout in you application if you want. With a lock
timeout, the application will only wait for a specific maximum time when
blocked before cancelling the query. A cancelled query throws an
attention event, which can be captured with Profiler or using a
server-side trace.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Hi Tom,
Since many communities and MVP provide great answers, I wanted to post a
quick note to see if you would like additional assistance or information
regarding this particular issue. We appreciate your patience and look
forward to hearing from you!
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.

Wednesday, March 7, 2012

Block UDP 1434?

Can we block udp 1434 internally behind our firewall at the routers? We are
subnetted. any issues?
If you use any named instances, then you must choose a FIXED port number,
and set up the clients to connect via the fixed port number, instead of
using the auto port selection/identification features, which require 1434 to
be open...
Otherwise, no problems.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"CD" <mcdye1@.hotmail.nospam.com> wrote in message
news:OPGZ9K$REHA.568@.TK2MSFTNGP12.phx.gbl...
> Can we block udp 1434 internally behind our firewall at the routers? We
are
> subnetted. any issues?
>

Block UDP 1434?

Can we block udp 1434 internally behind our firewall at the routers? We are
subnetted. any issues?If you use any named instances, then you must choose a FIXED port number,
and set up the clients to connect via the fixed port number, instead of
using the auto port selection/identification features, which require 1434 to
be open...
Otherwise, no problems.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"CD" <mcdye1@.hotmail.nospam.com> wrote in message
news:OPGZ9K$REHA.568@.TK2MSFTNGP12.phx.gbl...
> Can we block udp 1434 internally behind our firewall at the routers? We
are
> subnetted. any issues?
>

Block UDP 1434?

Can we block udp 1434 internally behind our firewall at the routers? We are
subnetted. any issues?If you use any named instances, then you must choose a FIXED port number,
and set up the clients to connect via the fixed port number, instead of
using the auto port selection/identification features, which require 1434 to
be open...
Otherwise, no problems.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"CD" <mcdye1@.hotmail.nospam.com> wrote in message
news:OPGZ9K$REHA.568@.TK2MSFTNGP12.phx.gbl...
> Can we block udp 1434 internally behind our firewall at the routers? We
are
> subnetted. any issues?
>

Block to drop any object with ddl triger

Hi all,
I want block attempt to drop any objects(tables, sp, views...) of my data
base.
Have way to do this?
I did see same thing about DDL trigers, any one can sed-me one sample?
Thanks to allHi all,
Thanks,
I find one sample...
CREATE TRIGGER safety
ON DATABASE
FOR DROP_TABLE, ALTER_TABLE
AS
PRINT 'You must disable Trigger "safety" to drop or alter tables!'
ROLLBACK ;
Thanks again
"retf" <re.tf@.terra.com.br> escreveu na mensagem
news:%23cQ9yq6eGHA.1272@.TK2MSFTNGP03.phx.gbl...
> Hi all,
> I want block attempt to drop any objects(tables, sp, views...) of my data
> base.
> Have way to do this?
> I did see same thing about DDL trigers, any one can sed-me one sample?
> Thanks to all
>|||This should really be
CREATE TRIGGER safety
ON DATABASE
FOR DROP_TABLE, ALTER_TABLE
AS
BEGIN
RAISERROR('You must disable Trigger "safety" to drop or alter
tables!',16,1)
ROLLBACK ;
END
Without an error, a client may think the statement suceeded.
David
"retf" <re.tf@.terra.com.br> wrote in message
news:%23P2uRt6eGHA.3484@.TK2MSFTNGP02.phx.gbl...
> Hi all,
> Thanks,
> I find one sample...
> CREATE TRIGGER safety
> ON DATABASE
> FOR DROP_TABLE, ALTER_TABLE
> AS
> PRINT 'You must disable Trigger "safety" to drop or alter tables!'
> ROLLBACK ;
>
> Thanks again
> "retf" <re.tf@.terra.com.br> escreveu na mensagem
> news:%23cQ9yq6eGHA.1272@.TK2MSFTNGP03.phx.gbl...
>|||David Browne (davidbaxterbrowne no potted meat@.hotmail.com) writes:
> This should really be
>
> CREATE TRIGGER safety
> ON DATABASE
> FOR DROP_TABLE, ALTER_TABLE
> AS
> BEGIN
> RAISERROR('You must disable Trigger "safety" to drop or alter
> tables!',16,1)
> ROLLBACK ;
> END
> Without an error, a client may think the statement suceeded.
Quibble: there will be an error message without the RAISERROR. To
wit, in SQL 2005 a ROLLBACK in a trigger raises an error message.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Block Size on Hardware for SQL Server 2000 on Windows enterprise 2

Any idea of best block size for hardware for SQL server 2000 on windows
enterprise 2003 edition?
Thanks
- NT
>
> Any idea of best block size for hardware for SQL server 2000 on windows
> enterprise 2003 edition?
> Thanks
> --
> - NT
According to:
http://www.microsoft.com/technet/pro...n/instant.mspx
Select the Appropriate Allocation Unit Size (ALU)
"Consider matching the file system ALU to the block size of the application
you are using. If SQL Server is using a 4 KB block size, when you format a
file system on a new disk drive, launch Disk Administrator, create the
partition, commit the partition changes, select Format, and then set the
ALU to 4096 bytes. Matching the file system block sizes can improve the
efficiency of the disk transfers when you use the application. For more ALU
size options, use the format command from the command prompt versus the
Disk Administrator tool."
Hope this helps,
Eric Crdenas
Senior support professional
This posting is provided "AS IS" with no warranties, and confers no rights.

Block row from been updated

I need to block some rows from being updated using mssql 2000.
this is because some users are changing data after the product has been
factured.
The VB program does not let any body to change the data but some advanced
users have done it directly to the database.
If some one can help me I will be very thankful
Regards, LinaWhy do those "advanced users" even have access to the database?
They should not.|||Given that you need to solve the problem as it exists, the simplest approach
would be to put a trigger on the table that checks to see if one of the
"non-alterable" records is being updated and roll back the transaction. You
might also want to log who is updating the row for future personnel related
actions.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<Octavius@.gmail.com> wrote in message
news:1135822838.009333.252160@.g14g2000cwa.googlegroups.com...
> Why do those "advanced users" even have access to the database?
> They should not.
>|||Thanks a lot, Lina
"Roger Wolter[MSFT]" wrote:

> Given that you need to solve the problem as it exists, the simplest approa
ch
> would be to put a trigger on the table that checks to see if one of the
> "non-alterable" records is being updated and roll back the transaction. Y
ou
> might also want to log who is updating the row for future personnel relate
d
> actions.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> <Octavius@.gmail.com> wrote in message
> news:1135822838.009333.252160@.g14g2000cwa.googlegroups.com...
>
>|||You could try using the APP_NAME function. Run SQL Query Analyzer, and
execute sp_who2 while some users are connected. Look under the ProgramName
column to see what the name of your application is as it appears to the
server.
Then put some logic into your stored procedures, or into an INSTEAD OF
trigger on your table(s)
IF APP_NAME() <> 'YourApp'
--Sorry Charlie!
If your application doesn't report a ProgramName, but the "advanced users"
are using something like Access or a command line tool that does report a
ProgramName, you could block it with something like
IF APP_NAME() IN ('Microsoft Access', 'osql')
"Lina Manjarres" wrote:

> I need to block some rows from being updated using mssql 2000.
> this is because some users are changing data after the product has been
> factured.
> The VB program does not let any body to change the data but some advanced
> users have done it directly to the database.
> If some one can help me I will be very thankful
> Regards, Lina|||Thanks a lot Mark
I used this:
IF EXISTS(SELECT * FROM inserted WHERE facturado_Cliente = 1)
Begin
ROLLBACK TRAN
End
and i had a problem wit it. After the facturado_Cliente where changed to 0
again, it did not let me change the row any more. I mean, I couldn't make it
1 again, it allways rolled back.
So I will try what you suggest me, because it sound perfect. Is it posible
to do so, but with the HostName?
Thanks a lot, Lina
"Mark Williams" wrote:
> You could try using the APP_NAME function. Run SQL Query Analyzer, and
> execute sp_who2 while some users are connected. Look under the ProgramName
> column to see what the name of your application is as it appears to the
> server.
> Then put some logic into your stored procedures, or into an INSTEAD OF
> trigger on your table(s)
> IF APP_NAME() <> 'YourApp'
> --Sorry Charlie!
> If your application doesn't report a ProgramName, but the "advanced users"
> are using something like Access or a command line tool that does report a
> ProgramName, you could block it with something like
> IF APP_NAME() IN ('Microsoft Access', 'osql')
> "Lina Manjarres" wrote:
>|||The HOST_NAME() function will return the hostname of the system associated
with the connection, which you could use in a WHERE clause, but it is
probably not a good idea. You would have to block individual machine names,
and all someone would have to do in order to defeat your filter is
move to another machine , or
change their machine name
It would probably work out better to put in a filter condition based on
APP_NAME() . Does your application show a ProgramName value when you run
sp_who2 ? If it does, filter the updates based on the ProgramName.
"Lina Manjarres" wrote:
> Thanks a lot Mark
> I used this:
> IF EXISTS(SELECT * FROM inserted WHERE facturado_Cliente = 1)
> Begin
> ROLLBACK TRAN
> End
> and i had a problem wit it. After the facturado_Cliente where changed to 0
> again, it did not let me change the row any more. I mean, I couldn't make
it
> 1 again, it allways rolled back.
> So I will try what you suggest me, because it sound perfect. Is it posible
> to do so, but with the HostName?
> Thanks a lot, Lina
> "Mark Williams" wrote:
>|||Thanks a lot Mark.
One more question.
What happend when I have several SQL replicating. Is there any problem wit i
t?
"Mark Williams" wrote:
> The HOST_NAME() function will return the hostname of the system associated
> with the connection, which you could use in a WHERE clause, but it is
> probably not a good idea. You would have to block individual machine names
,
> and all someone would have to do in order to defeat your filter is
> move to another machine , or
> change their machine name
> It would probably work out better to put in a filter condition based on
> APP_NAME() . Does your application show a ProgramName value when you run
> sp_who2 ? If it does, filter the updates based on the ProgramName.
> "Lina Manjarres" wrote:
>|||If the table is involved in replication, you can place the application
checking logic into an INSTEAD OF trigger, and create the trigger with the
NOT FOR REPLICATION option. This will prevent the trigger from firing when a
replication operation modifies the table. See books online for more details.
If you posted to this forum through TechNet, and you found my answers
helpful, please mark them as answers. Thanks!
"Lina Manjarres" wrote:
> Thanks a lot Mark.
> One more question.
> What happend when I have several SQL replicating. Is there any problem wit
it?
> "Mark Williams" wrote:
>|||Dear Mark
I am using this:
AFTER UPDATE NOT FOR REPLICATION
Is it ok or do I have to use Instead of?
Thanks a lot, Lina
"Mark Williams" wrote:
> If the table is involved in replication, you can place the application
> checking logic into an INSTEAD OF trigger, and create the trigger with the
> NOT FOR REPLICATION option. This will prevent the trigger from firing when
a
> replication operation modifies the table. See books online for more detail
s.
> --
> If you posted to this forum through TechNet, and you found my answers
> helpful, please mark them as answers. Thanks!
>
> "Lina Manjarres" wrote:
>

Block remote login

How can I block users from using their SQL accounts to access SQL 2000 server
remotely thru enterprise manager or sql query analyzer? Appreciate any help.
Thanks.
Hi,
There is no methodology in SQL Server 2000 to restrict the remote access; if
the users have access to network. The only way to restrict
is by setting complex password to the SQL Account.
Thanks
Hari
SQL Server Mvp
"Benny" <Benny@.discussions.microsoft.com> wrote in message
news:0EE6279A-1977-4B3E-A4AB-EC1719C2B447@.microsoft.com...
> How can I block users from using their SQL accounts to access SQL 2000
> server
> remotely thru enterprise manager or sql query analyzer? Appreciate any
> help.
> Thanks.

Block remote login

How can I block users from using their SQL accounts to access SQL 2000 server
remotely thru enterprise manager or sql query analyzer? Appreciate any help.
Thanks.Hi,
There is no methodology in SQL Server 2000 to restrict the remote access; if
the users have access to network. The only way to restrict
is by setting complex password to the SQL Account.
Thanks
Hari
SQL Server Mvp
"Benny" <Benny@.discussions.microsoft.com> wrote in message
news:0EE6279A-1977-4B3E-A4AB-EC1719C2B447@.microsoft.com...
> How can I block users from using their SQL accounts to access SQL 2000
> server
> remotely thru enterprise manager or sql query analyzer? Appreciate any
> help.
> Thanks.