Truncate data from all tables in a database
This script will truncate data from all tables in a database
2005-06-06 (first published: 2005-05-13)
493 reads
This script will truncate data from all tables in a database
2005-06-06 (first published: 2005-05-13)
493 reads
This script is userful in CaseSensitive environment. This will detect a values from a table column which are lower case.
2005-05-26 (first published: 2005-05-09)
85 reads
Here's an alternative to Clinton Herring's ufn_vbintohexstr which should be much faster with large varbinary values. First, in his original version, the inner-loop CASE statements can be replaced with this: select @value = @value + CHAR(@vbin/16+48+(@vbin+96)/256*7) +CHAR(@vbin&15+48+((@vbin&15)+6)/16*7) How does it work? By adding 6 to a hex-digit in (@vbin&15), you have a value from 16 […]
2006-12-20 (first published: 2005-05-07)
123 reads
Challenged by Hans Lindgren's stored procedures of the same name, I created this. Note that it produces strange results on non-hexadecimal strings, overflows at 0x80000000, and could have issues with byte-ordering on some architectures.How does it work? Well, the distance between one after '9' (':') and 'A' is 7 in ASCII. Also, if I subtract […]
2006-12-15 (first published: 2005-05-04)
209 reads
Hans asked if it could be faster. This is about 10% faster; not much. His is admittedly more readable, and mine will act very strangely with invalid hex digits.How does it work? I'm converting the string '1234' to the value 0x31323334 (for example), then subtracting '0000' so that it is 0-based in each byte (CONVERT(INT,0x30303030) […]
2005-05-16 (first published: 2005-05-04)
142 reads
Based on the script by Paul Delmarche ( http://www.sqlservercentral.com/scripts/contributions/1482.asp ).Updated to now include the spid, username, blocked and blocking SQL statements in the email (still logged to table).Schedule the procedure to run at defined intervals (I use 2 minutes)
2005-05-12 (first published: 2005-05-02)
1,430 reads
This script gathers stats_date and index information for all of the current database. Please feel free to modify it as it is made up of components that are available on this site here- http://www.sqlservercentral.com/scripts/contributions/97.aspand a BOL entry for stats_date.I needed this information and thought I would share it.
2006-07-17 (first published: 2005-04-29)
555 reads
This script uses the same information sp_spaceused does. It just formats it in a different way.
2005-05-10 (first published: 2005-04-26)
197 reads
Many of us have SQL Servers at work that we learn on, test with work, etc. But getting your own SQL Server for a website can be a tricky thing. Especially on a budget. Or maybe your company wants to have their website hosted. Before you spend any hard earned money, read part 2 of this two part series by Jon Reade on what to look for when setting up a SQL Server hosting company.
2005-04-20
5,377 reads
GETWORDCOUNT, GETWORDNUM, AT, RAT, OCCURS,CHRTRAN, STRFILTER, PADC, PADR, PADL, PROPER, RCHARINDEX etc. AT, PADL, PADR, CHRTRAN, PROPER are similar to functions Oracle PL/SQL INSTR, LPAD, RPAD, TRANSLATE, INITCAP. In my humble opinion, it will be convinient to apply such functions for writing of stored procedures and User-Defined Functions on Transact-SQL. Please, download the file http://www.universalthread.com/wconnect/wc.dll?LevelExtreme~2,2,27115
2006-01-10 (first published: 2005-04-19)
1,554 reads
One thing I’ve always loved about the Scooby-Doo cartoon is that he never solved...
By Kevin3NF
Flexibility and Scale at the Database Level When SQL Server 2012 introduced Availability Groups...
Setting page visibility and the active page are often overlooked last steps when publishing...
Comments posted to this topic are about the item Password Guidance
Comments posted to this topic are about the item Using table variables in T-SQL
I am trying to check out elastic query between two test instances we have...
What happens if you run the following code in SQL Server 2022+?
declare @t1 table (id int); insert into @t1 (id) values (NULL), (1), (2), (3); select count(*) from @t1 where @t1.id is distinct from NULL;See possible answers