开发者

how to check mssql existing table in php

开发者 https://www.devze.com 2023-01-27 00:07 出处:网络
Does anyone know how can I check whether the selected table in mssql is exist by php?开发者_C百科?The following SQL query should work:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消