View Complete Post
I know that if you want to empty a table, truncate is a better option because it logs less information than a delete would. But is there any benefit of using a delete and having the log contain all the deleted records?
I have a group of developers that are creating stored procedures, in them they are dropping a table and re-creating the table and then continuing with the processing. My question is if there is any difference between the effect of dropping a table
and truncating the table on database fragmentatiom.
SQL Server 2008 Mgmt Studio doc, backup a transaction log, says clearly:
Transaction log section:
For routine log backups, keep the default selection,
Truncate the transaction log by removing inactive entries
But I have been back and forth in SQL Server 2008 Mgmt Studio, editing my Backup Database Task. I pick the
backup type Transaction Log. I see the Disk and Tape options; the backup file and subdirectory options; Verify backup integrity option; Backup the tail of the log; set backup compress
I am writting a stored procedure to purge data from table every month. There is no constraint on table column except primary key.
I am using 'delete' statement as it records an entry in the transaction log for each deleted row. But it's a slow process compared to 'Truncate' statement.
Can you please suggest what should I choose (Delete or truncate) as per best practice.
I have two stored procedures: one to insert and one to update. On my web page I pass a string stored in a label control to a particular Varchar field in the database table using vb.net code like this:
.Parameters.Add("@repstring", SqlDbType.VarChar).Value = lblRecurrString.Text
What stumps me is that only the first 50 characters of the string got into the designated database field upon update. I've stepped through the program in debug mode to make sure that lblRecurrString.Text doesn't got cut off first before being passed
to the stored procedure. The same code is used in passing the value to the Insert stored procedure on another web page, yet the entire string got in without being cut off. The code there was even programmed wrong as SqlDbType.NVarChar
yet there's no problem.
So why on the update web page, with the data type coded correctly, the string got cut off? Any pointer appreciated.
I am a noob SQL 2008 DBA and had a quick question on the maintenance plans. Under the database/tasks/backup function under options there is checkbox to truncate logs when they are being backed up. Yet when I create a transaction log backup job using the maintenance wizard
the checkbox is missing for that option. Why is that missing?
I have an application that is writing logging information to a file, I would like to find a means of rotating the logfile so that the file doesn't get too large.
I have a column([URL]) in my Table ([Titles]) it has url's with different lengths, I want to display the URL (only till start of the query string ) in Gridview from this column
Eg: www.asp.net?thisis%test.cid -- is the original one in DB and i want output to be like
www.asp.net ( only till the ?). I know how to do this via C# code but I am drawing blank on how to do this in a query or Stored Proc. Any help is appreciated
I am using SQL 2008
i have website that i work with my tables directly in my project in parts that user enter information i use store procedure and for other part i use linq code and my site is 3-layer but my friend says i can truncate your table because u work with tables directly u must use temporary table in sql that are in temp database. is it right?if it is right give me source or learning thing
var grid = new WebGrid(Model, canPage: true, canSort: true);
grid.Column("Comment", "Comment1", format: @<text>@Html.Truncate("Test string", 4)</text>),
grid.Column("Comment", "Comment2", format: @<text>@Html.Truncate(@item.Comment, 8)</text>),
grid.Column("Comment", "Comment3", format: @<text>@item.Comment</text>)
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.Compiler Error Message: CS1502: The best overloaded method match for 'System.Web.Helpers.WebGrid.Column(string, string