Click here to Skip to main content
15,918,889 members
Home / Discussions / Database
   

Database

 
Questionscript execution Pin
_tasleem24-Jun-06 3:45
_tasleem24-Jun-06 3:45 
AnswerRe: script execution Pin
Colin Angus Mackay24-Jun-06 10:49
Colin Angus Mackay24-Jun-06 10:49 
Questioncan we generate a trigger for two tables? Pin
laxman.m23-Jun-06 21:24
laxman.m23-Jun-06 21:24 
AnswerRe: can we generate a trigger for two tables? Pin
Mairaaj Khan23-Jun-06 23:56
professionalMairaaj Khan23-Jun-06 23:56 
Questionunused space Pin
manolomachin23-Jun-06 13:32
manolomachin23-Jun-06 13:32 
AnswerRe: unused space Pin
Mairaaj Khan23-Jun-06 23:41
professionalMairaaj Khan23-Jun-06 23:41 
GeneralRe: unused space Pin
manolomachin26-Jun-06 5:18
manolomachin26-Jun-06 5:18 
AnswerRe: unused space Pin
Mike Dimmick27-Jun-06 0:28
Mike Dimmick27-Jun-06 0:28 
Check the individual files. I'd be prepared to bet that your transaction log is huge while the data file is fairly small.

What you need to do is decide how you want to maintain your database. If you want to be able to recover the database to any point in time, including rolling forward transactions to the point of failure when restoring from your last backup, you need SQL Server to maintain everything that's happened in the transaction log: the Full Recovery Model option. If you're doing this, you need to back up the transaction log as well as the database file using the SQL Server backup feature or a third-party backup solution that understands SQL Server properly (not just backing up the files); once the transaction log is backed up SQL Server will mark the backed-up parts of the file as being free and start reusing them rather than growing the file. You'll have to use shrink with the 'move to start of file' option to actually make the file smaller.

Yes, I would have expected a Full Database Backup to also perform this transaction log clearing - that's what Exchange does. SQL Server doesn't.

If you use bulk inserts and don't want every bulk-inserted row to be recorded in the transaction log, instead performing the bulk inserts again after a restore, consider the Bulk Logged Recovery Model option. I'm not sure if it will actually replay a bulk insert operation if the file is still present in the same location during a restore.

If you're just experimenting with something and aren't going to back it up, or the database is simply a replica of something else, or you only want to restore the last full backup and don't care about transactions that have occurred since, consider the Simple recovery model. SQL Server then still writes to the transaction log - it uses it to recover the state of the database in the case of a power outage or a software failure - but marks the space taken by the log records as free as soon as the transaction that created them commits. It can then reuse them very quickly, keeping the size of the transaction log down.

Stability. What an interesting concept. -- Chris Maunder
GeneralRe: unused space Pin
manolomachin28-Jun-06 8:54
manolomachin28-Jun-06 8:54 
QuestionSQL Update problem I'm still having. Pin
PyroManiak23-Jun-06 8:59
PyroManiak23-Jun-06 8:59 
QuestionRe: SQL Update problem I'm still having. Pin
Alexander Wiseman23-Jun-06 9:15
Alexander Wiseman23-Jun-06 9:15 
AnswerRe: SQL Update problem I'm still having. Pin
PyroManiak23-Jun-06 9:53
PyroManiak23-Jun-06 9:53 
GeneralRe: SQL Update problem I'm still having. Pin
Alexander Wiseman23-Jun-06 10:59
Alexander Wiseman23-Jun-06 10:59 
GeneralRe: SQL Update problem I'm still having. Pin
PyroManiak23-Jun-06 12:35
PyroManiak23-Jun-06 12:35 
GeneralRe: SQL Update problem I'm still having. Pin
Alexander Wiseman23-Jun-06 13:20
Alexander Wiseman23-Jun-06 13:20 
Questiondatabase newbie; what do i need in order to accomplish the following simple application Pin
katsolimon23-Jun-06 6:19
katsolimon23-Jun-06 6:19 
AnswerRe: database newbie; what do i need in order to accomplish the following simple application Pin
Kschuler23-Jun-06 9:22
Kschuler23-Jun-06 9:22 
GeneralRe: database newbie; what do i need in order to accomplish the following simple application Pin
katsolimon23-Jun-06 11:21
katsolimon23-Jun-06 11:21 
QuestionAlter column? Pin
Kschuler23-Jun-06 6:16
Kschuler23-Jun-06 6:16 
AnswerRe: Alter column? Pin
Eric Dahlvang23-Jun-06 6:26
Eric Dahlvang23-Jun-06 6:26 
GeneralRe: Alter column? Pin
Kschuler23-Jun-06 8:57
Kschuler23-Jun-06 8:57 
Questionnot sure of advantages of functions over stored procedures Pin
sishya23-Jun-06 2:33
sishya23-Jun-06 2:33 
AnswerRe: not sure of advantages of functions over stored procedures Pin
J4amieC23-Jun-06 3:11
J4amieC23-Jun-06 3:11 
GeneralRe: not sure of advantages of functions over stored procedures Pin
Colin Angus Mackay23-Jun-06 3:42
Colin Angus Mackay23-Jun-06 3:42 
GeneralRe: not sure of advantages of functions over stored procedures Pin
J4amieC26-Jun-06 2:49
J4amieC26-Jun-06 2:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.