Showing posts with label possibility. Show all posts
Showing posts with label possibility. Show all posts

Thursday, March 29, 2012

Change logfile location durring setup SQL 2000

Is there a possibility to change the default instalation directory for
the logfiles for sql server 2000? I would like the default database
files to be placed on teh d: drive and the logfiles on the e: drive?

Sjaak van Esdonksjaakvanesdonk@.hotmail.com (Sjaak van Esdonk) wrote in message news:<7479e65c.0311130551.56e84f0c@.posting.google.com>...
> Is there a possibility to change the default instalation directory for
> the logfiles for sql server 2000? I would like the default database
> files to be placed on teh d: drive and the logfiles on the e: drive?
> Sjaak van Esdonk

Setup doesn't have a separate path for the log files, however in
Enterprise Manager you can go into the Server Properties, and on the
Database Settings tab you can select a default location for new
database files. These values are saved in registry keys, so if you
need to do it programmatically, you can edit the registry directly:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\ MSSQLServer\DefaultData
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\ MSSQLServer\DefaultLog

Simon|||Thanks Simon, that seems to work !!

Thursday, February 16, 2012

categories table

hi to all;

i want to make in my site the possibility for the user to make categories in the site

ex: he can add the category name"computer science" and then can add the category childs " data mining, software engineering,... "

so firstly i want to make a category table in my databasde to be able to save the category data

haw can i make this table? i mean what are the columns that should be in the table?what type of relationship should i make? and how to mahe it

sorry but i need any one to explain to me what should i do. and if anyone one know the solution please reply to me

thanks....

Selfreferencing tables ?

Code Snippet

DROPTABLE Categories

GO

CREATETABLE Categories

(

CategoryId INTNOTNULL,

ParentCategoryID INT,

DescriptionVARCHAR(4000)

)

GO

ALTERTABLE Categories

ADDCONSTRAINT PK_Categories PRIMARYKEY(CategoryId)

GO

ALTERTABLE Categories

ADDCONSTRAINT FK_Categories_Cetegories FOREIGNKEY(ParentCategoryId)

REFERENCES Categories(CategoryId)

GO

Jens K. Suessmeyer.

http://www.sqlserver2008.de

Sunday, February 12, 2012

Cast/convert SARGable?

If we use cast or convert in where clauses, will SQL Server 2000 still
treat that as a possible SARG (search argument) with the possibility of
using indexes, or do we lose that ability? I'm thinking in particular
of dates and numbers from text.
Thanks.No, it will not be a SARG. Make sure you use proper datatype for the columns
and you will limit the
need for this. As for datetime searches, I have some tips in
http://www.karaszi.com/SQLServer/info_datetime.asp.
SQL Server does some tricks when you have an (implicit) cast between datatyp
es in the same group
(like between the integer class datatypes). For example (Northwind database)
:
SELECT * FROM [Order Details]
WHERE OrderID = 23
The constant 23 will be treated as a tinyint. OrderID is an int. Since int h
as higher datatype
precedence (see BOL for list), the tinyint will be converted to int. You can
see that in the
execution plan. I.e., the conversion is at the constant side so this is stil
l a SARG. But consider
below:
CREATE INDEX x ON [Order Details](Quantity)
SELECT * FROM [Order Details]
WHERE Quantity = 34556647
The constant 34556647 is an int where Quantity is smallint. So now Quantity
need to be converted, so
you have a CAST on the column side. Look at the execution plan and you will
see those tricks taken
by SQL server in order to use an index in this particular case.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"OrchidPop" <cristoff@.charter.net> wrote in message
news:1124266316.795238.311570@.f14g2000cwb.googlegroups.com...
> If we use cast or convert in where clauses, will SQL Server 2000 still
> treat that as a possible SARG (search argument) with the possibility of
> using indexes, or do we lose that ability? I'm thinking in particular
> of dates and numbers from text.
> Thanks.
>|||Thanks for the reply. I had hoped cast/convert were not considered true
functions to block SARGs.
Actually, I need to check with the original developer of our
application to find out why convert is used all over the
place,particularly for dates.
Thanks!|||> Actually, I need to check with the original developer of our
> application to find out why convert is used all over the
> place,particularly for dates.
Tell me about it... Only one example, I helped a customer with a query a few
ws ago that had a
date range condition and changing it to a SARG cut down I/O from 777,000 to
2,500.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"OrchidPop" <cristoff@.charter.net> wrote in message
news:1124286059.249743.275670@.g47g2000cwa.googlegroups.com...
> Thanks for the reply. I had hoped cast/convert were not considered true
> functions to block SARGs.
> Actually, I need to check with the original developer of our
> application to find out why convert is used all over the
> place,particularly for dates.
> Thanks!
>