Copyright © 2008-2019 Paula DiTallo

Tag Cloud

July 2008 Entries

Why does "use db" with a hyphen throw "Incorrect syntax near '-'" ?

I think this SQL Server x.x oddity goes back to the old Sybase 4 days! If you want to use a database name that's been dubbed something like 'paula-objects' and type out: use paula-objects then execute the request, you'll get the error message: Incorrect syntax near '-' just type this instead: use [paula-objects] when you execute the request, the syntax error will clear up ......

Does SQL Server have an "ALL_TAB_COLUMNS" feature?

Yes! For those Oracle X.Xers finding themselves working in the SQL Server 2005/2008 world these days, you'll be happy to know all you need to do is: 1. Open up a new execute query window. 2. Type the following: use FavoriteDbInstance SELECT table_name,column_name FROM information_schema.columns WHERE column_name LIKE '%whateverYouWant%' That's it!:-) Your table names with the column name you are searching for should show up ......