sql2005如何插入帶引號的字符串

錯誤寫法:

update lib_app
set app_server='admin',
app_db ='erp',
app_dbparm='Namespace='System.Data.SqlClient',DataSource='admin',Database='ERP',CommitOnDisconnect='No',DisableBind=0, PBCatalogOwner='dbo',DefaultProcOwner='dbo', TimeOut=10,CommandTimeOut=2400'
from lib_app where app_id='ERPO'

正確寫法:要用'號要用''來表示

update lib_app
set app_server='admin',
app_db ='erp',
app_dbparm='Namespace=''System.Data.SqlClient'',DataSource=''admin'',Database=''ERP'',CommitOnDisconnect=''No'',DisableBind=0, PBCatalogOwner=''dbo'',DefaultProcOwner=''dbo'', TimeOut=10,CommandTimeOut=2400'
from lib_app where app_id='ERPO'

你可能感兴趣的:(sql2005)