Showing posts with label run. Show all posts
Showing posts with label run. Show all posts

Friday, March 30, 2012

Question about Service Pack

In query analyzer

If I run this
SELECT @.@.version
I get this result
-----------------
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

(1 row(s) affected)

If I run this
SELECT CONVERT(char(20), SERVERPROPERTY('ProductLevel'))
I get this result
-------
SP4

(1 row(s) affected)

What's the deal am I at SP2 or SP4?You are running SQL Server 2000 SP4. The SP2 in the @.@.VERSION string is the
OS service pack level.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"SQL Server" <alderran666@.gmail.com> wrote in message
news:1125853679.498850.278490@.g44g2000cwa.googlegr oups.com...
> In query analyzer
> If I run this
> SELECT @.@.version
> I get this result
> -----------------
> Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
> May 3 2005 23:18:38
> Copyright (c) 1988-2003 Microsoft Corporation
> Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
>
> (1 row(s) affected)
> If I run this
> SELECT CONVERT(char(20), SERVERPROPERTY('ProductLevel'))
> I get this result
> -------
> SP4
> (1 row(s) affected)
> What's the deal am I at SP2 or SP4?|||Hi

To add to Dan's Reply:

Windows NT 5.1 (Build 2600: Service Pack 2)

Is Windows XP Service Pack 2.

A SQL Server version list can be found at:
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=37

John
"SQL Server" <alderran666@.gmail.com> wrote in message
news:1125853679.498850.278490@.g44g2000cwa.googlegr oups.com...
> In query analyzer
> If I run this
> SELECT @.@.version
> I get this result
> -----------------
> Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
> May 3 2005 23:18:38
> Copyright (c) 1988-2003 Microsoft Corporation
> Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
>
> (1 row(s) affected)
> If I run this
> SELECT CONVERT(char(20), SERVERPROPERTY('ProductLevel'))
> I get this result
> -------
> SP4
> (1 row(s) affected)
> What's the deal am I at SP2 or SP4?

Friday, March 23, 2012

question about like

I have a table that looks like this

tbl1:
nvchValue nvarchar(100) NOT NULL
biVal1 bigint NOT NULL
biVal2 bigint NOT NULL

If I run this query against it:
SELECT nvchValue
FROM tbl1
WHERE nvchValue LIKE '%<%'

I get a result set that doesn't make any sense to me:
Term

--
?
?
?
fr?it

Those values are in the database, but I don't understand how the match
is working. Any help would be appriciated.It has to do with the collation you are using. Just like an 'a' is
considered equal to an 'A' in a collation that is not case sensitive,
the '<' is apparently considered equal to some of your ? characters.

If you explicitely mention Binary Collation in the WHERE clause, then
you will only get exact matches.

Gert-Jan

alternative_to_what@.yahoo.com wrote:
> I have a table that looks like this
> tbl1:
> nvchValue nvarchar(100) NOT NULL
> biVal1 bigint NOT NULL
> biVal2 bigint NOT NULL
> If I run this query against it:
> SELECT nvchValue
> FROM tbl1
> WHERE nvchValue LIKE '%<%'
> I get a result set that doesn't make any sense to me:
> Term
> --
> ?
> ?
> ?
> fr?it
> Those values are in the database, but I don't understand how the match
> is working. Any help would be appriciated.

Wednesday, March 21, 2012

question about launching an application at sqlserver startup

Hello,

What are the possible ways to make a GUI application start
automatically and run in a usual fashion (i.e. with a capability to
create windows) when mssqlserver starts?Hi

If you had a GUI where would you want it to display if there is noone logged
onto the server? Without a GUI you could write a service that is dependent
on the SQL Server service.

John

"Alexander Korovyev" <korovyev@.rambler.ru> wrote in message
news:26c82787.0407012306.fc5ace0@.posting.google.co m...
> Hello,
> What are the possible ways to make a GUI application start
> automatically and run in a usual fashion (i.e. with a capability to
> create windows) when mssqlserver starts?|||Alexander Korovyev (korovyev@.rambler.ru) writes:
> What are the possible ways to make a GUI application start
> automatically and run in a usual fashion (i.e. with a capability to
> create windows) when mssqlserver starts?

You can use a sp_procoption to mark a procedure as a startup procedure,
so that it is run each time SQL Server starts. From that procedure you
can call xp_cmdshell to run a command, but here is a catch: that must be
a command-line command, it cannot be a GUI, because SQL Server does not
have a desktop. However, you implement your application as another
service, but one that is permitted to interact with the desktop. (Exactly
how you would do this, I don't know, it's more of a Windows issue.)

Another alternative is to use the sp_OAxxx routines from your startup
procedure to interact with a COM object. A local COM object that uses
a GUI is not a good idea, but you could start a COM object on a remote
machine.

But I have question is: what is the real problem you are trying to solve?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

question about indexes

Using SS2000. We have a table that we use mostly for reporting. It has about
150 columns in it. Many different queries are run off of it which use a lot
of different columns in the where and order clauses. Is there any limit to
the number of indexes that can be put on a table? Does performance start to
suffer at some point if too many columns are indexed? I think I read
somewhere that if a column is used in a clustered index then it shouldn't be
used in a nonclustered index. Is that true?
Thanks,
Dan D.
See inline
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Dan" <ddonahue@.archermalmo.com> wrote in message
news:%23bEk3SjSEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Using SS2000. We have a table that we use mostly for reporting. It has
about
> 150 columns in it. Many different queries are run off of it which use a
lot
> of different columns in the where and order clauses. Is there any limit to
> the number of indexes that can be put on a table?
1 clustered index and 249 non-clustered indexes
Does performance start to suffer at some point if too many columns are
indexed?
Every new index you create will slow down all inserts and deletes, but may
improve some selects, updates and deletes with where clauses
I think I read
> somewhere that if a column is used in a clustered index then it shouldn't
be
> used in a nonclustered index. Is that true?
Not necessarily... Use the clustered index to support range searches or
values with many duplicates..
There is never a need to have 2 indexes with the same keys however.

> Thanks,
> Dan D.
>
|||> Is there any limit to the number of indexes that can be put on a table
Yes. I believe it's 253 non-clustered indexes plus 1 clustered index.
Statistics count as a non-clustered index.
Hope this helps.
Dan Guzman
SQL Server MVP
"Dan" <ddonahue@.archermalmo.com> wrote in message
news:%23bEk3SjSEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Using SS2000. We have a table that we use mostly for reporting. It has
about
> 150 columns in it. Many different queries are run off of it which use a
lot
> of different columns in the where and order clauses. Is there any limit to
> the number of indexes that can be put on a table? Does performance start
to
> suffer at some point if too many columns are indexed? I think I read
> somewhere that if a column is used in a clustered index then it shouldn't
be
> used in a nonclustered index. Is that true?
> Thanks,
> Dan D.
>

question about indexes

Using SS2000. We have a table that we use mostly for reporting. It has about
150 columns in it. Many different queries are run off of it which use a lot
of different columns in the where and order clauses. Is there any limit to
the number of indexes that can be put on a table? Does performance start to
suffer at some point if too many columns are indexed? I think I read
somewhere that if a column is used in a clustered index then it shouldn't be
used in a nonclustered index. Is that true?
Thanks,
Dan D.See inline
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Dan" <ddonahue@.archermalmo.com> wrote in message
news:%23bEk3SjSEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Using SS2000. We have a table that we use mostly for reporting. It has
about
> 150 columns in it. Many different queries are run off of it which use a
lot
> of different columns in the where and order clauses. Is there any limit to
> the number of indexes that can be put on a table?
1 clustered index and 249 non-clustered indexes
Does performance start to suffer at some point if too many columns are
indexed?
Every new index you create will slow down all inserts and deletes, but may
improve some selects, updates and deletes with where clauses
I think I read
> somewhere that if a column is used in a clustered index then it shouldn't
be
> used in a nonclustered index. Is that true?
Not necessarily... Use the clustered index to support range searches or
values with many duplicates..
There is never a need to have 2 indexes with the same keys however.
> Thanks,
> Dan D.
>|||> Is there any limit to the number of indexes that can be put on a table
Yes. I believe it's 253 non-clustered indexes plus 1 clustered index.
Statistics count as a non-clustered index.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Dan" <ddonahue@.archermalmo.com> wrote in message
news:%23bEk3SjSEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Using SS2000. We have a table that we use mostly for reporting. It has
about
> 150 columns in it. Many different queries are run off of it which use a
lot
> of different columns in the where and order clauses. Is there any limit to
> the number of indexes that can be put on a table? Does performance start
to
> suffer at some point if too many columns are indexed? I think I read
> somewhere that if a column is used in a clustered index then it shouldn't
be
> used in a nonclustered index. Is that true?
> Thanks,
> Dan D.
>sql

question about indexes

Using SS2000. We have a table that we use mostly for reporting. It has about
150 columns in it. Many different queries are run off of it which use a lot
of different columns in the where and order clauses. Is there any limit to
the number of indexes that can be put on a table? Does performance start to
suffer at some point if too many columns are indexed? I think I read
somewhere that if a column is used in a clustered index then it shouldn't be
used in a nonclustered index. Is that true?
Thanks,
Dan D.See inline
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Dan" <ddonahue@.archermalmo.com> wrote in message
news:%23bEk3SjSEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Using SS2000. We have a table that we use mostly for reporting. It has
about
> 150 columns in it. Many different queries are run off of it which use a
lot
> of different columns in the where and order clauses. Is there any limit to
> the number of indexes that can be put on a table?
1 clustered index and 249 non-clustered indexes
Does performance start to suffer at some point if too many columns are
indexed?
Every new index you create will slow down all inserts and deletes, but may
improve some selects, updates and deletes with where clauses
I think I read
> somewhere that if a column is used in a clustered index then it shouldn't
be
> used in a nonclustered index. Is that true?
Not necessarily... Use the clustered index to support range searches or
values with many duplicates..
There is never a need to have 2 indexes with the same keys however.

> Thanks,
> Dan D.
>|||> Is there any limit to the number of indexes that can be put on a table
Yes. I believe it's 253 non-clustered indexes plus 1 clustered index.
Statistics count as a non-clustered index.
Hope this helps.
Dan Guzman
SQL Server MVP
"Dan" <ddonahue@.archermalmo.com> wrote in message
news:%23bEk3SjSEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Using SS2000. We have a table that we use mostly for reporting. It has
about
> 150 columns in it. Many different queries are run off of it which use a
lot
> of different columns in the where and order clauses. Is there any limit to
> the number of indexes that can be put on a table? Does performance start
to
> suffer at some point if too many columns are indexed? I think I read
> somewhere that if a column is used in a clustered index then it shouldn't
be
> used in a nonclustered index. Is that true?
> Thanks,
> Dan D.
>

Tuesday, March 20, 2012

Question about Identity generation and issues..


Has anyone run into this issue before?
I'm creating test scenarios doing Deletes/Updates/Inserts and after the test
scenario is completed need to remove any and all changes to the Database
that were made. The connection is made and many statements are run and all
are encapsulated in a single transaction. When all transactions are
completed a rollback is performed.
The problem arises here:
Table A has an identity column defined as the primary key on it.
A process (run in a .Net transaction) executes and performs an insert into
Table A to generate an Identity but before the transaction is completed the
process runs other statements using that generated value in other tables for
reference purposes. During the time these queries run, another instance of
the same process performs the same insert allowing the table to auto
generate its identity value. A certain percentage of the time, I'll get an
error whereby a duplicate primary key violation occurs.
Has anyone encountered anything like this and is there a way around it?
I've tried setting differing Isolation levels, minimizing the transaction to
only the section that is actually changing data, unique transaction
names...?
Thanks
DAre you using a column with IDENTITY property or are you generating the
sequencial value?. If you are generating it, can we see the code used?
AMB
"news" wrote:

>
> Has anyone run into this issue before?
>
> I'm creating test scenarios doing Deletes/Updates/Inserts and after the te
st
> scenario is completed need to remove any and all changes to the Database
> that were made. The connection is made and many statements are run and al
l
> are encapsulated in a single transaction. When all transactions are
> completed a rollback is performed.
>
> The problem arises here:
>
> Table A has an identity column defined as the primary key on it.
>
> A process (run in a .Net transaction) executes and performs an insert into
> Table A to generate an Identity but before the transaction is completed th
e
> process runs other statements using that generated value in other tables f
or
> reference purposes. During the time these queries run, another instance o
f
> the same process performs the same insert allowing the table to auto
> generate its identity value. A certain percentage of the time, I'll get a
n
> error whereby a duplicate primary key violation occurs.
>
> Has anyone encountered anything like this and is there a way around it?
> I've tried setting differing Isolation levels, minimizing the transaction
to
> only the section that is actually changing data, unique transaction
> names...?
>
> Thanks
>
> D
>
>|||The column has been defined as an INT IDENTITY(1,1) NOT NULL
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:E07EDB1D-6F14-4F87-9D77-13E58115A473@.microsoft.com...
> Are you using a column with IDENTITY property or are you generating the
> sequencial value?. If you are generating it, can we see the code used?
>
> AMB
> "news" wrote:
>
test
all
into
the
for
of
an
transaction to|||Is there a way to reproduce the problem in our computer?
AMB
"news" wrote:

> The column has been defined as an INT IDENTITY(1,1) NOT NULL
> "Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in messag
e
> news:E07EDB1D-6F14-4F87-9D77-13E58115A473@.microsoft.com...
> test
> all
> into
> the
> for
> of
> an
> transaction to
>
>|||>> The problem arises here: Table A has an identity column defined as
the primary key on it. <<
That is a problem! You have hired someone who does not know better
than use IDENTITY as a key in a schema. The right thing to do is
re-design that table with a proper relational key. This is a much
better idea than any of the kludges you are going to be given.|||Instead claiming that the sky is falling like senor Joe and give up identity
columns, there are a couple of more practical ideas. The most important
solution is to reproduce the problem. What version of SQL Server? How many
records in the database? How hard is the table being hit? What do the
inserts look like?
For example, one solution would be a simple retry mechanism (which btw, Joe,
would be needed with any sort of sequencing mechanism).
Thomas
"news" <DavidP> wrote in message
news:ugrawntOFHA.2144@.TK2MSFTNGP09.phx.gbl...
>
> Has anyone run into this issue before?
>
> I'm creating test scenarios doing Deletes/Updates/Inserts and after the
> test
> scenario is completed need to remove any and all changes to the Database
> that were made. The connection is made and many statements are run and
> all
> are encapsulated in a single transaction. When all transactions are
> completed a rollback is performed.
>
> The problem arises here:
>
> Table A has an identity column defined as the primary key on it.
>
> A process (run in a .Net transaction) executes and performs an insert into
> Table A to generate an Identity but before the transaction is completed
> the
> process runs other statements using that generated value in other tables
> for
> reference purposes. During the time these queries run, another instance
> of
> the same process performs the same insert allowing the table to auto
> generate its identity value. A certain percentage of the time, I'll get
> an
> error whereby a duplicate primary key violation occurs.
>
> Has anyone encountered anything like this and is there a way around it?
> I've tried setting differing Isolation levels, minimizing the transaction
> to
> only the section that is actually changing data, unique transaction
> names...?
>
> Thanks
>
> D
>|||In a schema where you have several branches to a snowflake describing say a
insurance distributor model, I needed a way to create a unique identifier
for each instance without having a three part key to carry to each relating
table.
The server is SQL Server 2000 with latest service packs and patches et al.
The table is being hit pretty hard as this data is being loaded to load up
the insurance distributor plans and such.
Currently the table has only in the neighborhood of 100039484 records
Inserts are simple inserts where there is one value set being put in i.e.:
INSERT INTO InsuranceDistributorPlan
(DistributorID, PlanPeriodId, PlanTypeID, Name, Source)
-- VALUES (-90000, -2004, 1, 'Davids test category', 4);
SELECT -90000, -2004, 1, 'Jeffs test category', 4
This creates and unique identifier for me to then relate other data items
to.
This type of query is being run from a .Net application (explicit
transactions don't appear to affect the issue).
Identities are reset when a rollback occurs so why would this issue arrise?
"Thomas" <thomas@.newsgroup.nospam> wrote in message
news:%23X7fSKyOFHA.1932@.tk2msftngp13.phx.gbl...
> Instead claiming that the sky is falling like senor Joe and give up
identity
> columns, there are a couple of more practical ideas. The most important
> solution is to reproduce the problem. What version of SQL Server? How many
> records in the database? How hard is the table being hit? What do the
> inserts look like?
> For example, one solution would be a simple retry mechanism (which btw,
Joe,
> would be needed with any sort of sequencing mechanism).
>
> Thomas
>
> "news" <DavidP> wrote in message
> news:ugrawntOFHA.2144@.TK2MSFTNGP09.phx.gbl...
into
transaction
>|||I presume that SQL has been patched to service pack 3a? What
indexes are on the table? Script them using the QA and post
them to them to group if you can. (Change the column names
and/or index names if you like)
There is a knowledge base article on an identity problem,
however it is old and has presumably been fixed in one of
the service packs. (http://tinyurl.com/46yme)
Thomas
"news" <DavidP> wrote in message
news:%23P$Hwh5OFHA.3512@.TK2MSFTNGP15.phx.gbl...
> In a schema where you have several branches to a snowflake
> describing say a
> insurance distributor model, I needed a way to create a
> unique identifier
> for each instance without having a three part key to carry
> to each relating
> table.
> The server is SQL Server 2000 with latest service packs
> and patches et al.
> The table is being hit pretty hard as this data is being
> loaded to load up
> the insurance distributor plans and such.
> Currently the table has only in the neighborhood of
> 100039484 records
> Inserts are simple inserts where there is one value set
> being put in i.e.:
> INSERT INTO InsuranceDistributorPlan
> (DistributorID, PlanPeriodId, PlanTypeID, Name, Source)
> -- VALUES (-90000, -2004, 1, 'Davids test category',
> 4);
> SELECT -90000, -2004, 1, 'Jeffs test category', 4
> This creates and unique identifier for me to then relate
> other data items
> to.
> This type of query is being run from a .Net application
> (explicit
> transactions don't appear to affect the issue).
> Identities are reset when a rollback occurs so why would
> this issue arrise?
> "Thomas" <thomas@.newsgroup.nospam> wrote in message
> news:%23X7fSKyOFHA.1932@.tk2msftngp13.phx.gbl...
> identity
> Joe,
> into
> transaction
>|||On Thu, 7 Apr 2005 10:36:42 -0700, news wrote:
(snip)
>Identities are reset when a rollback occurs
(snip)
Hi news,
While I must admit that I don't really understand the proble you
describe, I do know that this statement is incorrect. A rollback will
not reset the identity.
CREATE TABLE Test (Ident int IDENTITY(1,1) NOT NULL PRIMARY KEY,
Descr varchar(60) NOT NULL)
go
INSERT Test (Descr)
VALUES ('First row')
go
BEGIN TRANSACTION
INSERT Test (Descr)
VALUES ('Second row - will disappear after rollback')
SELECT * FROM Test
ROLLBACK TRANSACTION
go
INSERT Test (Descr)
VALUES ('Third row, to prove that IDENTITY value 2 is not reused')
SELECT * FROM Test
go
DROP TABLE Test
go
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||sorry, that was a typo..
My statement was meant to say that
"Identities aren't reset"
Thanks,
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:am2b51t2qil494ud2uc4nsmrd7glqe0d4m@.
4ax.com...
> On Thu, 7 Apr 2005 10:36:42 -0700, news wrote:
> (snip)
> (snip)
> Hi news,
> While I must admit that I don't really understand the proble you
> describe, I do know that this statement is incorrect. A rollback will
> not reset the identity.
> CREATE TABLE Test (Ident int IDENTITY(1,1) NOT NULL PRIMARY KEY,
> Descr varchar(60) NOT NULL)
> go
> INSERT Test (Descr)
> VALUES ('First row')
> go
> BEGIN TRANSACTION
> INSERT Test (Descr)
> VALUES ('Second row - will disappear after rollback')
> SELECT * FROM Test
> ROLLBACK TRANSACTION
> go
> INSERT Test (Descr)
> VALUES ('Third row, to prove that IDENTITY value 2 is not reused')
> SELECT * FROM Test
> go
> DROP TABLE Test
> go
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)

Friday, March 9, 2012

Question about CHECKCATALOG.

Hello,
Is there a parameter that can be used with CHECKCATALOG so
that it checks every database on the server, or does it
have to be run separately for each database.
Also, is this one of those routines that should be
regularly run for best practice purposes?
Thanks.
-LThe command cannot by itself run over several databases. You can write a
cursor to loop the databases, or use the undocumented (at own risk)
sp_MSforeachdb procedure (which loops in a cursor for you), search the net
for usage details.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Loudoun" <lemswiler@.rhcc.com> wrote in message
news:098d01c3aa18$a83ef0a0$a001280a@.phx.gbl...
> Hello,
> Is there a parameter that can be used with CHECKCATALOG so
> that it checks every database on the server, or does it
> have to be run separately for each database.
> Also, is this one of those routines that should be
> regularly run for best practice purposes?
> Thanks.
> -L