LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Blogs > NullTerminator
User Name
Password

Notices


Old

MSSQL Tricks & Hints

Posted 10-04-2012 at 02:51 PM by NullTerminator
Updated 11-16-2012 at 01:40 PM by NullTerminator

Patching up leading zeroes
UPDATE TheTable
set FILE_NBR = replicate('0', 6-len(FILE_NBR) ) + FILE_NBR

Querying disk file sizes

use master

SELECT DB_NAME(DATABASE_ID) AS [DATABASE_NAME], name as FileName, Type_desc,
-- hmmmm 8k blocks?
CAST(( CAST(SIZE * 8 AS FLOAT) ) / 1024 AS VARCHAR) + ' MB' AS [SIZE],
CAST( (MAX_SIZE / 128) AS VARCHAR) + ' MB' AS [MAX_SIZE]
FROM SYS.MASTER_FILES

...
LQ Newbie
Posted in Uncategorized
Views 368 Comments 0 NullTerminator is offline

  



All times are GMT -5. The time now is 11:21 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration