Hello All, i am trying to covert an existing stored procedure so that it works dynamically (i will be passing more parameters through once i&#039;ve resolved this problem). I am using SQL Server 7. The procedure is being called as follows:<BR><BR>Set oRs = oConn.Execute("web_select_delivery_addresses @CustomerID= &#039;"& Session("CustomerID") &"&#039;,@AddressName=&#039;&#039; ")<BR><BR>The session contains a GUID value. The stored procedure looks like this:<BR><BR>CREATE PROCEDURE web_select_delivery_addresses <BR><BR> @CustomerID uniqueidentifier ,<BR> @AddressName VARCHAR(50) = null<BR><BR> AS<BR><BR><BR>IF Len(@AddressName) = 0 <BR> BEGIN<BR> --SELECT * FROM DeliveryAddresses where CustomerID = @CustomerID<BR> EXEC(&#039;SELECT * FROM DeliveryAddresses where CustomerID = &#039; + @CustomerID )<BR> END<BR>ELSE<BR> BEGIN<BR> SELECT * FROM DeliveryAddresses where CustomerID = @CustomerID And AddressName = @AddressName<BR> END<BR><BR><BR>Now the problem is that i want to use the EXEC command as shown above so i can create a dynamic query but i am getting the following error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers (0x80004005)<BR>[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near &#039;Ú&#039;.<BR><BR>I tried to convert the @CustomerID value in to a string but am still getting an error, Can anyone see what i am doing wrong?<BR><BR>Thanks.<BR>