Use PHP to set column description in MSSQL

elmalekdans

New Member
I'm working on a web app that is using PHP and MSSQL. One of my requirements is to use the field descriptions in MSSQL in part of the web app.I know the Stored Proc. for adding descriptions in MSSQL is:\[code\]EXEC sp_addextendedproperty @name = N'Description', @value = 'http://stackoverflow.com/questions/3805930/Description goes here',@level0type = N'Schema', @level0name = 'schemaname',@level1type = N'Table', @level1name = 'tablename',@level2type = N'Column', @level2name = 'columname'GO\[/code\]I am having problems converting this into php, however.I'm trying to use the mssql_init/bind/execute commands, but I keep getting an error that I am not sure how to troubleshoot.PHP Code:\[code\]$query = mssql_init("sp_addextendedproperty",$dblink);mssql_bind($query,"@name","N'Description'",SQLVARCHAR);mssql_bind($query,"@value",$_POST['description'],SQLVARCHAR);mssql_bind($query,"@level0type","N'Schema'",SQLVARCHAR);mssql_bind($query,"@level0name","dbo",SQLVARCHAR);mssql_bind($query,"@level1type","N'Table'",SQLVARCHAR);mssql_bind($query,"@level1name",$_POST['tableselect'],SQLVARCHAR);mssql_bind($query,"@level2type","N'Column'",SQLVARCHAR);mssql_bind($query,"@level1name",$_POST['column_name'],SQLVARCHAR);mssql_execute($query)\[/code\]My error is: \[code\]An invalid parameter or option was specified for procedure 'sp_addextendedproperty'. (severity 16)\[/code\]I don't know enough about stored procedures to fully troubleshoot this. Can somebody help me out?
 
Back
Top