About

I'm Mike Pope. I live in the Seattle area. I've been a technical writer and editor for over 30 years. I'm interested in software, language, music, movies, books, motorcycles, travel, and ... well, lots of stuff.

Read more ...

Blog Search


(Supports AND)

Google Ads

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

You can say a lot in four minutes, you know, if you get your metaphors straight.

Ry Cooder on songwriting



Navigation





<November 2014>
SMTWTFS
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

Categories

  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  

Contact

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 11/20/2014

Totals
Posts - 2315
Comments - 2504
Hits - 1,685,104

Averages
Entries/day - 0.56
Comments/entry - 1.08
Hits/day - 404

Updated every 30 minutes. Last: 8:28 PM Pacific


  08:52 AM

Here's a tip that came up on an internal alias today. When you create a database table in WebMatrix, you click the New Table button in the ribbon, define your fields, and then save. The save process gives you your one and only chance to name the table:


If you screw this up, tho, or if you change your mind about the name, you'll find yourself pressing F2 in vain to try to get it to let you rename the table.

However, you can use the sp_rename command to, you know, rename the table. In the Databases workspace, select the database and then in the riboon click New Query. This displays what's basically a free-form edit window. Click inside and enter a command like this:

sp_rename 'Customres', 'Customers'
(note the single quotation marks around the names) and then click Execute in the ribbon.


Assuming everything went well, you'll see a results window:


The larger lesson here is that you can execute arbitrary SQL commands in the New Query window. For info about what-all you can do in SQL Server Compact, have a look at the SQL Reference (SQL Server Compact) page on MSDN. Note that commands for SQL Server Compact have some limitations. For example, sp_rename only lets you rename tables, unlike its equivalent in "big" SQL Server.

[categories]   ,

[1] |