SQL geniuses

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

slycat

Diamond Member
Jul 18, 2001
5,656
0
0
Originally posted by: KnightBreed
slycat, is the second database only going to be used for backup purposes or will it need to be load balanced with active user making updates to both?

If it's the former, you can always schedule DTS tasks or something every few hours to update the backup database. Simple and reasonably reliable, but by no means an "enterprise" solution.

just for backup purposes..not live.
 
Jun 18, 2000
11,208
775
126
While we're on the topic of SQL, I'm trying to create a procedure in SQL Server2000 that loads up a table that lists everybody connected to the database.

I'm trying to use sp_who to get the list of connected users, but I'm having difficulty incorporating it into an INSERT statement to save the results from the procedure.

Is there a system table or view that I can retrieve from so that I don't need sp_who?
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: slycat
can i also ask a question?
i have 2 sql2000 servers side by side. i have 1 database on one that i wanna set up replication(hot,cold,warm) for standby purposes in case the main one dies or something? someone hook me up? o yeh, i'm sql dumb :)

I'm not a DBA, but I know that we have a setup like this. We use to have an active-passive cluster about a year ago, but we had so many issues that we went back to just having a production server and a backup server. I don't know all the details of how it's done, but we use log shipping. We have a system set up so if our primary server goes down, we can have the backup server up and ready in about 15-20 minutes. I think it involves doing a restore from the daily backup onto the second server, then running the saved transaction logs to get everything up to current state.

There is a description of log shipping right here.
 
Jun 18, 2000
11,208
775
126
Originally posted by: slycat
Originally posted by: KnightBreed
slycat, is the second database only going to be used for backup purposes or will it need to be load balanced with active user making updates to both?

If it's the former, you can always schedule DTS tasks or something every few hours to update the backup database. Simple and reasonably reliable, but by no means an "enterprise" solution.

just for backup purposes..not live.
How big is the database? How many tables?
How often will it need to be updated?
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: bleeb
I never said the only solution was to wait for terrorists... in their minds, they are doing the right thing. I just said that we can't go about killing their families to show them they are wrong. The point I was trying make was that if the U.S. did this, they would become terrorists themselves. This has certain negative ramifications, possibly increasing the support of more people for the terrorists.

This I certainly agree with. I would never advocate that we do anything like that. It would make us no better than them. Not to mention the fact that it wouldn't work. It would motivate even more people to join them.
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
If you create a table with columns that match the resultset of sp_who, you can do this:

insert into tblMyTable
exec sp_who

You should also be able to get the information you need from:

use master
select distinct loginname from sysprocesses
 
Jun 18, 2000
11,208
775
126
Originally posted by: DT4K
If you create a table with columns that match the resultset of sp_who, you can do this:

insert into tblMyTable
exec sp_who
Thanks, that's exactly what I was looking for.
You should also be able to get the information you need from:

use master
select distinct loginname from sysprocesses
Yea, I just found that a little bit ago in the Books Online (Transact-SQL reference > System Tables > sysprocesess).

edit: In hindsight, I might end up just selecting from sysprocess instead. I would prefer to avoid having to create a new table to temporarily store the rows before processing.
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
This has got to be one of the strangest threads I've seen.

Title should be "Link found between SQL and terrorism"
 

slycat

Diamond Member
Jul 18, 2001
5,656
0
0
Originally posted by: KnightBreed
Originally posted by: slycat
Originally posted by: KnightBreed
slycat, is the second database only going to be used for backup purposes or will it need to be load balanced with active user making updates to both?

If it's the former, you can always schedule DTS tasks or something every few hours to update the backup database. Simple and reasonably reliable, but by no means an "enterprise" solution.

just for backup purposes..not live.
How big is the database? How many tables?
How often will it need to be updated?

hmm..600meg size. 110 tables.
how often..i'm not sure...maybe twice a day or something.
 

DannyBoy

Diamond Member
Nov 27, 2002
8,820
2
81
www.danj.me
Originally posted by: DT4K
This has got to be one of the strangest threads I've seen.

Title should be "Link found between SQL and terrorism"

Holy sh!t you have my thread in your Sig, respecta :cool:

Glad to see the :cookie; supporters staying strong :thumbsup:

:cookie;
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: DannyBoy
Originally posted by: DT4K
This has got to be one of the strangest threads I've seen.

Title should be "Link found between SQL and terrorism"

Holy sh!t you have my thread in your Sig, respecta :cool:

Glad to see the :cookie; supporters staying strong :thumbsup:

:cookie;

OK, now this is the SQL / Terrorism / Cookie icon thread.
How's that for off topic.

I saw your sig and wanted to join the cause.
:D
 

DannyBoy

Diamond Member
Nov 27, 2002
8,820
2
81
www.danj.me
Originally posted by: DT4K
Originally posted by: DannyBoy
Originally posted by: DT4K
This has got to be one of the strangest threads I've seen.

Title should be "Link found between SQL and terrorism"

Holy sh!t you have my thread in your Sig, respecta :cool:

Glad to see the :cookie; supporters staying strong :thumbsup:

:cookie;

OK, now this is the SQL / Terrorism / Cookie icon thread.
How's that for off topic.

I saw your sig and wanted to join the cause.
:D

Good stuff, you inspired me to edit the cookie thread and ask for more sig support! :D

:cookie; ;)