Showing posts with label servers. Show all posts
Showing posts with label servers. Show all posts

Tuesday, March 27, 2012

Help with booleans with UPDATE command.

Hello,

I'm using a Gridview to display a list of servers. Each server has a column in a table called "Enabled." I want to create a button that is supposed to toggle the value called "Enabled." I am able to make the button either to set Enabled to true or false, but I don't know how to make it toggle.

Here is the command:

UpdateCommand="UPDATE [ServerStatus] SET [Enabled] = 1 WHERE [ServerName] = @.ServerName"

The button is a buttonfield in the gridview:

<asp:ButtonField ButtonType="Button" CommandName="Update" HeaderText="Toggle" ShowHeader="True" Text="Toggle" />

Does anyone know the syntax, or a way to make the button set Enabled to true when it is false, and false when it is set to true?

UPDATE [ServerStatus]SET [Enabled] =CASE [Enabled]WHEN 1THEN 0ELSE 1END WHERE [ServerName] = @.ServerName
That should work for you if you want SQL Server to do the toggling.|||

Works like a charm.

Thanks dude.

Friday, March 9, 2012

Help using copy database wizard

I am trying to copy a database from one sql server 2005 to another. I am a sysadmin on both servers. I first tried copying the same database on the same server using the wizard and it worked :). However when I tried copying it to a different server, Execute SQL Server Agent Job fails. Unfortunately, I don't know the exact error; the error message ought to have been logged to windows event log, however after I open the event viewer, I can't find any error whatsoever logged to application. I tried having the error logged to a local directory as a text file and after the error occured, I still cannot find the error log :(
The difference between copying a database from the same server to copying on different servers is the "Location of Source Database Files", included in the wizard. I am not sure what to place in the field "File share on source server". Do I need to create a file share folder? Where can I have information on how and why it is necessary?
Thanks for taking your time to help me.

Candy

The online or local help for Copy Database Wizard goes into more detail, but I can give a couple of possible tips:

1. Remote job event logs or files will show up on the destination server machine not the machine running CDW (if they are different machines). Look in the WIndows event log on that machine, or in the file system there if you redirected error output logging to a file.

2. Location of Source Database Files refers to the path to the .mdf/.ldf files of the source datatase as seen from the destination machine. Usually in the form of a net share path of the form \\machine\share\... which you share out to get at the data files for the database you want to copy. CDW will invoke a job on the destination machine under either your domain account or some proxy account (depending on how you indicate it) which will use the file share path you gave it in the wizard to try to access the source machine's database data and log files. Share security permissions are also material just like you were trying to map the source machine share and copy the files yourself using Windows Explorer on the destination machine.

Hope that helps, and the online or local help can give some more details on what I summarized above.

|||What is the service pack level on both SQL Server instances?|||I am running service pack 2 on the source machine and service pack 1 on the destination machine.|||

Best way to solve look microsoft online help issue about SQL server 2005

Thanks

Faiz Farazi

www.databasetimes.net

Best learning center for Microsoft

http://www.lascomp.com

Wednesday, March 7, 2012

Help Updating Data Across Servers

Hi,
We have two DataBases Residing on two different Servers. We would like to
set up real time uodates between these two servers.
We have an Inventory System on server A and a Tracking System on Server B.
Now an Transaction in Server B should Update a Certain Table or Tables on
Server A. and vice versa.
I would like people to help me choose the Best soulution for this to work
successfully.
I was leaning towards Linked Servers anfd The making use of triggers. Is
this a Good Option.
But waht happens if the Trigger Fails how do we get the data Across to the
Servers.
Thanks for your help in advance.
Thanks,
Jothi
Hi,
If the database is residing in 2 servers and if you need to update data to
and fro then the only solution is using Linked servers and Triggers
But update Trigger using linked server will slow down the process.
Thanks
Hari
SQL Server MVP
"Jothi" <Jothi@.discussions.microsoft.com> wrote in message
news:1B9DD1BE-0DFB-4480-BD24-97C4C10A97C2@.microsoft.com...
> Hi,
> We have two DataBases Residing on two different Servers. We would like to
> set up real time uodates between these two servers.
> We have an Inventory System on server A and a Tracking System on Server B.
> Now an Transaction in Server B should Update a Certain Table or Tables on
> Server A. and vice versa.
> I would like people to help me choose the Best soulution for this to work
> successfully.
> I was leaning towards Linked Servers anfd The making use of triggers. Is
> this a Good Option.
> But waht happens if the Trigger Fails how do we get the data Across to the
> Servers.
> Thanks for your help in advance.
> Thanks,
> Jothi
>
|||hari,
Yes the data is acroos two servers.
How do i handle situations where a trigger fails.
DUe to non avialability of a server.
Thanks,
Jothi
"Hari Prasad" wrote:

> Hi,
> If the database is residing in 2 servers and if you need to update data to
> and fro then the only solution is using Linked servers and Triggers
> But update Trigger using linked server will slow down the process.
> Thanks
> Hari
> SQL Server MVP
> "Jothi" <Jothi@.discussions.microsoft.com> wrote in message
> news:1B9DD1BE-0DFB-4480-BD24-97C4C10A97C2@.microsoft.com...
>
>

Help Updating Data Across Servers

Hi,
We have two DataBases Residing on two different Servers. We would like to
set up real time uodates between these two servers.
We have an Inventory System on server A and a Tracking System on Server B.
Now an Transaction in Server B should Update a Certain Table or Tables on
Server A. and vice versa.
I would like people to help me choose the Best soulution for this to work
successfully.
I was leaning towards Linked Servers anfd The making use of triggers. Is
this a Good Option.
But waht happens if the Trigger Fails how do we get the data Across to the
Servers.
Thanks for your help in advance.
Thanks,
JothiHi,
If the database is residing in 2 servers and if you need to update data to
and fro then the only solution is using Linked servers and Triggers
But update Trigger using linked server will slow down the process.
Thanks
Hari
SQL Server MVP
"Jothi" <Jothi@.discussions.microsoft.com> wrote in message
news:1B9DD1BE-0DFB-4480-BD24-97C4C10A97C2@.microsoft.com...
> Hi,
> We have two DataBases Residing on two different Servers. We would like to
> set up real time uodates between these two servers.
> We have an Inventory System on server A and a Tracking System on Server B.
> Now an Transaction in Server B should Update a Certain Table or Tables on
> Server A. and vice versa.
> I would like people to help me choose the Best soulution for this to work
> successfully.
> I was leaning towards Linked Servers anfd The making use of triggers. Is
> this a Good Option.
> But waht happens if the Trigger Fails how do we get the data Across to the
> Servers.
> Thanks for your help in advance.
> Thanks,
> Jothi
>|||hari,
Yes the data is acroos two servers.
How do i handle situations where a trigger fails.
DUe to non avialability of a server.
Thanks,
Jothi
"Hari Prasad" wrote:

> Hi,
> If the database is residing in 2 servers and if you need to update data to
> and fro then the only solution is using Linked servers and Triggers
> But update Trigger using linked server will slow down the process.
> Thanks
> Hari
> SQL Server MVP
> "Jothi" <Jothi@.discussions.microsoft.com> wrote in message
> news:1B9DD1BE-0DFB-4480-BD24-97C4C10A97C2@.microsoft.com...
>
>

Help Updating Data Across Servers

Hi,
We have two DataBases Residing on two different Servers. We would like to
set up real time uodates between these two servers.
We have an Inventory System on server A and a Tracking System on Server B.
Now an Transaction in Server B should Update a Certain Table or Tables on
Server A. and vice versa.
I would like people to help me choose the Best soulution for this to work
successfully.
I was leaning towards Linked Servers anfd The making use of triggers. Is
this a Good Option.
But waht happens if the Trigger Fails how do we get the data Across to the
Servers.
Thanks for your help in advance.
Thanks,
JothiHi,
If the database is residing in 2 servers and if you need to update data to
and fro then the only solution is using Linked servers and Triggers:)
But update Trigger using linked server will slow down the process.
Thanks
Hari
SQL Server MVP
"Jothi" <Jothi@.discussions.microsoft.com> wrote in message
news:1B9DD1BE-0DFB-4480-BD24-97C4C10A97C2@.microsoft.com...
> Hi,
> We have two DataBases Residing on two different Servers. We would like to
> set up real time uodates between these two servers.
> We have an Inventory System on server A and a Tracking System on Server B.
> Now an Transaction in Server B should Update a Certain Table or Tables on
> Server A. and vice versa.
> I would like people to help me choose the Best soulution for this to work
> successfully.
> I was leaning towards Linked Servers anfd The making use of triggers. Is
> this a Good Option.
> But waht happens if the Trigger Fails how do we get the data Across to the
> Servers.
> Thanks for your help in advance.
> Thanks,
> Jothi
>|||hari,
Yes the data is acroos two servers.
How do i handle situations where a trigger fails.
DUe to non avialability of a server.
Thanks,
Jothi
"Hari Prasad" wrote:
> Hi,
> If the database is residing in 2 servers and if you need to update data to
> and fro then the only solution is using Linked servers and Triggers:)
> But update Trigger using linked server will slow down the process.
> Thanks
> Hari
> SQL Server MVP
> "Jothi" <Jothi@.discussions.microsoft.com> wrote in message
> news:1B9DD1BE-0DFB-4480-BD24-97C4C10A97C2@.microsoft.com...
> > Hi,
> > We have two DataBases Residing on two different Servers. We would like to
> > set up real time uodates between these two servers.
> > We have an Inventory System on server A and a Tracking System on Server B.
> > Now an Transaction in Server B should Update a Certain Table or Tables on
> > Server A. and vice versa.
> >
> > I would like people to help me choose the Best soulution for this to work
> > successfully.
> >
> > I was leaning towards Linked Servers anfd The making use of triggers. Is
> > this a Good Option.
> >
> > But waht happens if the Trigger Fails how do we get the data Across to the
> > Servers.
> >
> > Thanks for your help in advance.
> >
> > Thanks,
> > Jothi
> >
>
>

Friday, February 24, 2012

Help selecting Veritas products

I have two Windows Server 2003 servers. One is a domain controller and the
other has SQL Server. The tape drive is in the domain controller. Am I OK
with Backup Exec 10d for Windows Servers and a remote agent for SQL Server
for Windows Server?
ThanksHi
You could back up your database to disc (a network resource) and then you
would not need the remote agent.
John
"r042wal" wrote:
> I have two Windows Server 2003 servers. One is a domain controller and the
> other has SQL Server. The tape drive is in the domain controller. Am I OK
> with Backup Exec 10d for Windows Servers and a remote agent for SQL Server
> for Windows Server?
> Thanks
>
>|||r042wal wrote:
> I have two Windows Server 2003 servers. One is a domain controller and the
> other has SQL Server. The tape drive is in the domain controller. Am I OK
> with Backup Exec 10d for Windows Servers and a remote agent for SQL Server
> for Windows Server?
> Thanks
>
Don't use a backup agent to do SQL backups, they tend to be problematic
at best, and take longer to backup than a "normal" SQL backup. Just use
the SQL command BACKUP to dump the database contents to a disk file,
then backup that disk file using your tape backup software.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Tracy, can the backup command in SQL be automated? I want to do a scheduled
backup nightly.
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:uXSKJRmuGHA.3392@.TK2MSFTNGP04.phx.gbl...
> r042wal wrote:
>> I have two Windows Server 2003 servers. One is a domain controller and
>> the other has SQL Server. The tape drive is in the domain controller.
>> Am I OK with Backup Exec 10d for Windows Servers and a remote agent for
>> SQL Server for Windows Server?
>> Thanks
> Don't use a backup agent to do SQL backups, they tend to be problematic at
> best, and take longer to backup than a "normal" SQL backup. Just use the
> SQL command BACKUP to dump the database contents to a disk file, then
> backup that disk file using your tape backup software.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||Hi
If you right click the database in the treeview of Enterprise Manager and
choose the backup option, then at the bottom of the general tab is an option
to schedule the backup. Alternatively you can look at using a maintenance
plan which will also allow you to schedule tasks for multiple databases and
allows you to do other things like index reorganization. To create a new
maintenance plan check out the Management branch, right click Database
Maintenance Plans and choose New Maintenance Plan.
John
"r042wal" wrote:
> Tracy, can the backup command in SQL be automated? I want to do a scheduled
> backup nightly.
> Thanks
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:uXSKJRmuGHA.3392@.TK2MSFTNGP04.phx.gbl...
> > r042wal wrote:
> >> I have two Windows Server 2003 servers. One is a domain controller and
> >> the other has SQL Server. The tape drive is in the domain controller.
> >> Am I OK with Backup Exec 10d for Windows Servers and a remote agent for
> >> SQL Server for Windows Server?
> >>
> >> Thanks
> >
> > Don't use a backup agent to do SQL backups, they tend to be problematic at
> > best, and take longer to backup than a "normal" SQL backup. Just use the
> > SQL command BACKUP to dump the database contents to a disk file, then
> > backup that disk file using your tape backup software.
> >
> >
> >
> > --
> > Tracy McKibben
> > MCDBA
> > http://www.realsqlguy.com
>
>|||r042wal wrote:
> Tracy, can the backup command in SQL be automated? I want to do a scheduled
> backup nightly.
>
Absolutely, just setup a job in SQL Agent that runs the necessary BACKUP
command(s). You might also have a look at a script I've written that I
use to do backups:
http://realsqlguy.com/twiki/bin/view/RealSQLGuy/AutomaticBackupOfAllDatabases
Tracy McKibben
MCDBA
http://www.realsqlguy.com

Help selecting Veritas products

I have two Windows Server 2003 servers. One is a domain controller and the
other has SQL Server. The tape drive is in the domain controller. Am I OK
with Backup Exec 10d for Windows Servers and a remote agent for SQL Server
for Windows Server?
ThanksHi
You could back up your database to disc (a network resource) and then you
would not need the remote agent.
John
"r042wal" wrote:

> I have two Windows Server 2003 servers. One is a domain controller and th
e
> other has SQL Server. The tape drive is in the domain controller. Am I O
K
> with Backup Exec 10d for Windows Servers and a remote agent for SQL Server
> for Windows Server?
> Thanks
>
>|||r042wal wrote:
> I have two Windows Server 2003 servers. One is a domain controller and th
e
> other has SQL Server. The tape drive is in the domain controller. Am I O
K
> with Backup Exec 10d for Windows Servers and a remote agent for SQL Server
> for Windows Server?
> Thanks
>
Don't use a backup agent to do SQL backups, they tend to be problematic
at best, and take longer to backup than a "normal" SQL backup. Just use
the SQL command BACKUP to dump the database contents to a disk file,
then backup that disk file using your tape backup software.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Tracy, can the backup command in SQL be automated? I want to do a scheduled
backup nightly.
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:uXSKJRmuGHA.3392@.TK2MSFTNGP04.phx.gbl...
> r042wal wrote:
> Don't use a backup agent to do SQL backups, they tend to be problematic at
> best, and take longer to backup than a "normal" SQL backup. Just use the
> SQL command BACKUP to dump the database contents to a disk file, then
> backup that disk file using your tape backup software.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||Hi
If you right click the database in the treeview of Enterprise Manager and
choose the backup option, then at the bottom of the general tab is an option
to schedule the backup. Alternatively you can look at using a maintenance
plan which will also allow you to schedule tasks for multiple databases and
allows you to do other things like index reorganization. To create a new
maintenance plan check out the Management branch, right click Database
Maintenance Plans and choose New Maintenance Plan.
John
"r042wal" wrote:

> Tracy, can the backup command in SQL be automated? I want to do a schedul
ed
> backup nightly.
> Thanks
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:uXSKJRmuGHA.3392@.TK2MSFTNGP04.phx.gbl...
>
>|||r042wal wrote:
> Tracy, can the backup command in SQL be automated? I want to do a schedul
ed
> backup nightly.
>
Absolutely, just setup a job in SQL Agent that runs the necessary BACKUP
command(s). You might also have a look at a script I've written that I
use to do backups:
http://realsqlguy.com/twiki/bin/vie...realsqlguy.com

Sunday, February 19, 2012

Help Required Urgently(SQL Server Agent)

On one of our servers the sqlseragent was running fine. But now it is not running. We se the option to start the server agent each time the OS starts. Even when I tried to start the agent manually from service manager it is not starting. Would any one help on this urgently.

Also how can we identify under what account any job runs. The reason is when we deleted some NT user accounts one of the job failed as this job runs under that userid. But in the properties it shows that sa is the owner of that job. What is best way to create a job so that these jobs run under one userid so that it won't fail when we delete users.

ThanksLook at the properties page for the SQL Server Agent and see what account it is running under. You may have deleted the account it was using. Alternatively, you can open Services under Administrative Tools and view what account it is running under.

As for the owner of jobs, right-click on the job and choose properties. You will see a drop down box called Owner. You can set the desired owner here.

Roby2222|||Thanks It worked. Actually what happend is the SQL server agent is running under sa. Recently we changed the password for sa. When I used this new password then the SQL Agent started.
My question is when ever we change the password for sa, and when the sql server starts with this new login password, doesn't the Agent also start with
this new password. Do we have to manually change the login password for the Agent?

For the second question, this particular job was failed because we deleted the userid and the error says that the job did not find the specified user. But when I checked the properties the owner is showing as sa. I am not sure why it got that error. That is why I wanted to find out from all the jobs which runs under the deleted username.
Please advise.
Thanks|||My preference for SQL Server Agent is to use a Domain account, rather than a SQL Server Login. This allows SQL Server Agent to access network resources under the credentials of a domain account. This might be necessary if you want a job to move a file to a network share, or a similar operation. We use the same domain account that the SQL Server Service uses, though you could use two different ones if you want to.

As far as the credentials for the Job, I would create a SQL Server Login specifically for Jobs. It's a little more secure and also provides you with the added benefit on not having to worry about your jobs every time you change the SA password.

Roby2222|||One more advantage with using a specifik domain account for you SQL Agent is that then you don't accidentally delete any user accounts that have been used for SQL tasks...