Does anyone know how can I check whether the selected table in mssql is exist by php?开发者_C百科?
The following SQL query should work:
SELECT COUNT(table_name) FROM information_schema.tables WHERE table_name = 'SomeTableName'"
Should return a count of 0 if it doesn't exist or 1 if it does.
Use with msql_query
or sqlsrv_query
as appropriate.
精彩评论