Hi there,<BR><BR>I am trying to use the below code but it keeps giveing me errors saying i can&#039t pass it a variable for the ORDER BY. Is there any way around this??<BR><BR>--------------------- CODE BEGIN -------------------<BR><BR>CREATE PROCEDURE sp_main<BR> @cat varchar(100),<BR> @strOrder varchar(100),<BR> @sortin varchar(100 <BR>AS<BR>Select cat1,cat2,cat3, From image<BR>Where cat1= @cat ORDER BY @strOrder<BR>Go<BR><BR>--------------------- CODE BEGIN -------------------<BR><BR>Also how do you do dynamic sort like:<BR><BR>Where cat1= @cat ORDER BY @strOrder @sortin, as this also gives erros.<BR><BR>Thanks in advance for any help<BR>:Scott<BR><BR>