the SQL I am running is this:
DECLARE @startingdate datetime;
DECLARE @endingdate datetime;
SET @startingdate = '01/01/2007';
SET @endingdate = '12/31/2007';
IF OBJECT_ID (N'dbo.Temp_ReportData', N'U') IS NOT NULL
DROP TABLE dbo.Temp_ReportData;
SELECT
ITEM AS NAME,
INVDATE AS...
I wanted to update an entire column (January) in my report table. I need a different way to do this. I got this error when running the following:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an...
The Non-profit I work for sells registrations to courses as the main business. Only once every 24 hours is a process run that updates the counts, and so occasionally there is overbooking. The reason is that it takes a long time to run, and this was a poor design anyway.
I want to add an...
I have a large SQL statement with a Union to another large SQL stmt. When I run it I see the data in the results pane of query analyzer. I want to put the results into a temp table to be able to write additional sql statements to update another table. Also to speed up execution I should...
I have a very complex crosstab type of report I have been assigned to produce and my approach has been to create a temp file in the database with all the column headings and zeros in all the places where the numbers would go. What I want to do is to use several SQL statements to update the...
I have an update query I need to run one time:
UPDATE memaddr
SET {memaddr.Address1 = Temp_NonDPV_Batch.Address1,
memaddr.Address2 = Temp_NonDPV_Batch.Address2,
memaddr.city = Temp_NonDPV_Batch.city,
memaddr.state = TEMP_NonDPV_Batch.state,
memaddr.zip =...
I have the following SQL backup command that runs every night. It sometimes fails and I wanted to add a notification email to "infosys"
BACKUP DATABASE [S030] TO DISK = N'\\Sh-case2\S030Backup\S030Full.bak' WITH INIT , NOUNLOAD , NAME = N'S030 backup FULL', NOSKIP , STATS = 10...
I have recovered data (Database Trackit, table tasks) on my desktop machine running SQL 2005 Developer. The data needs to be inserted into the (Database Trackit, table tasks table) on the SQL1 Server. I want to insert all records from my desktop onto the Sql1 Server. I did Register the...
Where is the Query Analyzer?
I got lucky on my Restore of my database from the earlier thread. So I restored the database to my desktop computer using 2005 Sql Developer edition. So in SQL 2000 I used to go into SQL Query Analyzer to type various Sql cmds and execute them. How can I do...
Yesterday when I was out sick, a user of our track-it system accidently deleted all records. This is a sql server database that is backed up (FULL), once every 24 hours and I was not informed before the next backup occured.
Is it possible to recover these deleted records?
I was doing a routine inspection of my sql server machine and found that the tempdb database has grown to the point of nearly filling the Hard drive. I don't know what size it should be, but the last date on it is June 5th, 2007. it is 53 Gigabytes and the largest database is 24 gigabytes.
I...
I stepped into this job in the second week of April. They had not had a backup since December. So I immediately did a full backup.
This is a 24 hour 7 day a week shop with no scheduled downtimes for maintenance.
The only thing I have succeeded in implementing so far is backups and I have...
I checked the logs on Server Case2 which is only being used as a backup device presently. I have disabled all the jobs the SQL agent had listed. Last night several of these messages appeared:
Date Source Message
2007-05-16 11:04.10.77 Server The scheduler 2...
I created a new Database this morning for testing restores.
It is S030_B. The logical files are S030_B_Log and S030_B_data - default values.
For an hour I have been trying to restore to this database.
When I try to restore from a differential backup, I get the following error message...
I attempted a restore from a differential backup to a test database and aborted it when I realized that I was restoring File 1 and not the latest version of the data. That may have corrupted something because, when I try to delete the database through Enterprise manager, it says that the...
Manangement would like to see who is using the application that accesses the S030 database. We want to track total time logged in and get a complete list over time to see who is using the database. How can I do that?
I successfully added a backup device with the sp_addumpdevice command.
Next I tried to restore the S030 Database with this command:
restore database S030 from [S030diff] with replace
S030Diff is a backup of the S030 database from the production server. I am trying to restore to another...
Friday night the system administrator setup a new Domain controller using windows 2003. Previously we had as a domain controler a SQL server machine running 2000. Now access to databases located on that SQl machine is not working die to a permissions issue that we have been unable to resolve...
I am currently doing Full backups every evening. But if we had a hard drive failure losing a whole days work is unacceptable. I heard that you can do differential backups along with Transaction log backups and lose little or no data in the event of a hard drive failure. How does this work...
One of my users can't get the main SQL database as an option from which to import data into Microsoft Visio.
We have dozens of databases but only a few are set up and available to select as Data Sources through ODBC. Where do I need to set up the ODBC? Is there a SQL setting I need to make in...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.