Showing posts with label complete. Show all posts
Showing posts with label complete. Show all posts

Thursday, March 8, 2012

complex stored procedure on history table

Hi All,

I have a table that hold status history records for cases. In this table is a status field with values, opened, assigned, or complete. Each case can be assigned a number of times before it is complete, and can be reassigned. I have the need to run a query that will get each case that is still assigned, and not yet complete. I wrote a stored procedure that contains a cursor containing each case, and get the last status history record for each case and puts it into a temp table to return to the user, but is hurting performance as there are .5 million records here. Does anyone know of a better way of doing this?

Thanks in advance : )

Found an answer elsewhere using correlated sub queries. thanks

Sunday, February 19, 2012

Complete, Differential, Transaction Log -- More backup questions

Greetings all,
I am new to this Newsgroup, so forgive me if my question seems stupid.
We currently have a payroll system that runs on SQL Server 2000. We are
doing a full backup (to a local hard disk) every night of the main database,
which is about 55GB and then sending the SQL Backup off to tape. We can keep
2, maybe 3 days backup online, but space is getting tight.
I have suggested that we do 1 complete backup at the beginning of the
week, then a Differential backup every night, and a transaction log backup
every couple of hours during the day.
My question for you people. If I do the complete backup on Sunday
night, a differential on Monday and Tuesday night, and a couple of
Transaction Log backups on Wednesday, and the System crashes late Wednesday
do I have to restore both Mon and Tue differential and all the Wed
Transaction Logs and restoring the complete from Sun, or can I just restore
the Sun complete, the Tue night differential and the last Transaction Log
from Wed?
I think my actual question is: "Is the Differential backup all the
differences from the last complete or the last Differential, and does the
Transaction Log backup get everything from the last Differential?"
Thanks much
Raymond Fantasia
Fry''s Electronics
ISD DepartmentHi
answered in microsoft.public.sqlserver.newusers
Please do not multi-post as it is harder to know if the question has been
answered yet.
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/
"Ray Fantasia" <RayFantasia@.discussions.microsoft.com> wrote in message
news:A8241F2A-6630-4B96-A9A0-2CB30BEEA7E9@.microsoft.com...
> Greetings all,
> I am new to this Newsgroup, so forgive me if my question seems stupid.
> We currently have a payroll system that runs on SQL Server 2000. We are
> doing a full backup (to a local hard disk) every night of the main
> database,
> which is about 55GB and then sending the SQL Backup off to tape. We can
> keep
> 2, maybe 3 days backup online, but space is getting tight.
> I have suggested that we do 1 complete backup at the beginning of the
> week, then a Differential backup every night, and a transaction log backup
> every couple of hours during the day.
> My question for you people. If I do the complete backup on Sunday
> night, a differential on Monday and Tuesday night, and a couple of
> Transaction Log backups on Wednesday, and the System crashes late
> Wednesday
> do I have to restore both Mon and Tue differential and all the Wed
> Transaction Logs and restoring the complete from Sun, or can I just
> restore
> the Sun complete, the Tue night differential and the last Transaction Log
> from Wed?
> I think my actual question is: "Is the Differential backup all the
> differences from the last complete or the last Differential, and does the
> Transaction Log backup get everything from the last Differential?"
> Thanks much
> Raymond Fantasia
> Fry''s Electronics
> ISD Department

Complete, Differential, Transaction Log -- More backup questions

Greetings all,
I am new to this Newsgroup, so forgive me if my question seems stupid.
We currently have a payroll system that runs on SQL Server 2000. We are
doing a full backup (to a local hard disk) every night of the main database,
which is about 55GB and then sending the SQL Backup off to tape. We can kee
p
2, maybe 3 days backup online, but space is getting tight.
I have suggested that we do 1 complete backup at the beginning of the
week, then a Differential backup every night, and a transaction log backup
every couple of hours during the day.
My question for you people. If I do the complete backup on Sunday
night, a differential on Monday and Tuesday night, and a couple of
Transaction Log backups on Wednesday, and the System crashes late Wednesday
do I have to restore both Mon and Tue differential and all the Wed
Transaction Logs and restoring the complete from Sun, or can I just restore
the Sun complete, the Tue night differential and the last Transaction Log
from Wed?
I think my actual question is: "Is the Differential backup all the
differences from the last complete or the last Differential, and does the
Transaction Log backup get everything from the last Differential?"
Thanks much
Raymond Fantasia
Fry''s Electronics
ISD DepartmentHi
answered in microsoft.public.sqlserver.newusers
Please do not multi-post as it is harder to know if the question has been
answered yet.
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/
"Ray Fantasia" <RayFantasia@.discussions.microsoft.com> wrote in message
news:A8241F2A-6630-4B96-A9A0-2CB30BEEA7E9@.microsoft.com...
> Greetings all,
> I am new to this Newsgroup, so forgive me if my question seems stupid.
> We currently have a payroll system that runs on SQL Server 2000. We are
> doing a full backup (to a local hard disk) every night of the main
> database,
> which is about 55GB and then sending the SQL Backup off to tape. We can
> keep
> 2, maybe 3 days backup online, but space is getting tight.
> I have suggested that we do 1 complete backup at the beginning of the
> week, then a Differential backup every night, and a transaction log backup
> every couple of hours during the day.
> My question for you people. If I do the complete backup on Sunday
> night, a differential on Monday and Tuesday night, and a couple of
> Transaction Log backups on Wednesday, and the System crashes late
> Wednesday
> do I have to restore both Mon and Tue differential and all the Wed
> Transaction Logs and restoring the complete from Sun, or can I just
> restore
> the Sun complete, the Tue night differential and the last Transaction Log
> from Wed?
> I think my actual question is: "Is the Differential backup all the
> differences from the last complete or the last Differential, and does the
> Transaction Log backup get everything from the last Differential?"
> Thanks much
> Raymond Fantasia
> Fry''s Electronics
> ISD Department

Complete, Differential, Transaction Log -- More backup questions

Greetings all,
I am new to this Newsgroup, so forgive me if my question seems stupid.
We currently have a payroll system that runs on SQL Server 2000. We are
doing a full backup (to a local hard disk) every night of the main database,
which is about 55GB and then sending the SQL Backup off to tape. We can keep
2, maybe 3 days backup online, but space is getting tight.
I have suggested that we do 1 complete backup at the beginning of the
week, then a Differential backup every night, and a transaction log backup
every couple of hours during the day.
My question for you people. If I do the complete backup on Sunday
night, a differential on Monday and Tuesday night, and a couple of
Transaction Log backups on Wednesday, and the System crashes late Wednesday
do I have to restore both Mon and Tue differential and all the Wed
Transaction Logs and restoring the complete from Sun, or can I just restore
the Sun complete, the Tue night differential and the last Transaction Log
from Wed?
I think my actual question is: "Is the Differential backup all the
differences from the last complete or the last Differential, and does the
Transaction Log backup get everything from the last Differential?"
Thanks much
Raymond Fantasia
Fry''s Electronics
ISD Department
Hi
answered in microsoft.public.sqlserver.newusers
Please do not multi-post as it is harder to know if the question has been
answered yet.
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/
"Ray Fantasia" <RayFantasia@.discussions.microsoft.com> wrote in message
news:A8241F2A-6630-4B96-A9A0-2CB30BEEA7E9@.microsoft.com...
> Greetings all,
> I am new to this Newsgroup, so forgive me if my question seems stupid.
> We currently have a payroll system that runs on SQL Server 2000. We are
> doing a full backup (to a local hard disk) every night of the main
> database,
> which is about 55GB and then sending the SQL Backup off to tape. We can
> keep
> 2, maybe 3 days backup online, but space is getting tight.
> I have suggested that we do 1 complete backup at the beginning of the
> week, then a Differential backup every night, and a transaction log backup
> every couple of hours during the day.
> My question for you people. If I do the complete backup on Sunday
> night, a differential on Monday and Tuesday night, and a couple of
> Transaction Log backups on Wednesday, and the System crashes late
> Wednesday
> do I have to restore both Mon and Tue differential and all the Wed
> Transaction Logs and restoring the complete from Sun, or can I just
> restore
> the Sun complete, the Tue night differential and the last Transaction Log
> from Wed?
> I think my actual question is: "Is the Differential backup all the
> differences from the last complete or the last Differential, and does the
> Transaction Log backup get everything from the last Differential?"
> Thanks much
> Raymond Fantasia
> Fry''s Electronics
> ISD Department

complete VB.NET SQL & XML example

is there anybody who can send me a complete vb.net example for saving a
query from sql server 2000 into xml and loading that xml back to server?
thanks!
I need the same thing what you. If you will be have something please send
me: ljag@.wp.pl
Thanks
Uytkownik "dotnet" <bernard@.form.hr> napisa w wiadomoci
news:clqtob$98i$1@.ls219.htnet.hr...
> is there anybody who can send me a complete vb.net example for saving a
> query from sql server 2000 into xml and loading that xml back to server?
> thanks!
>

complete NOOB hope someone can point me in the right direction

I have been programming access databases for 8 years.
Well today I find out that I need to know SQL.
HUH LOL

well I don't have a clue as to how people even enter data into
a sql database or how to manipulate or retrieve data.

Can someone please recommend a book to get me started?

thank you very much for any and all help with this.sparks (jstalnak@.swbell.net) writes:

Quote:

Originally Posted by

I have been programming access databases for 8 years.
Well today I find out that I need to know SQL.
HUH LOL
>
well I don't have a clue as to how people even enter data into
a sql database or how to manipulate or retrieve data.
>
Can someone please recommend a book to get me started?
>
thank you very much for any and all help with this.


Isn't Access an SQL database? Or since you post in this newsgroup,
you specifically mean SQL Server databases?

SQL Server is a server application that accepts data from clients. Clients
can be implemented in a multitude of ways, both as Windows applications
and web applications. You can write applictions in .Net, in Perl, in VB6,
in Java, in about every language. You can even use Access - this appears
in fact to be a common solution.

--
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|||Erland Sommarskog wrote:

Quote:

Originally Posted by

Isn't Access an SQL database?


http://en.wikipedia.org/wiki/Microsoft_Access#Features
One of the benefits of Access from a programmer's perspective is its
relative compatibility with SQL (structured query language) queries may
be viewed and edited as SQL statements, and SQL statements can be used
directly in Macros and VBA Modules to manipulate Access tables. In this
case, "relatively compatible" means that SQL for Access contains many
quirks, and as a result, it has been dubbed "Bill's SQL" by industry
insiders. Users may mix and use both VBA and "Macros" for programming
forms and logic and offers object-oriented possibilities.

Complete newbie to replication, have a question

We have had a server in LocationA for quite some time. The need arose
recently to have a server setup in LocationB due to some bandwidth issues.
LocationB was given a snapshot of the DB @. LocationA when it was first
setup. However, both machines will need to have the same data as both are
used in a production environment. I will probably want to do this nightly.
I have read a lot of posts and webistes, but still am semi in the dark.
About the only thing i've figured out (i think) is that I will need to do
some sort of merge replicaiton.
What do I need to do to get started, a link to a HOW TO for a smiliar setup
would be great. I have read a bit and some mention having a 3rd server, do
i need a 3rd server as the final merged server? I guess more importantly is
a 3rd server an optimal solution?
Any help would be greatly appreciated.
Forgot to mention, I am running SQL Server 2000 on both servers.
"Lucas Graf" <lgraf2000@.comcast.net> wrote in message
news:OjZ0E0bQGHA.5296@.TK2MSFTNGP09.phx.gbl...
> We have had a server in LocationA for quite some time. The need arose
> recently to have a server setup in LocationB due to some bandwidth issues.
> LocationB was given a snapshot of the DB @. LocationA when it was first
> setup. However, both machines will need to have the same data as both are
> used in a production environment. I will probably want to do this
> nightly.
> I have read a lot of posts and webistes, but still am semi in the dark.
> About the only thing i've figured out (i think) is that I will need to do
> some sort of merge replicaiton.
> What do I need to do to get started, a link to a HOW TO for a smiliar
> setup would be great. I have read a bit and some mention having a 3rd
> server, do i need a 3rd server as the final merged server? I guess more
> importantly is a 3rd server an optimal solution?
> Any help would be greatly appreciated.
>
|||In merge replication you will have Distributor, Publisher and Subscriber.
They are different roles for a replication setup but they can be on the same
physical machine. I think the 3rd server you mentioned is distributor. You
can setup the distributor on the same server with the publisher, so you
don't need a third machine.
Yi Chen
"Lucas Graf" <lgraf2000@.comcast.net> wrote in message
news:OjZ0E0bQGHA.5296@.TK2MSFTNGP09.phx.gbl...
> We have had a server in LocationA for quite some time. The need arose
> recently to have a server setup in LocationB due to some bandwidth issues.
> LocationB was given a snapshot of the DB @. LocationA when it was first
> setup. However, both machines will need to have the same data as both are
> used in a production environment. I will probably want to do this
> nightly.
> I have read a lot of posts and webistes, but still am semi in the dark.
> About the only thing i've figured out (i think) is that I will need to do
> some sort of merge replicaiton.
> What do I need to do to get started, a link to a HOW TO for a smiliar
> setup would be great. I have read a bit and some mention having a 3rd
> server, do i need a 3rd server as the final merged server? I guess more
> importantly is a 3rd server an optimal solution?
> Any help would be greatly appreciated.
>
|||Ok. That makes sense.
I have been messing around trying to set it up today, and am still lost.
Currently the 2 servers are out of sync. Both have data the other doesn't.
What do I need to do to get them both to have the same data now, and then
keep them replciating from here on out?
"Yi Chen [MSFT]" <yiche@.online.microsoft.com> wrote in message
news:%23o7jSucQGHA.1204@.TK2MSFTNGP12.phx.gbl...
> In merge replication you will have Distributor, Publisher and Subscriber.
> They are different roles for a replication setup but they can be on the
> same physical machine. I think the 3rd server you mentioned is
> distributor. You can setup the distributor on the same server with the
> publisher, so you don't need a third machine.
> Yi Chen
> "Lucas Graf" <lgraf2000@.comcast.net> wrote in message
> news:OjZ0E0bQGHA.5296@.TK2MSFTNGP09.phx.gbl...
>
|||Lucas Graf wrote:
> We have had a server in LocationA for quite some time. The need arose
> recently to have a server setup in LocationB due to some bandwidth issues.
> LocationB was given a snapshot of the DB @. LocationA when it was first
> setup. However, both machines will need to have the same data as both are
> used in a production environment. I will probably want to do this nightly.
> I have read a lot of posts and webistes, but still am semi in the dark.
> About the only thing i've figured out (i think) is that I will need to do
> some sort of merge replicaiton.
> What do I need to do to get started, a link to a HOW TO for a smiliar setup
> would be great. I have read a bit and some mention having a 3rd server, do
> i need a 3rd server as the final merged server? I guess more importantly is
> a 3rd server an optimal solution?
> Any help would be greatly appreciated.
|||Lucas,
presumably you have initialized the subscriber and are using merge
replication? If so, you just need to synchronize the subscriber to have the
data merged. You'll need to consider who should win conflicts (publisher by
default) and if conflicts should be allowed (filtering).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Ok.
I got this far and was tentative on going further. I will keep trucking and
see what else may come up that causes issues. Thanks for the help so far, I
hope to report back a positive experience.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23ogHO4uQGHA.2628@.TK2MSFTNGP15.phx.gbl...
> Lucas,
> presumably you have initialized the subscriber and are using merge
> replication? If so, you just need to synchronize the subscriber to have
> the data merged. You'll need to consider who should win conflicts
> (publisher by default) and if conflicts should be allowed (filtering).
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||I guess I am still confused w/the whole publisher/distributor thing.
Since I want both servers to merge both of their data are they both set to
publishers and distributors? Or is only 1 a publisher and both distributors
and subscribers?
So confused..
"Lucas Graf" <lgraf2000@.comcast.net> wrote in message
news:Ob$pMuzQGHA.2436@.TK2MSFTNGP11.phx.gbl...
> Ok.
> I got this far and was tentative on going further. I will keep trucking
> and see what else may come up that causes issues. Thanks for the help so
> far, I hope to report back a positive experience.
>
> "Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
> news:%23ogHO4uQGHA.2628@.TK2MSFTNGP15.phx.gbl...
>
|||Ok.
ServerA
I have set him to a Distributor, Publisher and set the Database i want to
publish to the other server as the "push" datatabase. All seems good on
ServerA.
ServerB
Not sure what to do here so its data gets pushed to ServerA to be merged
there as well. Everything I try i end up getting the error "You cannot
create a merge replicaion in database xxxc. The database contains one or
more merge subscritptions that are anonymous or that use the Priority of the
Publisher when resolving conflicts."
"Lucas Graf" <lgraf@.nvidia.com> wrote in message
news:uSQuaI8QGHA.5552@.TK2MSFTNGP14.phx.gbl...
>I guess I am still confused w/the whole publisher/distributor thing.
> Since I want both servers to merge both of their data are they both set to
> publishers and distributors? Or is only 1 a publisher and both
> distributors and subscribers?
> So confused..
>
> "Lucas Graf" <lgraf2000@.comcast.net> wrote in message
> news:Ob$pMuzQGHA.2436@.TK2MSFTNGP11.phx.gbl...
>
|||Maybe Bidirectional Transactional Replication is more what I am looking for?
"Lucas Graf" <lgraf@.nvidia.com> wrote in message
news:uSQuaI8QGHA.5552@.TK2MSFTNGP14.phx.gbl...
>I guess I am still confused w/the whole publisher/distributor thing.
> Since I want both servers to merge both of their data are they both set to
> publishers and distributors? Or is only 1 a publisher and both
> distributors and subscribers?
> So confused..
>
> "Lucas Graf" <lgraf2000@.comcast.net> wrote in message
> news:Ob$pMuzQGHA.2436@.TK2MSFTNGP11.phx.gbl...
>

Complete Newbie Question

I have just installed Reporting Services and created a few reports that
I want to run in a web page - that seems easy enough to do but my boss
has asked me to provide a batch reporting solution.
He wants users to be able to request a report and the request be
written away to a sql db. I have a windows service that picks up all
new requests and fires up some .exe's depending on what sort of request
it is e.g password reset , password reminder etc..
When the reports are run I need them to be saved as PDF's into a
specific folder that can be accessed later from a web page.
Now all this is written and working using ActiveReports for .NET but we
hate that package and want to use sql reporting services. Can it be
done in sql reporting services and if so how do I do it - I mean I need
some real code examples
any help would be brilliant
cheers
JimI have been using log4net to log to SQL DB. You can log the web request when
reports are rendered. It is upto you to write the logic to who views the
page( for eg using session object who the user was like,
Session["UserName"]). log4net allows you to log when certain events are
triggered blah blah... Check out:
http://logging.apache.org/log4net/release/config-examples.html
Look for ADONETAppender which is what you want.
HTH
Rajesh Meenrajan
MCSD.NET
http://meenrajan.blogspot.com
"JimW13UK" wrote:
> I have just installed Reporting Services and created a few reports that
> I want to run in a web page - that seems easy enough to do but my boss
> has asked me to provide a batch reporting solution.
> He wants users to be able to request a report and the request be
> written away to a sql db. I have a windows service that picks up all
> new requests and fires up some .exe's depending on what sort of request
> it is e.g password reset , password reminder etc..
> When the reports are run I need them to be saved as PDF's into a
> specific folder that can be accessed later from a web page.
> Now all this is written and working using ActiveReports for .NET but we
> hate that package and want to use sql reporting services. Can it be
> done in sql reporting services and if so how do I do it - I mean I need
> some real code examples
> any help would be brilliant
> cheers
> Jim
>

COMPLETE NEWBIE - sorry :-(

I have mysql running on a windows2003 webserver - it runs a
messageboard and oscommerce. Potential new client wants to replicate
information from the website to her server - is this possible with
mysql or do I need to install sql (proper) ... sorry if I sound like I
don't know fully what I am doing - i dont!!
Any advice or pointers given would be greatly appreciated.
thanks
Jeff
Jeff/Andrew,
this is a MS SQL Server Replication newsgroup - surely there are dedicated
MySQL discussion boards?
Rgds,
Paul Ibison
|||On Sun, 24 Apr 2005 19:07:16 +0100, "Paul Ibison"
<Paul.Ibison@.Pygmalion.Com> wrote:

>Jeff/Andrew,
>this is a MS SQL Server Replication newsgroup - surely there are dedicated
>MySQL discussion boards?
>Rgds,
>Paul Ibison
>
I can't find one and I suspect I will end up installing SQL for
replication - can someone please advise?
|||Have a look at http://forums.mysql.com/list.php?26
From the point of view of SQL Server Replication, you can certainly achieve
your aim. For the new client you need to consider latency (time between
change on the publisher and corresponding change arriving at the subscriber)
, autonomy (can they be offline) and if the subscriber is read-only or
read-write. Answering these will lead to the correct type of replication.
Having SQL Server on the webserver would mean this is the publisher.
Heterogenous subscribers are supported to differing extents, but
connectivity to MYSQL is possible and is illustrated in Hilary's book below.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||while I'd love you to buy my book
1) its covered on the free downloadable sample chapter
http://www.nwsu.com/lowres_replication_ch02.pdf
2) Replication to MySQL doesn't work - or works until the distribution agent
stops and then you have to resync to get it working again due to a SQL
Server bug.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23CtbxJQSFHA.2748@.TK2MSFTNGP09.phx.gbl...
> Have a look at http://forums.mysql.com/list.php?26
> From the point of view of SQL Server Replication, you can certainly
> achieve your aim. For the new client you need to consider latency (time
> between change on the publisher and corresponding change arriving at the
> subscriber) , autonomy (can they be offline) and if the subscriber is
> read-only or read-write. Answering these will lead to the correct type of
> replication. Having SQL Server on the webserver would mean this is the
> publisher. Heterogenous subscribers are supported to differing extents,
> but connectivity to MYSQL is possible and is illustrated in Hilary's book
> below.
> HTH,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Interesting - thanks for the clarification. In that case your (Andrew's)
client might want to consider MSDE as a replacement for a MySQL subscriber.
Rgds,
Paul Ibison

complete newbie

would someone me so good as to help me out with the script for a basic
customer table ? , usualy fields, userid (primary key) name, address,
creditcard number, card type, phone number, email address?

TIAHi

Look at

http://www.databaseanswers.org/data_models/index.htm

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/

"strawberry" <1@.2.com> wrote in message
news:6iA9e.13718$DU6.5013@.newsfe1-gui.ntli.net...
> would someone me so good as to help me out with the script for a basic
> customer table ? , usualy fields, userid (primary key) name, address,
> creditcard number, card type, phone number, email address?
>
> TIA

Complete Neophyte Question(s)

I have inherited a SQL Server (2005) from an outgoing DBA and while I'm
familiar with databases from a data structure/manipulation standpoint, the
permissions/security model in SQL Server 2005 has baffled me thus far. I
digress...
As far as I can tell, our previous DBA create a role which is called
SP_Exec. I know that this role has permissions defined somehow, but I'll be
damned if I can figure it out. One of our users can modify a particular
view, and another can't. The only difference I can see is that one is a
member of this role and the other isn't. If I remove the role from the user
who CAN modify the view, he no longer can. Alas, I have no idea where this
is defined.
Schemas are also slightly confusing, but I imagine that's just a way of
logically grouping sets of objects. At first glance it seems everything is
utilizing the a schema called dbo. One of our users was having trouble
until I went into the schema and added "View Definition" as a permission.
I'm not even certain what this effectively did, but it solved the problem
while I try to figure out how this whole thing works.
Can anyone point me in the direction of a document that explains this in
English? Perhaps the majority of my hang-ups are with Management Studio and
not the actual structure of the overall permissions model. ANY help would
be appreciated.I'd recommend that you go for a training course ;-)
"James" <minorkeys@.gmail.com> wrote in message
news:eVtdKXmuHHA.1168@.TK2MSFTNGP02.phx.gbl...
>I have inherited a SQL Server (2005) from an outgoing DBA and while I'm
>familiar with databases from a data structure/manipulation standpoint, the
>permissions/security model in SQL Server 2005 has baffled me thus far. I
>digress...
> As far as I can tell, our previous DBA create a role which is called
> SP_Exec. I know that this role has permissions defined somehow, but I'll
> be damned if I can figure it out. One of our users can modify a
> particular view, and another can't. The only difference I can see is that
> one is a member of this role and the other isn't. If I remove the role
> from the user who CAN modify the view, he no longer can. Alas, I have no
> idea where this is defined.
> Schemas are also slightly confusing, but I imagine that's just a way of
> logically grouping sets of objects. At first glance it seems everything
> is utilizing the a schema called dbo. One of our users was having trouble
> until I went into the schema and added "View Definition" as a permission.
> I'm not even certain what this effectively did, but it solved the problem
> while I try to figure out how this whole thing works.
> Can anyone point me in the direction of a document that explains this in
> English? Perhaps the majority of my hang-ups are with Management Studio
> and not the actual structure of the overall permissions model. ANY help
> would be appreciated.
>|||James (minorkeys@.gmail.com) writes:
> I have inherited a SQL Server (2005) from an outgoing DBA and while I'm
> familiar with databases from a data structure/manipulation standpoint, the
> permissions/security model in SQL Server 2005 has baffled me thus far.
From having been very simple-minded in SQL 4.x, it is now quite sophisticate
d.

> As far as I can tell, our previous DBA create a role which is called
> SP_Exec. I know that this role has permissions defined somehow, but I'll > be dam
ned if I can figure it out.
In Object Explorer, Databases->yourdb->Security->Roles->Database Roles.
Find the role of interest, and click Properties in the context menu.
Go to the Seucrables tab.
Normally, you grant permissions to roles, and then add users to the
roles. If you were to grant rights to users directly, it would be more
difficult to managed.

> Schemas are also slightly confusing, but I imagine that's just a way of
> logically grouping sets of objects.
Right. There are some security features related to schemas. If you add
an object to a schema owned by someone else, the schema owner becomes
the object that you created. It is also possible to grant permissions
on a schmea, which implies that you get permissions to all existing
and future objects in the schema to which the permissions apply.

> At first glance it seems everything is utilizing the a schema called
> dbo. One of our users was having trouble until I went into the schema
> and added "View Definition" as a permission.
In SQL 2005, users are only permitted to see objects they have permission
to. This is a change from SQL 2000 where the metadata was visible to
all users.

> Can anyone point me in the direction of a document that explains this in
> English? Perhaps the majority of my hang-ups are with Management Studio
> and not the actual structure of the overall permissions model. ANY help
> would be appreciated.
The normal starting point would be
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/5d43fefc-5aa4-43d7-aedb-7808
659449c5.htm
in Books Online, but admittedly Books Online is surprisingly thin on
some of the permission topics.
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|||Thank you very much. I believe I have my head wrapped around this better.
When I go to the Securables tab for this role, there are no objects in the
listbox. Simply an Add button. Yet, if I view the properties of certain
stored procedures it will have that role listed with execute permissions.
This seems like a simple request, but all I want is to see the objects that
a certain role has permissions on, and what those permissions are?
Rhetorical: Why is this so difficult/counter-intuitive?
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns995FC3C3DACYazorman@.127.0.0.1...
> James (minorkeys@.gmail.com) writes:
> From having been very simple-minded in SQL 4.x, it is now quite
> sophisticated.
>
> In Object Explorer, Databases->yourdb->Security->Roles->Database Roles.
> Find the role of interest, and click Properties in the context menu.
> Go to the Seucrables tab.
> Normally, you grant permissions to roles, and then add users to the
> roles. If you were to grant rights to users directly, it would be more
> difficult to managed.
>
> Right. There are some security features related to schemas. If you add
> an object to a schema owned by someone else, the schema owner becomes
> the object that you created. It is also possible to grant permissions
> on a schmea, which implies that you get permissions to all existing
> and future objects in the schema to which the permissions apply.
>
> In SQL 2005, users are only permitted to see objects they have permission
> to. This is a change from SQL 2000 where the metadata was visible to
> all users.
>
> The normal starting point would be
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/5d43fefc-5aa4-43d7-aedb-78
08659449c5.htm
> in Books Online, but admittedly Books Online is surprisingly thin on
> some of the permission topics.
>
> --
> 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|||James (minorkeys@.gmail.com) writes:
> Thank you very much. I believe I have my head wrapped around this better.
> When I go to the Securables tab for this role, there are no objects in the
> listbox. Simply an Add button. Yet, if I view the properties of certain
> stored procedures it will have that role listed with execute permissions.
> This seems like a simple request, but all I want is to see the objects
> that a certain role has permissions on, and what those permissions are?
> Rhetorical: Why is this so difficult/counter-intuitive?
I did some research, and I think I have the answer. If you do Help->About
what version do you get for Managment Studio? My guess is that you will
see something 9.00.1399 or 9.00.2047, that is either RTM or SP1. To wit,
when I try this on SP1 of SSMS, I don't see the securables, but SP2 gives
me the list of objects.
You can find the latest service pack for SQL Server on
http://support.microsoft.com/kb/913089/.
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|||I don't use the word hero very often, but you sir, are the greatest hero of
all time. Thank you for confirming I'm not insane. SP2 has caused the
Securables tab to populate properly and now it actually makes sense.
The only other issue that I'm trying to wrap my head around and can't seem
to google well is the difference between "GRANT" and "WITH GRANT". Can you
enlighten me?
Thank you a million times over!
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns996577CE42B7BYazorman@.127.0.0.1...
> James (minorkeys@.gmail.com) writes:
> I did some research, and I think I have the answer. If you do Help->About
> what version do you get for Managment Studio? My guess is that you will
> see something 9.00.1399 or 9.00.2047, that is either RTM or SP1. To wit,
> when I try this on SP1 of SSMS, I don't see the securables, but SP2 gives
> me the list of objects.
> You can find the latest service pack for SQL Server on
> http://support.microsoft.com/kb/913089/.
>
> --
> 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|||Disregard, seems my google-ing skills were lacking.
More generic question as I'm messing with the Northwind database to get a
thorough understanding of this. If a user isn't a member of any roles and
has no permissions explicitly defined, does it err on the side of deny or
grant? Or does that depend on the permission? Right now I have a user who
has Connect as the only database level permission, no roles, no secureables
but can still view definition, it seems. I'm able to connect and view all
of the tables, although everything else seems locked down. I have refreshed
and can still see them.
Either way, thanks again. I'm much much further than I was yesterday at
this time.
"James" <minorkeys@.gmail.com> wrote in message
news:uFdBmN%23vHHA.2304@.TK2MSFTNGP06.phx.gbl...
>I don't use the word hero very often, but you sir, are the greatest hero of
>all time. Thank you for confirming I'm not insane. SP2 has caused the
>Securables tab to populate properly and now it actually makes sense.
> The only other issue that I'm trying to wrap my head around and can't seem
> to google well is the difference between "GRANT" and "WITH GRANT". Can
> you enlighten me?
> Thank you a million times over!
> "Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
> news:Xns996577CE42B7BYazorman@.127.0.0.1...
>|||James (minorkeys@.gmail.com) writes:
> Disregard, seems my google-ing skills were lacking.
You should not have to go Google to find out what WITH GRANT means. SQL
Server comes with online documentation on you hard disk.
WITH GRANT is one of the more esotheric features in SQL Server in my
opinion, but maybe that says more about the simplistic security of the
system I work with.

> More generic question as I'm messing with the Northwind database to get
> a thorough understanding of this. If a user isn't a member of any roles
> and has no permissions explicitly defined, does it err on the side of
> deny or grant? Or does that depend on the permission? Right now I have
> a user who has Connect as the only database level permission, no roles,
> no secureables but can still view definition, it seems. I'm able to
> connect and view all of the tables, although everything else seems
> locked down. I have refreshed and can still see them.
If no permissions have been granted, then you have no permissions. That is,
if run the below in a database, the SELECT should not return anything:
CREATE LOGIN erik WITH PASSWORD='rtsoppa'
go
CREATE USER erik
go
EXECUTE AS LOGIN = 'erik'
go
SELECT name FROM sys.objects
go
REVERT
go
DROP USER erik
go
DROP LOGIN erik
...unless rights have been granted to the public role.
In SQL 2005 a user only has permission to see the definition of objects
to which he been granted some access. More exactly he needs VIEW DEFINITION,
but this permission is implied if he already has SELECT permission.
Where DENY comes in is that it overrides GRANT. Say that a user is a member
of a role that has SELECT permission to a table X, but that himself he
has been denied access to the table. Then he cannot access that table.
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|||That makes complete sense to me, but somehow I'm overlooking something.
I have a user named james on a database. If I go into properties for that
user they have no owned schemas. They have no role membership (including
public, which isn't listed here for some reason). If I right-click the
database and go to properties -> Permissions, the only permission they have
is Connect, not view definition.
The only thing I can see is that there's a login of the same name at the
server level which is a member of the Server Role public, but my
understanding is that it's unrelated.
So the long and the short of it, is that this user can view definition on
this database, and I can't figure out why.
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns996668C8847CBYazorman@.127.0.0.1...
> James (minorkeys@.gmail.com) writes:
> You should not have to go Google to find out what WITH GRANT means. SQL
> Server comes with online documentation on you hard disk.
> WITH GRANT is one of the more esotheric features in SQL Server in my
> opinion, but maybe that says more about the simplistic security of the
> system I work with.
>
> If no permissions have been granted, then you have no permissions. That
> is,
> if run the below in a database, the SELECT should not return anything:
> CREATE LOGIN erik WITH PASSWORD='rtsoppa'
> go
> CREATE USER erik
> go
> EXECUTE AS LOGIN = 'erik'
> go
> SELECT name FROM sys.objects
> go
> REVERT
> go
> DROP USER erik
> go
> DROP LOGIN erik
> ...unless rights have been granted to the public role.
> In SQL 2005 a user only has permission to see the definition of objects
> to which he been granted some access. More exactly he needs VIEW
> DEFINITION,
> but this permission is implied if he already has SELECT permission.
> Where DENY comes in is that it overrides GRANT. Say that a user is a
> member
> of a role that has SELECT permission to a table X, but that himself he
> has been denied access to the table. Then he cannot access that table.
>
>
> --
> 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|||James (minorkeys@.gmail.com) writes:
> That makes complete sense to me, but somehow I'm overlooking something.
> I have a user named james on a database. If I go into properties for
> that user they have no owned schemas. They have no role membership
> (including public, which isn't listed here for some reason). If I
> right-click the database and go to properties -> Permissions, the only
> permission they have is Connect, not view definition.
> The only thing I can see is that there's a login of the same name at the
> server level which is a member of the Server Role public, but my
> understanding is that it's unrelated.
> So the long and the short of it, is that this user can view definition on
> this database, and I can't figure out why.
If you under database roles look at the public role, does it have any
permissions on anything?
If you run:
execute as login = 'james'
go
select * from sys.fn_my_permissions('dbo.Orders', 'object')
go
revert
What do you see?
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

Complete list of error codes

Does anyone know where to obtain a complete list of error codes which can occur in SQL Server ? For example : errror number 547 is a foreign key violation - where can I get a complete list of these numbers and there descritions ?

I can't find it in BOL or anywhere

In BOL type in 'errors-SQL Server' in the search box in the index tab and they are listed starting with Error 10008 (DB-Library)

you can also take a look here

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_syserrors1a_10mx.asp

Denis the SQL Menace

http://sqlservercode.blogspot.com/

Complete idiot in dire need of help. :)

Alright, I've been trying to get this working for for-friggin ever, but it doesn't seem to work... :(

Here's the script:

<%
Set Text = request.form ("textfield")
Text = escape(Text)
Text = Replace(Text,"%0D%0A","<br>")
Text = unescape(Text)

Dim DB
Set DB = Server.CreateObject ("ADODB.Connection")
DB.Mode = adModeReadWrite
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + "DB\example.mdb")
Dim RS
Set RS = Server.CreateObject ("ADODB.Recordset")
RS.Open "startpage", DB, adOpenDynamic
RS.AddNew
RS ("content") = Text
RS.Update
%>

And I get:
ADODB.Recordset- Error '800a0cb3'

Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.

H:\Web Server\htdocs\CCI\forms2.asp, line 14

Guessing this is because i am, as the subject suggests, a complete idiot. :P

So perhaps someone here would find it in their heart to enlighten me?On closer inspection, that probably shouldve been posted in the ASP forum, huh?

Complete Idiot calling all intelligent lifeforms

Hi all, I run several contact websites. One of them is www.ramc.org.uk - they used to fill in a form and results emailed to me. I then manually copied and pasted into page on server. Very tiresome.

I was hoping with sql express i could create a page where they enter there details into the database after verifying details via a link..... Then as the new details are added they would be displayed on the contacts page in alphabetical order.

Is this really possible or even feasable.

Cheers, your all stars. Mark

Yep, almost all websites where you enter data have the data entered into a database of some sort. The data is usually entered through the webpage.|||

Yes it's possible but it will take some code. My experience is in useing Visual Studio, it can be written in Visual Basic.Net, C# or any other language that will run in Visual Studio. On the web page you would create the form and bind the fields to a SQL database. When the user clicks the submit button on your page the data would be stored in your database. Look for someone with some Visual Studio and SQL experience. It's shouldn't to to hard.

Visual Studio and SQL are all Microsoft stuff. Some people do the same thing using Linux, PHP and MySql.

|||Thanks for your help guys. I need to start looking for a 12 yr old who can do it for me. I'm limited to html. I was hoping i could just link the web page to database then results page display the data. Cheers.|||

Simple usage is not overly complex.

I suggest you visit www.ASP.NET. Under the large GREEN #3 [Learn ASP.NET], there are options for:

ASP.NET Video Tutorials
Starter Kits (Ready Made Sites)

Complete grammar for SQL 2000 and 2005?

I would like to build a TSQL parser and lexer for various reasons. One of them involves complex data import procedures where we need to ensure that columns are populated before they are used as data sources or criteria for other columns. There are actually many very cool and useful things that could be done with a good TSQL parser.

My question is this: are there any grammars available online for DDL, DML, whatever you call the DBCC statements, etc.? I should think Microsoft would have to have something like an EBNF for their own parsers; would it be possible to make them public?
No. The grammar for TSQL is not public information. Why does data import procedures need to look at the code? You can verify data post or pre or during processing or declaratively using foreign keys, constraints, indexed views etc.|||Declarative programming has limits that we have exceeded. Constraints simply won't catch all of the errors that can and have happened to us. The alternative to what I describe is painstaking checking of code, work that can and therefore should be done automatically.

Another use for the parser would be to build a little editor that provides intellisense and also shows better error messages, such as in cases where a column name is ambiguous (why not use intellisense to suggest one of the valid aliases/table names?). Usage of indexes in queries could be indicated by coloring of column names, extended properties of columns could be displayed using tooltips, etc. Basically, I have a desire to bring the sort of power of Visual Studio 2005 offers C# developers to SQL developers. It would be much easier to do this with a grammar from Microsoft, instead of building my own via trial and error. To be honest, I should think Microsoft would be in favor of such tools, as they would provide additional incentive for developers to use SQL Server.

|||

I agree that a parser will help for providing more productive environment. But I just do not see how it helps to check data purity for instance. In most cases, you will have to analyze complex procedural logic which may or may not be entirely on the server-side. So it is probably best to catch those at the source or destination.

Anyway, I don't know of any plans in the near future to release the grammar for TSQL or SQL implementation. If you are using ANSI SQL compatible coding standards then you can get the grammar for free on the internet. This should help you for the SQL part not TSQL syntax.

|||The data import process works like the following. I first preprocess a single text file I receive from a client and generate several tab-delimited files consumable by BCP. Along with the files, I create format files based on metadata. I run BCP, dumping the data in a primary table. After that, I run numerous scripts against the data to converting text codes to foreign keys, verify data adhere to specified formats, categorize data using fairly complex SQL statements, etc. Some statements depend on the values assigned by previous statements. Once the complexity of this interdependence gets to a certain level, it gets to be a pain to maintain. Verifying correctness would be trivial if I could parse SQL and see which fields are assigned to, which fields are assigned from, and which fields are used in criteria. The alternative is to manually recreate these three collections of fields.

The above is not the only use I have for TSQL parsing. Our current application is based of a metadata architecture used to describe databases so that our client has absolutely zero database-specific code. This involves, among other things, a query generation engine that probably equals if not exceeds the abilities of the .NET 3.5 Entity Framework. We now have two versions of the query generation engine: a VB6 one and a C# one. It would be invaluable to test the C# one by ensuring that it generates the same effective SQL as the VB6 one. I would rather not enforce character-for-character equality -- my time can be spent in better ways that completely reverse engineering the old algorithm so that the new one matches the old character-for-character. Being able to treat TSQL code as data, Lisp style, is the best solution.

I don't want to come off as sounding antagonistic, although it may be too late. I just don't understand why Microsoft wants to make my life (and by proxy, of many of their loyal developers) harder by not providing a completely derivable piece of data. I wouldn't be competing with them by having a full grammar; I would be enhancing one of their existing products, making it more lucrative. Surely Microsoft understands the power of treating code as data -- there is the CodeDom for generating .NET code, and the .NET GC was originally prototyped in Lisp, a language renowned for its treatment of code as data. DLINQ depends on Expression<T>, which can be generated by lambda functions, which are code converted to data.

I have a feeling all of the above is for nought. My impression is that Microsoft can be completely opaque if it wants and a little guy like me has no chance in getting any sort of insightful answer from them to a question like this. I would absolutely love to be wrong!

Microsoft understands how much of a big deal intellisense is.

Complete Execution History of a report

Hi,

I have some reports(both parameterized and non-parameterized) for which I need to have an execution history on the report server. These are not scheduled and so the history should only be for the instances when users view the report.

I checked the 'Store all report execution snapshots in history' but it does not store the snapshot in history everytime the report is viewed. What do I do to achieve this?

Thanks

One way is to query the ExecutionLog table in the Reporting Services Database. You will need to join to the Catalog table to retrieve the report names. The only issue here is that the ExectutionLog table is cleaned out periodically (monthly?) so you will only get the last month's worth of executions.

I have copies of the ExecutionLog and Catalog table created in another database and run a job to update them every few minutes. I run a Reporting Statisitcs report off these tables.

regards

Ray

|||

You may also want to read this RS 2005 technical article: http://msdn.microsoft.com/library/en-us/dnsql90/html/RSMnRptExPf.asp

-- Robert

|||

Hi Robert,

Thanks for your the link. However, I do not need the detailed execution statistics provided by the solution. I simply want the report snapshot to be stored in history whenever a report is viewed/run. This behaviour is by default in Crystal Enterprise 10 and I thought it would be reasonably simple in Reporting Services as well. Is the answer no ?

Thanks again,

Hemil.

|||SSRS supports automatically creating history snapshots for reports which are set to execute from a snapshot. Each time the snapshot is updated, it will be added to report history. That said, we do not support automatically creating history for every single live execution. I am not certain how useful that would be...|||

Considering this sceranio...there are three users of the same 'roles' who can access the same report. At any time whoever generates the report the first time. It will be kept in the history folder. When the rest of the users checks on the history they know who's has generated the report and that they themselve need not generate the reports ( since someone has done). I guess in this situation...it would be useful to describe why he needs that facility?

Regards

Alu

Complete Execution History of a report

Hi,

I have some reports(both parameterized and non-parameterized) for which I need to have an execution history on the report server. These are not scheduled and so the history should only be for the instances when users view the report.

I checked the 'Store all report execution snapshots in history' but it does not store the snapshot in history everytime the report is viewed. What do I do to achieve this?

Thanks

One way is to query the ExecutionLog table in the Reporting Services Database. You will need to join to the Catalog table to retrieve the report names. The only issue here is that the ExectutionLog table is cleaned out periodically (monthly?) so you will only get the last month's worth of executions.

I have copies of the ExecutionLog and Catalog table created in another database and run a job to update them every few minutes. I run a Reporting Statisitcs report off these tables.

regards

Ray

|||

You may also want to read this RS 2005 technical article: http://msdn.microsoft.com/library/en-us/dnsql90/html/RSMnRptExPf.asp

-- Robert

|||

Hi Robert,

Thanks for your the link. However, I do not need the detailed execution statistics provided by the solution. I simply want the report snapshot to be stored in history whenever a report is viewed/run. This behaviour is by default in Crystal Enterprise 10 and I thought it would be reasonably simple in Reporting Services as well. Is the answer no ?

Thanks again,

Hemil.

|||SSRS supports automatically creating history snapshots for reports which are set to execute from a snapshot. Each time the snapshot is updated, it will be added to report history. That said, we do not support automatically creating history for every single live execution. I am not certain how useful that would be...|||

Considering this sceranio...there are three users of the same 'roles' who can access the same report. At any time whoever generates the report the first time. It will be kept in the history folder. When the rest of the users checks on the history they know who's has generated the report and that they themselve need not generate the reports ( since someone has done). I guess in this situation...it would be useful to describe why he needs that facility?

Regards

Alu

Complete Command of given PID

Hi,
we sometimes have statements which seem to block the whole server.
now i use this to get information of running processes:
SELECT
spid,
kpid,
status,
hostname
, USER_NAME(uid)
, program_name
, DB_NAME(dbid)
, memusage,*
FROM
master.dbo.sysprocesses
WHERE
status = 'runnable'
ORDER BY
status
aSC
the cmd row only shows the single first row of the statement,
so i cant get the information where the statement really comes from.
is there a way to get it all? maybe the whole statment or
sp_ text which is running inside this pid?
thanks,
peppiAs an alternative, have you considered using the SQL Profiler?|||Yes,-)
sometimes bad processes are running on 100% cpu and i cant even start
enterprise manager. only thing i can get running is queryanalyzer, so
i need some handy stuff to get information to kill some tasks and
see where it came from first.
i found fn_get_sql migt be useful,
maybe someone has got a procedure which gets all running tasks and
shows the text in one procedure?
thanks,
mike|||This may help
http://www.sommarskog.se/sqlutil/aba_lockinfo.html|||If you have PID with you,
run =>
DBCC INPUTBUFFER(PID),
to get the query rather than getting it from sysprocess...
If you have to monitor more and need to get the full query use Profiler.
Thanks,
Sree
"markc600@.hotmail.com" wrote:

> As an alternative, have you considered using the SQL Profiler?
>

complete bkup & log size

Hi ,
does a complete backup automatically reduce a log file size by removing
the inactive entries and those already written to the database ?
i have created a completed database backup on a weeklt basis but it still
seem that the log file is quite huge around 11 GB ?
could anyone kindly advise how i can approach this backup issue ?
tks & rdgsBackups do not reduce the size of any files. You must issue regular log
backups in addition to FULL backups if your database recover model is set to
FULL. or Bulk Logged. If you don't wish to do log backups you should change
it to simple mode. To shrink the file once you have fixed the process you
can use DBCC SHRINKFILE.
--
Andrew J. Kelly SQL MVP
"maxzsim" <maxzsim@.discussions.microsoft.com> wrote in message
news:4BF03439-3AA2-4B9C-9E90-D9C046F88A29@.microsoft.com...
> Hi ,
> does a complete backup automatically reduce a log file size by removing
> the inactive entries and those already written to the database ?
> i have created a completed database backup on a weeklt basis but it still
> seem that the log file is quite huge around 11 GB ?
> could anyone kindly advise how i can approach this backup issue ?
> tks & rdgs

complete bkup & log size

Hi ,
does a complete backup automatically reduce a log file size by removing
the inactive entries and those already written to the database ?
i have created a completed database backup on a weeklt basis but it still
seem that the log file is quite huge around 11 GB ?
could anyone kindly advise how i can approach this backup issue ?
tks & rdgsBackups do not reduce the size of any files. You must issue regular log
backups in addition to FULL backups if your database recover model is set to
FULL. or Bulk Logged. If you don't wish to do log backups you should change
it to simple mode. To shrink the file once you have fixed the process you
can use DBCC SHRINKFILE.
Andrew J. Kelly SQL MVP
"maxzsim" <maxzsim@.discussions.microsoft.com> wrote in message
news:4BF03439-3AA2-4B9C-9E90-D9C046F88A29@.microsoft.com...
> Hi ,
> does a complete backup automatically reduce a log file size by removing
> the inactive entries and those already written to the database ?
> i have created a completed database backup on a weeklt basis but it still
> seem that the log file is quite huge around 11 GB ?
> could anyone kindly advise how i can approach this backup issue ?
> tks & rdgs