I regularly need to delete all the data from my PostgreSQL database before a rebuild. How would I do this directly in SQL? At the moment I’ve managed to...
Is there any good way of truncating text with plain HTML and CSS, so that dynamic content can fit in a fixed-width-and-height layout? I’ve been truncating server-side by logical...
I need to empty an LDF file before sending to a colleague. How do I force SQL Server to truncate the log? 7 Answers 7
For example, I might want to: tail -f logfile | grep org.springframework | <command to remove first N characters> I was thinking that tr might have the ability to...
What’s the best way to truncate a datetime value (as to remove hours minutes and seconds) in SQL Server 2008? For example: declare @SomeDate datetime="2009-05-28 16:30:22" select trunc_date(@SomeDate) -----------------------...
What’s the difference between TRUNCATE and DELETE in SQL? If your answer is platform specific, please indicate that. 32 Answers 32 Here’s a list of differences. I’ve highlighted Oracle-specific...
I have a file, foo.txt, containing the following lines: a b c I want a simple command that results in the contents of foo.txt being: a b 15 Answers...
I would like to truncate a string such that its length is not longer than a given value. I am writing to a database table and want to ensure...
Using MSSQL2005, can I truncate a table with a foreign key constraint if I first truncate the child table (the table with the primary key of the FK relationship)?...
Why doesn’t a TRUNCATE on mygroup work? Even though I have ON DELETE CASCADE SET I get: ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key...