Posts

Showing posts from November, 2011

MSSQL - how to change "SA" password

1. Open the "SQL Server Enterprise Manager". This is usually under "Start"-->"Programs"-->"Microsoft SQL Server". 2. Navigate to the "Logins" object under the "Security" folder on the SQL Server you wish to administer. Then, right click on the 'sa' account and select "Properties". 3. Now, enter a new password in the "Password" field under the "Authentication" options. website reference: http://www.eukhost.com/forums/f31/how-change-mssql-sa-password-511

MSSQL - select a random row

Microsoft SQL Server provide function "NEWID()" to random record from database. Let's see example. SELECT TOP 1 column FROM table ORDER BY NEWID() Example: SELECT TOP 1 code_item FROM game_item WHERE available=1 ORDER BY NEWID()

MSSQL - how to select all table name

In Oracle, you can use statement "select * from tab" for get all table name in your database. But for MSSQL you have to use "select * from sys.Tables" instead of "tab". Example. USE nothwinds SELECT * FROM SYS.TABLES