Showing posts with label purpose. Show all posts
Showing posts with label purpose. Show all posts

Friday, March 23, 2012

purpose of writing dates in this format

hi Experts,
what is the purpose writing a date in the following format:

where x.event_date >= {ts '1980-01-01 00:00:00'}
versus like this:
where x.event_date >= '1980-01-01 00:00:00'

what benifit does it add to later form of writing?
Thanks in advance.
schal.On 15.01.2007 16:34, schal wrote:

Quote:

Originally Posted by

hi Experts,
what is the purpose writing a date in the following format:
>
where x.event_date >= {ts '1980-01-01 00:00:00'}
versus like this:
where x.event_date >= '1980-01-01 00:00:00'
>
what benifit does it add to later form of writing?


It's JDBC / ODBC escape syntax for timestamps.

http://java.sun.com/j2se/1.4.2/docs...ent.html#999472
http://support.microsoft.com/?scid=...142930&x=9&y=15
The former is converted by the ODBC / JDBC driver to some DB specific
binary representation of a timestamp while the latter undergoes
conversion in the DB. I'd generally use the escape syntax as it is more
portable and not affected by session parameters that affect date formatting.

Kind regards

robert|||schal (shivaramchalla@.gmail.com) writes:

Quote:

Originally Posted by

where x.event_date >= {ts '1980-01-01 00:00:00'}
versus like this:
where x.event_date >= '1980-01-01 00:00:00'
>
what benifit does it add to later form of writing?


In addition to Robert's post, Tibor Karaszi's article on date format gives
some more information:
http://www.karaszi.com/SQLServer/info_datetime.asp.

--
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|||robert
Thank you very much for clearing that
Erland
thanks for refering me to the article
the tips are very imformative and helpful
__

Erland Sommarskog wrote:

Quote:

Originally Posted by

schal (shivaramchalla@.gmail.com) writes:

Quote:

Originally Posted by

where x.event_date >= {ts '1980-01-01 00:00:00'}
versus like this:
where x.event_date >= '1980-01-01 00:00:00'

what benifit does it add to later form of writing?


>
In addition to Robert's post, Tibor Karaszi's article on date format gives
some more information:
http://www.karaszi.com/SQLServer/info_datetime.asp.
>
>
--
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

|||Robert,
Thank you very much for clearing that
Erland,
thanks for refering me to the article
the tips are very imformative and helpful
__

Erland Sommarskog wrote:

Quote:

Originally Posted by

schal (shivaramchalla@.gmail.com) writes:

Quote:

Originally Posted by

where x.event_date >= {ts '1980-01-01 00:00:00'}
versus like this:
where x.event_date >= '1980-01-01 00:00:00'

what benifit does it add to later form of writing?


>
In addition to Robert's post, Tibor Karaszi's article on date format gives
some more information:
http://www.karaszi.com/SQLServer/info_datetime.asp.
>
>
--
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

sql

Purpose of SQL Server Agent Service

Can someone explain the purpose of the SQL Server Agent Service?
"Ivan Svaljek" <ivan.svaljek@.gmail.com> wrote in message
news:bc7d369f.0503071452.24917756@.posting.google.c om...
> Can someone explain the purpose of the SQL Server Agent Service?
It lets you schedule jobs.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
|||Not only that, you can also set alerts for certain conditions on the server
and notify operators when a job completes or aborts.
-Argenis
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:uA5C6n2IFHA.904@.tk2msftngp13.phx.gbl...
> "Ivan Svaljek" <ivan.svaljek@.gmail.com> wrote in message
> news:bc7d369f.0503071452.24917756@.posting.google.c om...
> It lets you schedule jobs.
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>

Purpose of SQL Server Agent Service

Can someone explain the purpose of the SQL Server Agent Service?"Ivan Svaljek" <ivan.svaljek@.gmail.com> wrote in message
news:bc7d369f.0503071452.24917756@.posting.google.com...
> Can someone explain the purpose of the SQL Server Agent Service?
It lets you schedule jobs.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--|||Not only that, you can also set alerts for certain conditions on the server
and notify operators when a job completes or aborts.
-Argenis
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:uA5C6n2IFHA.904@.tk2msftngp13.phx.gbl...
> "Ivan Svaljek" <ivan.svaljek@.gmail.com> wrote in message
> news:bc7d369f.0503071452.24917756@.posting.google.com...
> It lets you schedule jobs.
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>

Purpose of SQL Server Agent Service

Can someone explain the purpose of the SQL Server Agent Service?"Ivan Svaljek" <ivan.svaljek@.gmail.com> wrote in message
news:bc7d369f.0503071452.24917756@.posting.google.com...
> Can someone explain the purpose of the SQL Server Agent Service?
It lets you schedule jobs.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--|||Not only that, you can also set alerts for certain conditions on the server
and notify operators when a job completes or aborts.
-Argenis
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:uA5C6n2IFHA.904@.tk2msftngp13.phx.gbl...
> "Ivan Svaljek" <ivan.svaljek@.gmail.com> wrote in message
> news:bc7d369f.0503071452.24917756@.posting.google.com...
> > Can someone explain the purpose of the SQL Server Agent Service?
> It lets you schedule jobs.
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>

purpose of OUTPUT keyword in sql server

hello sirs
purpose OUTPUT keyword with examplessurya (suryaitha@.gmail.com) writes:
> hello sirs
> purpose OUTPUT keyword with examples

You use OUTPUT to specify that a parameter is an output parameter:

CREATE PROCEDURE getordercount @.custid int, @.cnt OUTPUT AS
SELECT @.cnt = COUNT(*) FROM orders WHERE custid = @.custid

What is special with T-SQL, is that you need to specify OUTPUT also when you
call the procedure:

EXEC getordercount @.custid, @.cnt OUTPUT

--
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,

you said right about OUTPUT parameters...
but what about the OUTPUT clause of
DELETE, INSERT and UPDATE statements
in SQL Server 2005?

surya, for more details about the OUTPUT clause see the following link:
http://msdn2.microsoft.com/en-us/library/ms177564.aspx

--
Andrey Odegov
avodeGOV@.yandex.ru
(remove GOV to respond)|||avode (avode_spam@.yahoo.com) writes:
> you said right about OUTPUT parameters...
> but what about the OUTPUT clause of
> DELETE, INSERT and UPDATE statements
> in SQL Server 2005?

Sorry! There's so much new stuff, that I tend to forget some of it.
The OUTPUT clause in one of the more obscure items.

> surya, for more details about the OUTPUT clause see the following link:
> http://msdn2.microsoft.com/en-us/library/ms177564.aspx

...and if it was in that context you asked about OUTPUT, surya, please
tell us if you want more clarifcation.

Thanks for posting the link Andrey.

--
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

purpose of master and tempdb databases

Hi all,
COuld you pls explain the purpose of master database and tempdb. Can anyone compare this with an oracle database.
Thanks and regards,
Retna
The system databases are well documented in Books Online. Below is a good start:
http://msdn.microsoft.com/library/de...r_da2_1lcx.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Retna" <anonymous@.discussions.microsoft.com> wrote in message
news:A6BD97A2-FE72-4801-B52C-4E9FA44D8DF6@.microsoft.com...
> Hi all,
> COuld you pls explain the purpose of master database and tempdb. Can anyone compare this with an oracle
database.
> Thanks and regards,
> Retna
|||Hi,
Add on to the article mentioned by Tiber , for comparison with Oracle,
SQL Server Oracle
-- --
Master Database System Table Space
Tempdb Temporary tablespace (Where all sort, group, temp
tables operations resides)
So each Oracle database will have a System Table space and Temp table space
during installation itself. This is same as
Master and Tempdb databases in SQL server
Thanks
Hari
MCDBA
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:O0SFiQaMEHA.1556@.TK2MSFTNGP10.phx.gbl...
> The system databases are well documented in Books Online. Below is a good
start:
>
http://msdn.microsoft.com/library/de...us/architec/8_
ar_da2_1lcx.asp[vbcol=seagreen]
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "Retna" <anonymous@.discussions.microsoft.com> wrote in message
> news:A6BD97A2-FE72-4801-B52C-4E9FA44D8DF6@.microsoft.com...
anyone compare this with an oracle
> database.
>
|||Thanks all.
|||You'll find a lot of info in Books Online and googling. Needless to say,
it's a bit more complicated than this, but...
master is used by SQL Server to store meta data assoicated with the server.
You COULD put user objects here but it is not normally a best practice.
tempdb is recreated from scratch each time the server starts. It's used to
store work tables created by SQL for processing a query and temp tables (#,
##, etc...) you create will go here.
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Retna" <anonymous@.discussions.microsoft.com> wrote in message
news:858D968F-7C80-4BA4-8E53-F3CF07B53AC1@.microsoft.com...
> Thanks all.
>
sql

purpose of master and tempdb databases

Hi all
COuld you pls explain the purpose of master database and tempdb. Can anyone compare this with an oracle database
Thanks and regards
RetnaThe system databases are well documented in Books Online. Below is a good start:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_ar_da2_1lcx.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Retna" <anonymous@.discussions.microsoft.com> wrote in message
news:A6BD97A2-FE72-4801-B52C-4E9FA44D8DF6@.microsoft.com...
> Hi all,
> COuld you pls explain the purpose of master database and tempdb. Can anyone compare this with an oracle
database.
> Thanks and regards,
> Retna|||Hi,
Add on to the article mentioned by Tiber , for comparison with Oracle,
SQL Server Oracle
-- --
Master Database System Table Space
Tempdb Temporary tablespace (Where all sort, group, temp
tables operations resides)
So each Oracle database will have a System Table space and Temp table space
during installation itself. This is same as
Master and Tempdb databases in SQL server
Thanks
Hari
MCDBA
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:O0SFiQaMEHA.1556@.TK2MSFTNGP10.phx.gbl...
> The system databases are well documented in Books Online. Below is a good
start:
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_
ar_da2_1lcx.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "Retna" <anonymous@.discussions.microsoft.com> wrote in message
> news:A6BD97A2-FE72-4801-B52C-4E9FA44D8DF6@.microsoft.com...
> > Hi all,
> > COuld you pls explain the purpose of master database and tempdb. Can
anyone compare this with an oracle
> database.
> > Thanks and regards,
> > Retna
>|||Thanks all|||You'll find a lot of info in Books Online and googling. Needless to say,
it's a bit more complicated than this, but...
master is used by SQL Server to store meta data assoicated with the server.
You COULD put user objects here but it is not normally a best practice.
tempdb is recreated from scratch each time the server starts. It's used to
store work tables created by SQL for processing a query and temp tables (#,
##, etc...) you create will go here.
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Retna" <anonymous@.discussions.microsoft.com> wrote in message
news:858D968F-7C80-4BA4-8E53-F3CF07B53AC1@.microsoft.com...
> Thanks all.
>

purpose of master and tempdb databases

Hi all,
COuld you pls explain the purpose of master database and tempdb. Can anyone
compare this with an oracle database.
Thanks and regards,
RetnaThe system databases are well documented in Books Online. Below is a good st
art:
http://msdn.microsoft.com/library/d...r />
_1lcx.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Retna" <anonymous@.discussions.microsoft.com> wrote in message
news:A6BD97A2-FE72-4801-B52C-4E9FA44D8DF6@.microsoft.com...
> Hi all,
> COuld you pls explain the purpose of master database and tempdb. Can anyone compa
re this with an oracle
database.
> Thanks and regards,
> Retna|||Hi,
Add on to the article mentioned by Tiber , for comparison with Oracle,
SQL Server Oracle
-- --
Master Database System Table Space
Tempdb Temporary tablespace (Where all sort, group, temp
tables operations resides)
So each Oracle database will have a System Table space and Temp table space
during installation itself. This is same as
Master and Tempdb databases in SQL server
Thanks
Hari
MCDBA
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:O0SFiQaMEHA.1556@.TK2MSFTNGP10.phx.gbl...
> The system databases are well documented in Books Online. Below is a good
start:
>
http://msdn.microsoft.com/library/d...-us/architec/8_
ar_da2_1lcx.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "Retna" <anonymous@.discussions.microsoft.com> wrote in message
> news:A6BD97A2-FE72-4801-B52C-4E9FA44D8DF6@.microsoft.com...
anyone compare this with an oracle[vbcol=seagreen]
> database.
>|||Thanks all.|||You'll find a lot of info in Books Online and googling. Needless to say,
it's a bit more complicated than this, but...
master is used by SQL Server to store meta data assoicated with the server.
You COULD put user objects here but it is not normally a best practice.
tempdb is recreated from scratch each time the server starts. It's used to
store work tables created by SQL for processing a query and temp tables (#,
##, etc...) you create will go here.
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Retna" <anonymous@.discussions.microsoft.com> wrote in message
news:858D968F-7C80-4BA4-8E53-F3CF07B53AC1@.microsoft.com...
> Thanks all.
>

Purpose of DBCC Commands

Please tell me what is the purpose of these DBCC Commands?
DBCC memospy
DBCC memobjlist
DBCC memorymap
DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE
Can these commands be used to free the RAM which is occupied by SQL Server
Regards
Farhan Iqbal
While some of these are listed in BooksOnLine you can find some information
here:
http://www.sql-server-performance.co...ented_dbcc.asp
Undocumented DBCC commands
Andrew J. Kelly SQL MVP
"Farhan Iqbal" <mr_farhaniqbal@.hotmail.com> wrote in message
news:uVvBMKpwFHA.2880@.TK2MSFTNGP10.phx.gbl...
> Please tell me what is the purpose of these DBCC Commands?
>
> DBCC memospy
> DBCC memobjlist
> DBCC memorymap
> DBCC DROPCLEANBUFFERS
> DBCC FREEPROCCACHE
>
> Can these commands be used to free the RAM which is occupied by SQL Server
> --
> Regards
> Farhan Iqbal
>
|||Farhan Iqbal wrote:
> Please tell me what is the purpose of these DBCC Commands?
>
> DBCC memospy
> DBCC memobjlist
> DBCC memorymap
> DBCC DROPCLEANBUFFERS
> DBCC FREEPROCCACHE
>
> Can these commands be used to free the RAM which is occupied by SQL
> Server
If you are finding that SQL Server is consuming too much memory and that
memory is better utilized by other services running on the server or for
the server OS itself, you should consider setting an upper memory limit
for SQL Server. SQL Server uses available memory as it reads pages of
data and does not, under normal circumstances, release this memory back
to the OS. That is done by design. Operations, like unoptimized queries
that read too many pages, can cause the data in the buffer cache to
cycle in and out, which further hinders performance because the pages
that would most likely be able to reused tend to get pushed out.
David Gugick
Quest Software
www.imceda.com
www.quest.com

Purpose of BI?

I'm wondering in general about the main purpose of BI. More specifically,
should BI be used only for internal business intelligence, e.g., trends and
analysis for senior managment and marketing, or can it also be appropriately
used for daily operational reports? We have daily/weekly/monthly reports
that need to go to third parties, for example, how many customers have
signed up for our service via their service. The BI team is saying that
these reports should not be produced from the data warehouses, but rather
from the source systems. One of the reasons is because the ETL may fail,
therefore the report may not be reliablly produced in a timely manner.
Any input regarding your experience or opinion is appreciated.
Richard
If your BI team think the ETL may fail then they're not doing their job properly.
A properly bult data warehouse is the ideal way to provide the information you are after. It is bad practise to build reports off live OLTP systems.
Regards
Jamie
"Richard G" wrote:

> I'm wondering in general about the main purpose of BI. More specifically,
> should BI be used only for internal business intelligence, e.g., trends and
> analysis for senior managment and marketing, or can it also be appropriately
> used for daily operational reports? We have daily/weekly/monthly reports
> that need to go to third parties, for example, how many customers have
> signed up for our service via their service. The BI team is saying that
> these reports should not be produced from the data warehouses, but rather
> from the source systems. One of the reasons is because the ETL may fail,
> therefore the report may not be reliablly produced in a timely manner.
> Any input regarding your experience or opinion is appreciated.
> Richard
>
>
|||"Utf-8BSmFtaWU" wrote:[vbcol=seagreen]
> If your BI team think the ETL may fail then theyre not doing
> their job properly.
> A properly bult data warehouse is the ideal way to provide the
> information you are after. It is bad practise to build reports off
> live OLTP systems.
> Regards
> Jamie
> "Richard G" wrote:
> More specifically,
> trends and
> appropriately
> reports
> have
> saying that
> but rather
> may fail,
> manner.
I agree that there is always a chance that the operational db and the
DW would be out of synch. Typically, you want to do intensive ad-hoc
queries on the DW. I see advantages in doing tight report queries on
the operational system.
Advantages:
-Operational system IS the system of record (SOR), and the most
reliable
-It is always up to date
Disadvantages:
-Would only work for tightly controlled reports that do not cause
extensive cpu load. Seems to be the case here.
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/Data-Warehou...pict26009.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=485921
|||"steve" <UseLinkToEmail@.dbForumz.com> wrote in message
news:41351fcd$1_3@.news.athenanews.com...
> "Utf-8BSmFtaWU" wrote:
> I agree that there is always a chance that the operational db and the
> DW would be out of synch. Typically, you want to do intensive ad-hoc
> queries on the DW. I see advantages in doing tight report queries on
> the operational system.
> Advantages:
> -Operational system IS the system of record (SOR), and the most
> reliable
> -It is always up to date
> Disadvantages:
> -Would only work for tightly controlled reports that do not cause
> extensive cpu load. Seems to be the case here.
> --
> http://www.dbForumz.com/ This article was posted by author's request
> Articles individually checked for conformance to usenet standards
> Topic URL:
http://www.dbForumz.com/Data-Warehou...pict26009.html
> Visit Topic URL to contact author (reg. req'd). Report abuse:
http://www.dbForumz.com/eform.php?p=485921
Hi,
We have used BI to monitor customer profitability - especially when we do
our annual price review.
High profitability and a high revenue = protect
Low profitability and a low revenue = listprice
/Kent J.
|||"Kent Johnson" wrote:
> "steve" <UseLinkToEmail@.dbForumz.com> wrote in message
> news:41351fcd
_3@.news.athenanews.com...
> not doing
> the
> reports off
> of BI.
> intelligence, e.g.,
> also be
> daily/weekly/monthly
> many customers
> team is
> warehouses,
> because the ETL
> a timely
> appreciated.
> the
> ad-hoc
> queries on
> authors request
> http://www.dbForumz.com/Data-Warehou...pict26009.html
> abuse:
> http://www.dbForumz.com/eform.php?p=485921
> Hi,
> We have used BI to monitor customer profitability - especially when
we
> do
> our annual price review.
> High profitability and a high revenue = protect
> Low profitability and a low revenue = listprice
> /Kent J.
Kent, your example is a very use of BI. I can see that you can either
run such a "report" against operational data source, or DW. Which
one are you running it against?
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/Data-Warehou...pict26009.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=492950

Purpose of @@FETCH_STATUS = -2

Hello All,
I have used Cursor quite a few times. However, I have never got an
oppurtunity to use @.@.FETCH_STATUS = -2
though I have seen it being used quite a few times. Would any know why and
when this is needed. The BOL is not
clear on this also.
For example, in this article, why is @.@.FETCH_STATUS = -2 being used ?
http://www.sqlteam.com/itemprint.asp?ItemID=5761
FETCH NEXT FROM C1 INTO @.AMT
WHILE (@.@.fetch_status <> -1)
BEGIN
IF (@.@.fetch_status <> -2)
BEGIN
SET @.SUM_AMT = @.SUM_AMT + @.AMT
SET @.RECS = @.RECS + 1
END
FETCH NEXT FROM C1 INTO @.AMT
END
Thanks,
Gopiccording to BOL,
0: FETCH statement was successful.
-1: FETCH statement failed or the row was beyond the result set.
-2: Row fetched is missing.
so -2 means that you tried to fetch a row, but the row isn't there anymore.
This can happen because someone has deleted it btween when you created the
cursor, and when you try to fetch that particular row...
"gopi" wrote:

> Hello All,
> I have used Cursor quite a few times. However, I have never got an
> oppurtunity to use @.@.FETCH_STATUS = -2
> though I have seen it being used quite a few times. Would any know why and
> when this is needed. The BOL is not
> clear on this also.
> For example, in this article, why is @.@.FETCH_STATUS = -2 being used ?
> http://www.sqlteam.com/itemprint.asp?ItemID=5761
>
> FETCH NEXT FROM C1 INTO @.AMT
> WHILE (@.@.fetch_status <> -1)
> BEGIN
> IF (@.@.fetch_status <> -2)
> BEGIN
> SET @.SUM_AMT = @.SUM_AMT + @.AMT
> SET @.RECS = @.RECS + 1
> END
> FETCH NEXT FROM C1 INTO @.AMT
> END
> Thanks,
> Gopi
>
>|||That cursor shouldn't need a check against -2 as it is a read-only cursor. B
ut if you have a key-set
driven cursor (SQL Server stored only the primary key, when fetching, SQL Se
rver uses the PK to
fetch the other columns, you might end up navigating to a row which has been
deleted in the table.
Hence @.@.FETCH_STATUS = -2.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"gopi" <rgopinath@.hotmail.com> wrote in message news:%23uU4aukKFHA.656@.TK2MSFTNGP14.phx.gbl
..
> Hello All,
> I have used Cursor quite a few times. However, I have never got an oppurtu
nity to use
> @.@.FETCH_STATUS = -2
> though I have seen it being used quite a few times. Would any know why and
when this is needed.
> The BOL is not
> clear on this also.
> For example, in this article, why is @.@.FETCH_STATUS = -2 being used ?
> http://www.sqlteam.com/itemprint.asp?ItemID=5761
>
> FETCH NEXT FROM C1 INTO @.AMT
> WHILE (@.@.fetch_status <> -1)
> BEGIN
> IF (@.@.fetch_status <> -2)
> BEGIN
> SET @.SUM_AMT = @.SUM_AMT + @.AMT
> SET @.RECS = @.RECS + 1
> END
> FETCH NEXT FROM C1 INTO @.AMT
> END
> Thanks,
> Gopi
>|||Thanks Tibor. After reading your response, I checked BOL for KEYSET and
found the following :
Gopi
KEYSET
Specifies that the membership and order of rows in the cursor are fixed when
the cursor is opened. The set of keys that uniquely identify the rows is
built into a table in tempdb known as the keyset. Changes to nonkey values
in the base tables, either made by the cursor owner or committed by other
users, are visible as the owner scrolls around the cursor. Inserts made by
other users are not visible (inserts cannot be made through a Transact-SQL
server cursor). If a row is deleted, an attempt to fetch the row returns an
@.@.FETCH_STATUS of -2. Updates of key values from outside the cursor resemble
a delete of the old row followed by an insert of the new row. The row with
the new values is not visible, and attempts to fetch the row with the old
values return an @.@.FETCH_STATUS of -2. The new values are visible if the
update is done through the cursor by specifying the WHERE CURRENT OF clause.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eKuLi2kKFHA.3916@.TK2MSFTNGP14.phx.gbl...
> That cursor shouldn't need a check against -2 as it is a read-only cursor.
> But if you have a key-set driven cursor (SQL Server stored only the
> primary key, when fetching, SQL Server uses the PK to fetch the other
> columns, you might end up navigating to a row which has been deleted in
> the table. Hence @.@.FETCH_STATUS = -2.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "gopi" <rgopinath@.hotmail.com> wrote in message
> news:%23uU4aukKFHA.656@.TK2MSFTNGP14.phx.gbl...
>sql

Purpose of "NT AUTHORITY\SYSTEM" login in SQL Server 2005

Hi All

Does anybody know what the "NT AUTHORITY\SYSTEM" login create during a SQL Server 2005 instillation is used for?

Does this login pose a security risk, and can it be removed safely? It seems to me as if it is similar to the "Bultin\Administrator" login which we remove from our production servers?

Regards

Stevo

Yes it willbe similar to Builtin\Administrator if they got access and by default you remove the access to NT AUTHORITY\SYSTEM from SQL Server.

BOL

Built-in account. You can choose from a list of the following built-in Windows service accounts:

Local System account. The name of this account is NT AUTHORITY\System. It is a powerful account that has unrestricted access to all local system resources. It is a member of the Windows Administrators group on the local computer, and is therefore a member of the SQL Server sysadmin fixed server role

Security Note:

The Local System account option is provided for backward compatibility only. The Local System account has permissions that SQL Server Agent does not require. Avoid running SQL Server Agent as the Local System account. For improved security, use a Windows domain account with the permissions listed in the following section, "Windows Domain Account Permissions."

Network Service account. The name of this account is NT AUTHORITY\NetworkService. It is available in Microsoft Windows XP and Microsoft Windows Server 2003. All services that run under the Network Service account are authenticated to network resources as the local computer.

Security Note:

Because multiple services can use the Network Service account, it is difficult to control which services have access to network resources, including SQL Server databases. We do not recommend using the Network Service account for the SQL Server Agent service.

Purpose od IDENTITY column

Hi Ppl,
Could i know what's the purpose of the IDENTITY COLUMN ?
thks ^ rdgs
Best shown through an example:
CREATE TABLE #IDTest(AChar CHAR(1), IDCol INT IDENTITY(1,1))
GO
INSERT #IDTest (AChar) VALUES ('A')
INSERT #IDTest (AChar) VALUES ('B')
INSERT #IDTest (AChar) VALUES ('C')
GO
SELECT *
FROM #IDTest
ORDER BY IDCol
We seeded the identity with a start value of 1, and increment each row by 1.
(IDENTITY(1,1)). Every row we insert is now given a unique, sequential ID.
So the 'A' row has an ID of 1, the 'B' row 2, and the 'C' row 3. This ID
column can be used to track order of INSERTs or more commonly as a surrogate
key for joining to other tables.
Number one thing to remember: Never rely on the IDENTITY being consecutive!
Rows can be deleted, transactions can be rolled back, and the identity can
be re-seeded. So there is certainly no guarantee that there won't
eventually be gaps.
You should also always make sure when using the IDENTITY as a primary key
that you have other constraints in place to ensure uniqueness of your data.
Mis-use of IDENTITY columns for primary keys is a very common source of data
integrity problems. So use them wearily.
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:628c01c4750f$50c5dc40$a401280a@.phx.gbl...
> Hi Ppl,
> Could i know what's the purpose of the IDENTITY COLUMN ?
> thks ^ rdgs
|||That's solid advice from Adam.
Just adding my 20c though: If you design the use of identities into a
database / application, you throw away the ability to partition tables in
the database later which might be important if the database grows
substantially. This is due to a limitation of the SQL 2000 partitioning
design which has been fixed in SQL 2005.
Regards,
Greg Linwood
SQL Server MVP
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:elUAjERdEHA.2352@.TK2MSFTNGP09.phx.gbl...
> Best shown through an example:
> CREATE TABLE #IDTest(AChar CHAR(1), IDCol INT IDENTITY(1,1))
> GO
> INSERT #IDTest (AChar) VALUES ('A')
> INSERT #IDTest (AChar) VALUES ('B')
> INSERT #IDTest (AChar) VALUES ('C')
> GO
> SELECT *
> FROM #IDTest
> ORDER BY IDCol
> --
> We seeded the identity with a start value of 1, and increment each row by
1.
> (IDENTITY(1,1)). Every row we insert is now given a unique, sequential
ID.
> So the 'A' row has an ID of 1, the 'B' row 2, and the 'C' row 3. This ID
> column can be used to track order of INSERTs or more commonly as a
surrogate
> key for joining to other tables.
> Number one thing to remember: Never rely on the IDENTITY being
consecutive!
> Rows can be deleted, transactions can be rolled back, and the identity can
> be re-seeded. So there is certainly no guarantee that there won't
> eventually be gaps.
> You should also always make sure when using the IDENTITY as a primary key
> that you have other constraints in place to ensure uniqueness of your
data.
> Mis-use of IDENTITY columns for primary keys is a very common source of
data
> integrity problems. So use them wearily.
>
> "maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
> news:628c01c4750f$50c5dc40$a401280a@.phx.gbl...
>
|||thks Adam & Greg !! Cheers
>--Original Message--
>That's solid advice from Adam.
>Just adding my 20c though: If you design the use of
identities into a
>database / application, you throw away the ability to
partition tables in
>the database later which might be important if the
database grows
>substantially. This is due to a limitation of the SQL
2000 partitioning
>design which has been fixed in SQL 2005.
>Regards,
>Greg Linwood
>SQL Server MVP
>"Adam Machanic" <amachanic@.hotmail._removetoemail_.com>
wrote in message[vbcol=seagreen]
>news:elUAjERdEHA.2352@.TK2MSFTNGP09.phx.gbl...
(1,1))[vbcol=seagreen]
increment each row by[vbcol=seagreen]
>1.
unique, sequential[vbcol=seagreen]
>ID.
the 'C' row 3. This ID[vbcol=seagreen]
commonly as a[vbcol=seagreen]
>surrogate
IDENTITY being[vbcol=seagreen]
>consecutive!
and the identity can[vbcol=seagreen]
there won't[vbcol=seagreen]
IDENTITY as a primary key[vbcol=seagreen]
uniqueness of your[vbcol=seagreen]
>data.
common source of[vbcol=seagreen]
>data
in message[vbcol=seagreen]
COLUMN ?
>
>.
>

Purpose od IDENTITY column

Hi Ppl,
Could i know what's the purpose of the IDENTITY COLUMN ?
thks ^ rdgs
An identity column is a self generated column that you can use in a table.
It contains a starting value and an increment. So that means if that if you
insert a row which has an identity column called "myID", then the first row
will automatically insert a value of 1 to myID (assuming the starting value
is 1). If you've defined the increment to be 2, then the 2nd row's myID
will now be 1+2=3. The 3rd row will have a myID=5.
The only caveat is that, if you were to rollback a statement, the Identify
value doesnt get rolled back.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.

Purpose od IDENTITY column

Hi Ppl,
Could i know what's the purpose of the IDENTITY COLUMN ?
thks ^ rdgsBest shown through an example:
CREATE TABLE #IDTest(AChar CHAR(1), IDCol INT IDENTITY(1,1))
GO
INSERT #IDTest (AChar) VALUES ('A')
INSERT #IDTest (AChar) VALUES ('B')
INSERT #IDTest (AChar) VALUES ('C')
GO
SELECT *
FROM #IDTest
ORDER BY IDCol
We seeded the identity with a start value of 1, and increment each row by 1.
(IDENTITY(1,1)). Every row we insert is now given a unique, sequential ID.
So the 'A' row has an ID of 1, the 'B' row 2, and the 'C' row 3. This ID
column can be used to track order of INSERTs or more commonly as a surrogate
key for joining to other tables.
Number one thing to remember: Never rely on the IDENTITY being consecutive!
Rows can be deleted, transactions can be rolled back, and the identity can
be re-seeded. So there is certainly no guarantee that there won't
eventually be gaps.
You should also always make sure when using the IDENTITY as a primary key
that you have other constraints in place to ensure uniqueness of your data.
Mis-use of IDENTITY columns for primary keys is a very common source of data
integrity problems. So use them wearily.
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:628c01c4750f$50c5dc40$a401280a@.phx.gbl...
> Hi Ppl,
> Could i know what's the purpose of the IDENTITY COLUMN ?
> thks ^ rdgs|||That's solid advice from Adam.
Just adding my 20c though: If you design the use of identities into a
database / application, you throw away the ability to partition tables in
the database later which might be important if the database grows
substantially. This is due to a limitation of the SQL 2000 partitioning
design which has been fixed in SQL 2005.
Regards,
Greg Linwood
SQL Server MVP
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:elUAjERdEHA.2352@.TK2MSFTNGP09.phx.gbl...
> Best shown through an example:
> CREATE TABLE #IDTest(AChar CHAR(1), IDCol INT IDENTITY(1,1))
> GO
> INSERT #IDTest (AChar) VALUES ('A')
> INSERT #IDTest (AChar) VALUES ('B')
> INSERT #IDTest (AChar) VALUES ('C')
> GO
> SELECT *
> FROM #IDTest
> ORDER BY IDCol
> --
> We seeded the identity with a start value of 1, and increment each row by
1.
> (IDENTITY(1,1)). Every row we insert is now given a unique, sequential
ID.
> So the 'A' row has an ID of 1, the 'B' row 2, and the 'C' row 3. This ID
> column can be used to track order of INSERTs or more commonly as a
surrogate
> key for joining to other tables.
> Number one thing to remember: Never rely on the IDENTITY being
consecutive!
> Rows can be deleted, transactions can be rolled back, and the identity can
> be re-seeded. So there is certainly no guarantee that there won't
> eventually be gaps.
> You should also always make sure when using the IDENTITY as a primary key
> that you have other constraints in place to ensure uniqueness of your
data.
> Mis-use of IDENTITY columns for primary keys is a very common source of
data
> integrity problems. So use them wearily.
>
> "maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
> news:628c01c4750f$50c5dc40$a401280a@.phx.gbl...
>|||thks Adam & Greg !! Cheers
>--Original Message--
>That's solid advice from Adam.
>Just adding my 20c though: If you design the use of
identities into a
>database / application, you throw away the ability to
partition tables in
>the database later which might be important if the
database grows
>substantially. This is due to a limitation of the SQL
2000 partitioning
>design which has been fixed in SQL 2005.
>Regards,
>Greg Linwood
>SQL Server MVP
>"Adam Machanic" <amachanic@.hotmail._removetoemail_.com>
wrote in message
>news:elUAjERdEHA.2352@.TK2MSFTNGP09.phx.gbl...
(1,1))[vbcol=seagreen]
increment each row by[vbcol=seagreen]
>1.
unique, sequential[vbcol=seagreen]
>ID.
the 'C' row 3. This ID[vbcol=seagreen]
commonly as a[vbcol=seagreen]
>surrogate
IDENTITY being[vbcol=seagreen]
>consecutive!
and the identity can[vbcol=seagreen]
there won't[vbcol=seagreen]
IDENTITY as a primary key[vbcol=seagreen]
uniqueness of your[vbcol=seagreen]
>data.
common source of[vbcol=seagreen]
>data
in message[vbcol=seagreen]
COLUMN ?[vbcol=seagreen]
>
>.
>

Purpose od IDENTITY column

Hi Ppl,
Could i know what's the purpose of the IDENTITY COLUMN ?
thks ^ rdgsAn identity column is a self generated column that you can use in a table.
It contains a starting value and an increment. So that means if that if you
insert a row which has an identity column called "myID", then the first row
will automatically insert a value of 1 to myID (assuming the starting value
is 1). If you've defined the increment to be 2, then the 2nd row's myID
will now be 1+2=3. The 3rd row will have a myID=5.
The only caveat is that, if you were to rollback a statement, the Identify
value doesnt get rolled back.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.sql

Purpose od IDENTITY column

Hi Ppl,
Could i know what's the purpose of the IDENTITY COLUMN ?
thks ^ rdgsHi ,
i think i knowit. it's like that AutoNumber in MS
Access where a row number will be created for each row
rdgs
>--Original Message--
>Hi Ppl,
> Could i know what's the purpose of the IDENTITY
COLUMN ?
>thks ^ rdgs
>.
>|||Best shown through an example:
CREATE TABLE #IDTest(AChar CHAR(1), IDCol INT IDENTITY(1,1))
GO
INSERT #IDTest (AChar) VALUES ('A')
INSERT #IDTest (AChar) VALUES ('B')
INSERT #IDTest (AChar) VALUES ('C')
GO
SELECT *
FROM #IDTest
ORDER BY IDCol
--
We seeded the identity with a start value of 1, and increment each row by 1.
(IDENTITY(1,1)). Every row we insert is now given a unique, sequential ID.
So the 'A' row has an ID of 1, the 'B' row 2, and the 'C' row 3. This ID
column can be used to track order of INSERTs or more commonly as a surrogate
key for joining to other tables.
Number one thing to remember: Never rely on the IDENTITY being consecutive!
Rows can be deleted, transactions can be rolled back, and the identity can
be re-seeded. So there is certainly no guarantee that there won't
eventually be gaps.
You should also always make sure when using the IDENTITY as a primary key
that you have other constraints in place to ensure uniqueness of your data.
Mis-use of IDENTITY columns for primary keys is a very common source of data
integrity problems. So use them wearily.
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:628c01c4750f$50c5dc40$a401280a@.phx.gbl...
> Hi Ppl,
> Could i know what's the purpose of the IDENTITY COLUMN ?
> thks ^ rdgs|||That's solid advice from Adam.
Just adding my 20c though: If you design the use of identities into a
database / application, you throw away the ability to partition tables in
the database later which might be important if the database grows
substantially. This is due to a limitation of the SQL 2000 partitioning
design which has been fixed in SQL 2005.
Regards,
Greg Linwood
SQL Server MVP
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:elUAjERdEHA.2352@.TK2MSFTNGP09.phx.gbl...
> Best shown through an example:
> CREATE TABLE #IDTest(AChar CHAR(1), IDCol INT IDENTITY(1,1))
> GO
> INSERT #IDTest (AChar) VALUES ('A')
> INSERT #IDTest (AChar) VALUES ('B')
> INSERT #IDTest (AChar) VALUES ('C')
> GO
> SELECT *
> FROM #IDTest
> ORDER BY IDCol
> --
> We seeded the identity with a start value of 1, and increment each row by
1.
> (IDENTITY(1,1)). Every row we insert is now given a unique, sequential
ID.
> So the 'A' row has an ID of 1, the 'B' row 2, and the 'C' row 3. This ID
> column can be used to track order of INSERTs or more commonly as a
surrogate
> key for joining to other tables.
> Number one thing to remember: Never rely on the IDENTITY being
consecutive!
> Rows can be deleted, transactions can be rolled back, and the identity can
> be re-seeded. So there is certainly no guarantee that there won't
> eventually be gaps.
> You should also always make sure when using the IDENTITY as a primary key
> that you have other constraints in place to ensure uniqueness of your
data.
> Mis-use of IDENTITY columns for primary keys is a very common source of
data
> integrity problems. So use them wearily.
>
> "maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
> news:628c01c4750f$50c5dc40$a401280a@.phx.gbl...
> > Hi Ppl,
> >
> > Could i know what's the purpose of the IDENTITY COLUMN ?
> >
> > thks ^ rdgs
>|||thks Adam & Greg !! Cheers
>--Original Message--
>That's solid advice from Adam.
>Just adding my 20c though: If you design the use of
identities into a
>database / application, you throw away the ability to
partition tables in
>the database later which might be important if the
database grows
>substantially. This is due to a limitation of the SQL
2000 partitioning
>design which has been fixed in SQL 2005.
>Regards,
>Greg Linwood
>SQL Server MVP
>"Adam Machanic" <amachanic@.hotmail._removetoemail_.com>
wrote in message
>news:elUAjERdEHA.2352@.TK2MSFTNGP09.phx.gbl...
>> Best shown through an example:
>> CREATE TABLE #IDTest(AChar CHAR(1), IDCol INT IDENTITY
(1,1))
>> GO
>> INSERT #IDTest (AChar) VALUES ('A')
>> INSERT #IDTest (AChar) VALUES ('B')
>> INSERT #IDTest (AChar) VALUES ('C')
>> GO
>> SELECT *
>> FROM #IDTest
>> ORDER BY IDCol
>> --
>> We seeded the identity with a start value of 1, and
increment each row by
>1.
>> (IDENTITY(1,1)). Every row we insert is now given a
unique, sequential
>ID.
>> So the 'A' row has an ID of 1, the 'B' row 2, and
the 'C' row 3. This ID
>> column can be used to track order of INSERTs or more
commonly as a
>surrogate
>> key for joining to other tables.
>> Number one thing to remember: Never rely on the
IDENTITY being
>consecutive!
>> Rows can be deleted, transactions can be rolled back,
and the identity can
>> be re-seeded. So there is certainly no guarantee that
there won't
>> eventually be gaps.
>> You should also always make sure when using the
IDENTITY as a primary key
>> that you have other constraints in place to ensure
uniqueness of your
>data.
>> Mis-use of IDENTITY columns for primary keys is a very
common source of
>data
>> integrity problems. So use them wearily.
>>
>> "maxzsim" <anonymous@.discussions.microsoft.com> wrote
in message
>> news:628c01c4750f$50c5dc40$a401280a@.phx.gbl...
>> > Hi Ppl,
>> >
>> > Could i know what's the purpose of the IDENTITY
COLUMN ?
>> >
>> > thks ^ rdgs
>>
>
>.
>

Purpose od IDENTITY column

Hi Ppl,
Could i know what's the purpose of the IDENTITY COLUMN ?
thks ^ rdgsAn identity column is a self generated column that you can use in a table.
It contains a starting value and an increment. So that means if that if you
insert a row which has an identity column called "myID", then the first row
will automatically insert a value of 1 to myID (assuming the starting value
is 1). If you've defined the increment to be 2, then the 2nd row's myID
will now be 1+2=3. The 3rd row will have a myID=5.
The only caveat is that, if you were to rollback a statement, the Identify
value doesnt get rolled back.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.

Wednesday, March 7, 2012

published paper for db performance strategies?

I am looking for some published paper regarding database performance
tunning performance strategies. This is for academic purpose so it
needs not to be any commerical database specific. It will be even
better if the paper has some kind of methods to quantify/measure
performance. Has anyone come across with any interesting paper about
this?

Thanks,
ewong>>>>> "Ed" == Ed Wong <ewong@.mail.com> writes:

Ed> I am looking for some published paper regarding database
Ed> performance tunning performance strategies. This is for
Ed> academic purpose so it needs not to be any commerical database

I would start with the various Wisconsin benchmarks. Go to the webpage
of the University of Wisconsin database group.

--
Pip-pip
Sailesh
http://www.cs.berkeley.edu/~sailesh|||Have a look at the Oracle docs, particularly the Oracle 9i Performance
Tuning Guide (http://tahiti.oracle.com).

HTH,
Brian

Ed Wong wrote:
> I am looking for some published paper regarding database performance
> tunning performance strategies. This is for academic purpose so it
> needs not to be any commerical database specific. It will be even
> better if the paper has some kind of methods to quantify/measure
> performance. Has anyone come across with any interesting paper about
> this?
> Thanks,
> ewong

--
================================================== =================

Brian Peasland
dba@.remove_spam.peasland.com

Remove the "remove_spam." from the email address to email me.

"I can give it to you cheap, quick, and good. Now pick two out of
the three"

Publish the cubes on the web portal

Hi all,
Is there the ability of publishing the cubes (which is built from an Analysis Services Project) on the web portal?
The purpose of this action is to let the BI users to do the analysis directly on the web portal.
The BI users can change the measure, slide and dice data, change the dimension (just like what you've done with the Analysis Services).

One of the options:

You can enable HTTP access to Analysis Services 2005 and let you users to access Analysis Services directly.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.