Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > [ ] (Wildcard - Character(s) to Match) ?

Reply
Thread Tools

[ ] (Wildcard - Character(s) to Match) ?

 
 
Bruce Lawson
Guest
Posts: n/a
 
      04-19-2006
Hi, I am confused about Microsofts description of this Transact SQL
reference; [] (Wildcard - Character(s) to Match. The description says
"Matches any single character within the specified range or set that is
specified inside the square brackets". For example, in the TransactSQL
statement "UPDATE tblUsers SET [Password] = stringUserPassword WHERE UserId
= 2" , what do the brackets signify about the database record in column
Password being updated? TYIA
BruceL



 
Reply With Quote
 
 
 
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      04-19-2006
The [] have two meanings. The one you described is only applicable inside a
string with the LIKE operator...ala:

select blah from blahTable where description like '[ab]oat'

which doesn't really make sense, but you get the idea..

outside of this case, [] is used to escape reserved keyword names. Password
is actually a reserved word in TSQL, so the only way you can safely use it
as a column/table/sproc name it to wrap it in []. You can often omit the []
for reserved words, and TSQL will figure out what you mean, but I'd advise
against it.

If you type a query and a column name/table turns blue (or whatever color
your SQL syntax turns, like the word SELECT or FROM) than you should put it
in []

Karl

--
http://www.openmymind.net/



"Bruce Lawson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi, I am confused about Microsofts description of this Transact SQL
> reference; [] (Wildcard - Character(s) to Match. The description says
> "Matches any single character within the specified range or set that is
> specified inside the square brackets". For example, in the TransactSQL
> statement "UPDATE tblUsers SET [Password] = stringUserPassword WHERE
> UserId = 2" , what do the brackets signify about the database record in
> column Password being updated? TYIA
> BruceL
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments