.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

truncate only

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :Sql Server
If you use Truncate only option you will loose current transactions, how will you stop that from doing?

View Complete Post

More Related Resource Links

Workflow E-mails with Long Text Truncate the Text

The title is pretty self-explanatory.  I have a few fields that are generated from some Infopath Forms.  The text, however, truncates and doesn't display the entire text.

Anyone have any suggestions?

How can i truncate a published table?

I need to replicate our production tables to another server. Unfortunately there are 2 refresh jobs that runs at night that truncates the tables completely and refreshes it with fresh data. How can i setup transactional replication or any type of replication? Is there a way around this? thanks in Advance!

Restrict Truncate Table?

How to restrict 'truncate table' in a database from a user? Thanks !

reporing services ... truncate char

Hi! How Can I truncate the first 7 char of a field that I've inserted in a reporting services report? =First(Fields!NumeroFattura.Value, "Documento") I would like to truncate the first 7 char of Fields!NumeroFattura.Value Thanks  

Delete Vs Truncate


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?

Is TRUNCATE can be rollback in SQL Server 2005

Is TRUNCATE command can be rollback in SQL Server 2005

Difference between truncate and drop table on database fragmentation


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.




Couldn't Truncate the log because of replication is pending

I want to truncate the transaction log.I got the error "The log was not truncated because records at the beginning of the log are pending replication or Change Data Capture. Ensure the Log Reader Agent or capture job is running or use sp_repldone to mark transactions as distributed or captured." I'm replicating from this server to two subscribers.But temporally i have stop the replication agents.How can i truncate the log file ?Please give the technical explanation for this message and solution with explanation.

How to specify "truncate log" doing transaction log backup in Mgmt Studio


SQL Server 2008 Mgmt Studio doc, backup a transaction log, says clearly:

 1.       In the 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

DROP vs TRUNCATE which is faster?

I work with datafiles containing more than 1 million records. Which would be faster DROP TABLE or TRUNCATE TABLE?

Delete or Truncate statement for data purging



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.








Store Procedure truncate varchar field?


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.

SQL 2008 Maintenance plans missing Truncate transaction log checkbox



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? 

Thanks, Jules

configuring logging to truncate or rotate a logfile


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.


Truncate URL while Displaying data FROM SQL


Hi all,

          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

 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

hacker truncate table


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

Using Html.Truncate in Webgrid Column

I'm using the Html.Truncate function from the MvcMusicStore tutorial (page 5) and I want to use it in a Webgrid column to trim some text. However I can't get the syntax correct to get the Html.Truncate function to work with a string in my Webgrid. My (now experimental) Webgrid looks like this:
@{ var grid = new WebGrid(Model, canPage: true, canSort: true); @grid.GetHtml(columns: grid.Columns( 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>) )); }
 The code for column "Comment1" and "Comment3" is working but the code in "Comment2" is not working. The error message I get is
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
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend