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

If there is a bedrock principle of the First Amendment, it is that the government may not prohibit the expression of an idea simply because society finds the idea itself offensive or disagreeable.

Justice William J. Brennan, Texas vs. Johnson, 1989



Navigation





<December 2014>
SMTWTFS
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

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

Totals
Posts - 2316
Comments - 2506
Hits - 1,692,826

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

Updated every 30 minutes. Last: 6:08 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] |