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

Knowledge is of two kinds. We know a subject ourselves, or we know where we can find information upon it.

— Samuel Johnson



Navigation





<July 2014>
SMTWTFS
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

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 - 7/23/2014

Totals
Posts - 2304
Comments - 2489
Hits - 1,648,809

Averages
Entries/day - 0.57
Comments/entry - 1.08
Hits/day - 407

Updated every 30 minutes. Last: 5:06 AM 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] |