Tuesday, January 14, 2014

SQL Server 2005 related

(SQL2014) See who currently use database : execute sp_who2

How to determine the version, edition, and update level of SQL Server and its components

Reset password 'sa' :
Use Master
Go
ALTER LOGIN [sa] WITH PASSWORD=N'StrongPassword'
Go

View disk usage using command (handy if report is too long)
Different ways to determine free space for SQL Server databases and database files
[Select database in question then run this query:]
SELECT DB_NAME() AS DbName, 
name AS FileName, 
size/128.0 AS CurrentSizeMB, 
size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS INT)/128.0 AS FreeSpaceMB 
FROM sys.database_files; 

A Seven-Step Process for Changing a Database's Collation - Follow this simple methodology to prevent problems

[General] Can we use timestamp column to display records in the order of insertion/creation time?
Short answer: WE CAN'T
Order by SQL timestamp
..TIMESTAMP datatype has nothing to do with a date and/or a time. But it is a sequentially increasing ..number (a ROWVERSION - that's it's new and more appropriate name), so ordering by it will order by ..the sequence of changes to the rows
Sort records by time inserted
[2000] Can SQL Server tell me which row was inserted most recently?
..Unlike Access and other file-based database platforms, a table in SQL Server is essentially an unordered ..heap. You can not assume that the last row inserted will be at the "end" of the table, mainly because tables ..in SQL Server don't have an "end." You need to tell SQL Server what you mean by "last" (using TOP with ..an ORDER BY, or aggregate functions like MAX)
Related:
In SQL server how do I order table rows by insertion order if primary key is GUID?

Memory Supported by the Editions of SQL Server 2005
[Some] edition of SQL Server 2005 [, STANDARD for instance,] will support the maximum memory supported by the operating system

No comments:

Post a Comment