Extract date from getdate(): the easier version
select convert(varchar(10), getdate(), 101)
You’ll get mm/dd/yyyy
Learn more from http://msdn2.microsoft.com/en-us/library/ms187928.aspx
select convert(varchar(10), getdate(), 101)
You’ll get mm/dd/yyyy
Learn more from http://msdn2.microsoft.com/en-us/library/ms187928.aspx
Select a random row with mysql:
select column_name from table_name order by rand() limit 1
Select a random row with SQL Server
select top 1 column_name from table_name order by newid()
the getdate() function will return a datetime value, but sometime you only need the DATE, without the time.
here’s the function that extract the date:
SELECT convert(datetime, floor(convert(float, getdate())))
I installed php 5.2.3 onto c:\php, but the script won’t connect to SQL 2005 through mssql extension.
The solution:
1. get the latest ntwdblib.dll from a machine which installed sql server 2000
2. put the dll to c:\php
The dll shipped with php 5.2.3 is version 7.0, and the latest is 8.0, which make the difference when connecting to a SQL 2005.
Sometimes the transaction log is full. here’s the commands to clean it.
BACKUP LOG db_name WITH TRUNCATE_ONLY
Change “db_name” to your account userID.
To verify the percentage of SQL transaction log space being used, run the following command from the same location:
DBCC SQLPERF(LOGSPACE)
Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes