Showing posts with label status. Show all posts
Showing posts with label status. Show all posts

Monday, March 19, 2012

Bocking Issue

I have a spid that has a wait type of networkio, open
trans = 0, command = select, status is runnable, wait time
of around 70000000. application is IIS.
I'm assuming I can just kill this spid beceause it's
a "select" and not part of a transaction. Is there some
way to tell if it's safe to kill this?Did you do a DBCC INPUTBUFFER on that spid? That'll at least tell you what
exactly that spid is selecting, and you could determine, where that
connection is coming from.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"maryann" <anonymous@.discussions.microsoft.com> wrote in message
news:0bcf01c3d53c$b61fb070$a501280a@.phx.gbl...
I have a spid that has a wait type of networkio, open
trans = 0, command = select, status is runnable, wait time
of around 70000000. application is IIS.
I'm assuming I can just kill this spid beceause it's
a "select" and not part of a transaction. Is there some
way to tell if it's safe to kill this?

Sunday, February 12, 2012

Bizarre sql management studio problem...cant see server status for

This one has me stumped.
Basically when I open sql management studio 2005 and connect to one of
my servers, the little server status icon adjacent to the server name
contains a blank circle. Normally it contains a small green triangle
to indicate the server is running. If I right click on the server
name, all the start/stop/pause/resume etc options are greyed out. This
is very confusing for the following reasons:
- I am logged on as 'sa' and all my other permissions work.
- Other logins (both sql server and windows authentication) show the
same issue
- Connecting to other database servers works fine (and shows the
correct status icon)
I originally thought it was some bizarre permissions issue, however if
I am logged directly into the server start the sql management tool
there using the same database login, the server shows the 'started'
green triangle and the start/stop/pause/resume etc options are
available.
This issue appears to have occurred randomly, I can not think of
anything I have done recently that involved changing permissions or
anything like that.
Any ideas?The connection as sa is a regular SQL Server connection. The
indicator that shows that the server is running is not updated based
on making a SQL Server connection; if you open SSMS without connecting
to any SQL Server the status of the servers should show.
The indication that SQL Server is running, or not, is based on SSMS
finding out if the service is running. That query is made to the
server's operating system, and is based on the rights of the Windows
account you are logged in with. For the servers that are displayed
with the status you have rights, for the others you do not.
I admit to a bit of guesswork in the above, but I think it is the
answer.
Roy Harvey
Beacon Falls, CT
On Fri, 11 Jan 2008 17:16:50 -0800 (PST), Alex Danger
<alex.csp@.gmail.com> wrote:
>This one has me stumped.
>Basically when I open sql management studio 2005 and connect to one of
>my servers, the little server status icon adjacent to the server name
>contains a blank circle. Normally it contains a small green triangle
>to indicate the server is running. If I right click on the server
>name, all the start/stop/pause/resume etc options are greyed out. This
>is very confusing for the following reasons:
>
>- I am logged on as 'sa' and all my other permissions work.
>- Other logins (both sql server and windows authentication) show the
>same issue
>- Connecting to other database servers works fine (and shows the
>correct status icon)
>I originally thought it was some bizarre permissions issue, however if
>I am logged directly into the server start the sql management tool
>there using the same database login, the server shows the 'started'
>green triangle and the start/stop/pause/resume etc options are
>available.
>This issue appears to have occurred randomly, I can not think of
>anything I have done recently that involved changing permissions or
>anything like that.
>Any ideas?

Friday, February 10, 2012

Bit Datatype

I have a table. And in the table, I have a field that stores the status of
something. I declare this status field as a "bit" data type in the sql
server. When I retrieve the value in my asp.net (in visual basic) code, is
this data a string, integer, char or object? Visual Basic doesn't seem to
have a bit data type.
Do you understand what I mean? Do you recommend me using the "bit" data
type? Or should I use varchar(1) instead?
Thank you.Hi
The BIT allows 0, 1 and NULL.
A VB/VB.NET Boolean datatype has 0 for false and -1 for true (c# has 0 for
false and 1 for true)
There is not direct match, but you could have some code in your Middle Tier
that converts +1 to -1 and the opposite when you write back to SQL Server.
Generally, it is best to always evaluate against false, as 0 is false in all
languages.
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/
"wrytat" <wrytat@.discussions.microsoft.com> wrote in message
news:E23EF238-9630-4111-A47E-A9627CD4B954@.microsoft.com...
>I have a table. And in the table, I have a field that stores the status of
> something. I declare this status field as a "bit" data type in the sql
> server. When I retrieve the value in my asp.net (in visual basic) code, is
> this data a string, integer, char or object? Visual Basic doesn't seem to
> have a bit data type.
> Do you understand what I mean? Do you recommend me using the "bit" data
> type? Or should I use varchar(1) instead?
> Thank you.|||I personally prefer CHAR(1) for status columns. Bit columns can take up less
space, but only if you have more than one bit column in a table. CHAR(1) has
the advantage that there is no confusion over the meaning of the values (Y/N
is clearer than 1/0), and you don't have to change your database design if
it turns out that there are more than 2 different statuses you want to keep
track of.
CHAR(1) is better than VARCHAR(1), because a variable length column has an
overhead of 2 bytes to store the length of the column, which a fixed length
column doesn't have.
Jacco Schalkwijk
SQL Server MVP
"wrytat" <wrytat@.discussions.microsoft.com> wrote in message
news:E23EF238-9630-4111-A47E-A9627CD4B954@.microsoft.com...
>I have a table. And in the table, I have a field that stores the status of
> something. I declare this status field as a "bit" data type in the sql
> server. When I retrieve the value in my asp.net (in visual basic) code, is
> this data a string, integer, char or object? Visual Basic doesn't seem to
> have a bit data type.
> Do you understand what I mean? Do you recommend me using the "bit" data
> type? Or should I use varchar(1) instead?
> Thank you.|||Hi
I'd recommend you using CHAR(1) rather BIT datatype, because many
programming languages are interpreted on the client side differently. If I
remember well in VB. NET True-1 and False =0
"wrytat" <wrytat@.discussions.microsoft.com> wrote in message
news:E23EF238-9630-4111-A47E-A9627CD4B954@.microsoft.com...
> I have a table. And in the table, I have a field that stores the status of
> something. I declare this status field as a "bit" data type in the sql
> server. When I retrieve the value in my asp.net (in visual basic) code, is
> this data a string, integer, char or object? Visual Basic doesn't seem to
> have a bit data type.
> Do you understand what I mean? Do you recommend me using the "bit" data
> type? Or should I use varchar(1) instead?
> Thank you.|||Thank you guys. I think I'll use CHAR(1) instead then. And so, I guess I can
use a Char datatype in asp.net to represent this value.
"Uri Dimant" wrote:

> Hi
> I'd recommend you using CHAR(1) rather BIT datatype, because many
> programming languages are interpreted on the client side differently. If I
> remember well in VB. NET True-1 and False =0
> "wrytat" <wrytat@.discussions.microsoft.com> wrote in message
> news:E23EF238-9630-4111-A47E-A9627CD4B954@.microsoft.com...
>
>|||> CHAR(1) is better than VARCHAR(1), because a variable length column has an
> overhead of 2 bytes to store the length of the column, which a fixed lengt
h
> column doesn't have.
Is this the only difference between CHAR and VARCHAR? Say if I have 2
fields, 1 declared as CHAR(20), while the other as VARCHAR(20), both to stor
e
email address. Can I use String to represent both at my ASP.NET programming?
And which will be better?|||See Gert-Jan Strik's comments about this here:
http://groups.google.co.uk/groups?q...n+agree+factors
Steve Kass
Drew University
wrytat wrote:

>Is this the only difference between CHAR and VARCHAR? Say if I have 2
>fields, 1 declared as CHAR(20), while the other as VARCHAR(20), both to sto
re
>email address. Can I use String to represent both at my ASP.NET programming
?
>And which will be better?
>
>|||No, values stored in a Char(20) are not the same as values stored in a
VarChar(20). In the former case, if the value stored is less than 20 charact
ers,
it is padded with spaces. In the later case, it only stores the data passed
so
an 18 character string only takes up 18 bytes of space.
Given that, values stored in a Char(1) are almost the same as values stored
in a
VarChar(1). However, if you know that a value can only be one character, you
get
a small performance improvement by using a Char(1) in that the system does n
ot
have to maintain the length of data and the system can preallocate a specifi
ed
amount of space.
In general, I find Char data types to be a royal pain. Unless I know for a f
act
that a value must absolutely be equal to the given length (e.g Y/N values),
I
always prefer VarChar over Char because it makes it much more intuitive for
other developers to query against.
Thomas
"wrytat" <wrytat@.discussions.microsoft.com> wrote in message
news:C4DAD7EC-8FEB-4F84-94F7-4774C2B441D0@.microsoft.com...
> Is this the only difference between CHAR and VARCHAR? Say if I have 2
> fields, 1 declared as CHAR(20), while the other as VARCHAR(20), both to st
ore
> email address. Can I use String to represent both at my ASP.NET programmin
g?
> And which will be better?
>