Showing posts with label example. Show all posts
Showing posts with label example. Show all posts

Wednesday, March 7, 2012

change the location of dat & log files**

Hi
I'm working with SQL server 2000
and I've a db called db1 and it's dat and log
files(for example) are located in root of d: directory in a server and
there are so many users working with this db.
and now I want to change the location (for example
move it to c:\sqldata,maybe because of not empty space in current
drive),how is it possible?
my second question is ,if I want to define the
second dat file and log file for a db which are placed in
different location how is it possible? and if I do
it successfully,is there anyway when I want to restore
the backup of this db ,make dat files or log files ,each of them in one
file beacause there is enough space in one drive in destination?
any help would be greatly thanked.RM
[url]http://support.microsoft.com/directory/article.asp?ID=kb;en-us;Q224071--[/url
]
Moving SQL Server Databases to a New Location
"RM" <m_r1824@.yahoo.co.uk> wrote in message
news:opsactt6e0hqligo@.msnews.microsoft.com...
> Hi
> I'm working with SQL server 2000
> and I've a db called db1 and it's dat and log
> files(for example) are located in root of d: directory in a server and
> there are so many users working with this db.
> and now I want to change the location (for example
> move it to c:\sqldata,maybe because of not empty space in current
> drive),how is it possible?
> my second question is ,if I want to define the
> second dat file and log file for a db which are placed in
> different location how is it possible? and if I do
> it successfully,is there anyway when I want to restore
> the backup of this db ,make dat files or log files ,each of them in one
> file beacause there is enough space in one drive in destination?
>
> any help would be greatly thanked.|||1. To move files, read KB 224071.
2. To add a database file, use ALTER DATABASE ADD FILE...
3. No, when you RESTORE, you have to have as many files as when you took the
backup, each file need
to have the same logical name, and be at least as big as when you took the b
ackup...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"RM" <m_r1824@.yahoo.co.uk> wrote in message news:opsactt6e0hqligo@.msnews.microsoft.com...[vb
col=seagreen]
> Hi
> I'm working with SQL server 2000
> and I've a db called db1 and it's dat and log
> files(for example) are located in root of d: directory in a server and
> there are so many users working with this db.
> and now I want to change the location (for example
> move it to c:\sqldata,maybe because of not empty space in current
> drive),how is it possible?
> my second question is ,if I want to define the
> second dat file and log file for a db which are placed in
> different location how is it possible? and if I do
> it successfully,is there anyway when I want to restore
> the backup of this db ,make dat files or log files ,each of them in one
> file beacause there is enough space in one drive in destination?
>
> any help would be greatly thanked.[/vbcol]

change the location of dat & log files**

Hi
I'm working with SQL server 2000
and I've a db called db1 and it's dat and log
files(for example) are located in root of d: directory in a server and
there are so many users working with this db.
and now I want to change the location (for example
move it to c:\sqldata,maybe because of not empty space in current
drive),how is it possible?
my second question is ,if I want to define the
second dat file and log file for a db which are placed in
different location how is it possible? and if I do
it successfully,is there anyway when I want to restore
the backup of this db ,make dat files or log files ,each of them in one
file beacause there is enough space in one drive in destination?
any help would be greatly thanked.
RM
http://support.microsoft.com/directo...Q224071--
Moving SQL Server Databases to a New Location
"RM" <m_r1824@.yahoo.co.uk> wrote in message
news:opsactt6e0hqligo@.msnews.microsoft.com...
> Hi
> I'm working with SQL server 2000
> and I've a db called db1 and it's dat and log
> files(for example) are located in root of d: directory in a server and
> there are so many users working with this db.
> and now I want to change the location (for example
> move it to c:\sqldata,maybe because of not empty space in current
> drive),how is it possible?
> my second question is ,if I want to define the
> second dat file and log file for a db which are placed in
> different location how is it possible? and if I do
> it successfully,is there anyway when I want to restore
> the backup of this db ,make dat files or log files ,each of them in one
> file beacause there is enough space in one drive in destination?
>
> any help would be greatly thanked.
|||RM
http://support.microsoft.com/directo...Q224071--
Moving SQL Server Databases to a New Location
"RM" <m_r1824@.yahoo.co.uk> wrote in message
news:opsactt6e0hqligo@.msnews.microsoft.com...
> Hi
> I'm working with SQL server 2000
> and I've a db called db1 and it's dat and log
> files(for example) are located in root of d: directory in a server and
> there are so many users working with this db.
> and now I want to change the location (for example
> move it to c:\sqldata,maybe because of not empty space in current
> drive),how is it possible?
> my second question is ,if I want to define the
> second dat file and log file for a db which are placed in
> different location how is it possible? and if I do
> it successfully,is there anyway when I want to restore
> the backup of this db ,make dat files or log files ,each of them in one
> file beacause there is enough space in one drive in destination?
>
> any help would be greatly thanked.
|||1. To move files, read KB 224071.
2. To add a database file, use ALTER DATABASE ADD FILE...
3. No, when you RESTORE, you have to have as many files as when you took the backup, each file need
to have the same logical name, and be at least as big as when you took the backup...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"RM" <m_r1824@.yahoo.co.uk> wrote in message news:opsactt6e0hqligo@.msnews.microsoft.com...
> Hi
> I'm working with SQL server 2000
> and I've a db called db1 and it's dat and log
> files(for example) are located in root of d: directory in a server and
> there are so many users working with this db.
> and now I want to change the location (for example
> move it to c:\sqldata,maybe because of not empty space in current
> drive),how is it possible?
> my second question is ,if I want to define the
> second dat file and log file for a db which are placed in
> different location how is it possible? and if I do
> it successfully,is there anyway when I want to restore
> the backup of this db ,make dat files or log files ,each of them in one
> file beacause there is enough space in one drive in destination?
>
> any help would be greatly thanked.
|||1. To move files, read KB 224071.
2. To add a database file, use ALTER DATABASE ADD FILE...
3. No, when you RESTORE, you have to have as many files as when you took the backup, each file need
to have the same logical name, and be at least as big as when you took the backup...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"RM" <m_r1824@.yahoo.co.uk> wrote in message news:opsactt6e0hqligo@.msnews.microsoft.com...
> Hi
> I'm working with SQL server 2000
> and I've a db called db1 and it's dat and log
> files(for example) are located in root of d: directory in a server and
> there are so many users working with this db.
> and now I want to change the location (for example
> move it to c:\sqldata,maybe because of not empty space in current
> drive),how is it possible?
> my second question is ,if I want to define the
> second dat file and log file for a db which are placed in
> different location how is it possible? and if I do
> it successfully,is there anyway when I want to restore
> the backup of this db ,make dat files or log files ,each of them in one
> file beacause there is enough space in one drive in destination?
>
> any help would be greatly thanked.

change the location of dat & log files**

Hi
I'm working with SQL server 2000
and I've a db called db1 and it's dat and log
files(for example) are located in root of d: directory in a server and
there are so many users working with this db.
and now I want to change the location (for example
move it to c:\sqldata,maybe because of not empty space in current
drive),how is it possible?
my second question is ,if I want to define the
second dat file and log file for a db which are placed in
different location how is it possible? and if I do
it successfully,is there anyway when I want to restore
the backup of this db ,make dat files or log files ,each of them in one
file beacause there is enough space in one drive in destination?
any help would be greatly thanked.RM
http://support.microsoft.com/directory/article.asp?ID=kb;en-us;Q224071--
Moving SQL Server Databases to a New Location
"RM" <m_r1824@.yahoo.co.uk> wrote in message
news:opsactt6e0hqligo@.msnews.microsoft.com...
> Hi
> I'm working with SQL server 2000
> and I've a db called db1 and it's dat and log
> files(for example) are located in root of d: directory in a server and
> there are so many users working with this db.
> and now I want to change the location (for example
> move it to c:\sqldata,maybe because of not empty space in current
> drive),how is it possible?
> my second question is ,if I want to define the
> second dat file and log file for a db which are placed in
> different location how is it possible? and if I do
> it successfully,is there anyway when I want to restore
> the backup of this db ,make dat files or log files ,each of them in one
> file beacause there is enough space in one drive in destination?
>
> any help would be greatly thanked.|||1. To move files, read KB 224071.
2. To add a database file, use ALTER DATABASE ADD FILE...
3. No, when you RESTORE, you have to have as many files as when you took the backup, each file need
to have the same logical name, and be at least as big as when you took the backup...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"RM" <m_r1824@.yahoo.co.uk> wrote in message news:opsactt6e0hqligo@.msnews.microsoft.com...
> Hi
> I'm working with SQL server 2000
> and I've a db called db1 and it's dat and log
> files(for example) are located in root of d: directory in a server and
> there are so many users working with this db.
> and now I want to change the location (for example
> move it to c:\sqldata,maybe because of not empty space in current
> drive),how is it possible?
> my second question is ,if I want to define the
> second dat file and log file for a db which are placed in
> different location how is it possible? and if I do
> it successfully,is there anyway when I want to restore
> the backup of this db ,make dat files or log files ,each of them in one
> file beacause there is enough space in one drive in destination?
>
> any help would be greatly thanked.

Sunday, February 19, 2012

Change SA password. Any effect to replication?

Dear all,

I have some questions regard subject above. I want to know the impact of replication process after SA pasword been changed.

Example: server1 (hq), server2 (district) & server3 (district).

If server1, SA password been changed, is it server2 & server3 need to change too?

may i know where is it the replication SA password stored? is it replication script refer ID (SA) from Security -> Logins?

I hope someone can help me.. thanks.

changing the Sa password would not harm the replication process

ideally...

replication is using the account used by the sqlserver agent services.

to know what account is your agent services running.

click start>run>type "services.msc">look for sqlserver agent

Click on Log On> this is the account used by replication.

usually this is a domain account..

if your system is configure in this manner, then changing the "Sa" password

will not matter at all.

If it configured some other way around then you have to watch out for the account

being used in the replication

Thursday, February 16, 2012

change recordset position

Hi
Table Structure
company name
Phone No
Products
Example
Company Name Phone No Products
Sri balaji Enterprises 26554432 Advertising Agents
KarthicK Call Taxi 43215434 Call Taxi
Chitra Electricals 65437654 Electricals
Udhayam Call Taxi 24358901 Call Taxi
Annamalaiyar Advertising 67542317 Advertising Agents
Mathi Vehicles 23456789 Automobiles
Chennai Media 45326754 Advertising Agents
OUTPUT FORM
Here i am using 2 combo boxes. first box list out all distinct products.(i.e)
First Combo Box loads
Advertising Agents
Automobiles
Call Taxi
Eletricals
if i click the Advertising agents in first combo box the 2nd combox will
shows the company names of who are all dealing Advertising.
so the second combo box shows
Sri balaji Enterprises
Annamalaiyar Advertising
Chennai Media.
As the same when i click call taxi
Karthick Call taxi
Udhayam Call taxi
Its working...But my problem is..........
Next time when i click Advertising agents the second combo box have to show
Annamalaiyar Advertising(2nd record have 2 come to first)
Chennai Media.(3rd record have 2 come second)
Sri balaji Enterprises(1st record have 2 go last)
same when i click call taxi
Udhayam Call Taxi(2nd record have 2 come to first)
Karthick Call taxi(1st record have 2 go last)
i dont know how to do...if anybody knows help me to do that...
Thanks in advance.Hi
"nila_vaanan" wrote:
> Hi
> Table Structure
> company name
> Phone No
> Products
> Example
> Company Name Phone No Products
> Sri balaji Enterprises 26554432 Advertising Agents
> KarthicK Call Taxi 43215434 Call Taxi
> Chitra Electricals 65437654 Electricals
> Udhayam Call Taxi 24358901 Call Taxi
> Annamalaiyar Advertising 67542317 Advertising Agents
> Mathi Vehicles 23456789 Automobiles
> Chennai Media 45326754 Advertising Agents
> OUTPUT FORM
> Here i am using 2 combo boxes. first box list out all distinct products.(i.e)
> First Combo Box loads
> Advertising Agents
> Automobiles
> Call Taxi
> Eletricals
> if i click the Advertising agents in first combo box the 2nd combox will
> shows the company names of who are all dealing Advertising.
> so the second combo box shows
> Sri balaji Enterprises
> Annamalaiyar Advertising
> Chennai Media.
> As the same when i click call taxi
> Karthick Call taxi
> Udhayam Call taxi
> Its working...But my problem is..........
> Next time when i click Advertising agents the second combo box have to show
> Annamalaiyar Advertising(2nd record have 2 come to first)
> Chennai Media.(3rd record have 2 come second)
> Sri balaji Enterprises(1st record have 2 go last)
> same when i click call taxi
> Udhayam Call Taxi(2nd record have 2 come to first)
> Karthick Call taxi(1st record have 2 go last)
> i dont know how to do...if anybody knows help me to do that...
> Thanks in advance.
>
You don't say how this listbox is being populated, but SQL Server does not
guaranteed and the order of records returned by a SQL query unless you
specify an ORDER BY clause on your statement. Check out the section on ORDER
BY in books online.
John

Change Primary Key Values

Hello,
Is there a way in SQL Server 2000 to reassign primary key
values automatically?
For example, I have a table that has a "Person ID" field
as its primary key that was started with an identity seed
of "98753162". The identity increment is "1".
Now, there are hundreds of records in this table. I want
to reassign these PK values with much shorter numbers,
i.e. subtract "98753160" from all existing values. In
addition, I would need all corresponding foreign key
values in other tables to be updated automatically with
the new values.
Thanks,
Mike1)Distable the foreign key constraint with ALTER TABLE command.
look for alter table command in BOL "alter table... nocheck ..." (look for
nocheck clause) which will stop validation of future inserts or updates to
the column.
2) add a column to primary key table and populate the values of PK to this
column with the statement as
update <table> set new_col=PK_col
3)you can update the existing primary key values with the statement such as
update table set PK_col= pk_col - 98753160 --required subtraction.(make sure
primary key constraint is not violated)
4) once this is done you will have to fire an update statement on the FK
tables to update the new FK values replacing the old one.
--
-Vishal
"Mike Rogan" <mrogan@.carolinawebdev.com> wrote in message
news:038e01c3555a$95864c50$a601280a@.phx.gbl...
> Hello,
> Is there a way in SQL Server 2000 to reassign primary key
> values automatically?
> For example, I have a table that has a "Person ID" field
> as its primary key that was started with an identity seed
> of "98753162". The identity increment is "1".
> Now, there are hundreds of records in this table. I want
> to reassign these PK values with much shorter numbers,
> i.e. subtract "98753160" from all existing values. In
> addition, I would need all corresponding foreign key
> values in other tables to be updated automatically with
> the new values.
> Thanks,
> Mike