Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Column Names spaces

Author  Topic 

Brittney10
Posting Yak Master

154 Posts

Posted - 2011-01-24 : 13:43:58
Is there a way to create a stored procedure paramater when you have column names that have spaces? Ex. @[column name].

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-24 : 14:14:01
Column names have no relation to the variable name. You can not use spaces in the variable name. Use square brackets around the column name though when you match up the variable name to the column name: WHERE [Column1 Something] = @var1.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -