mike's web log

 

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

Anyone who does research knows you have to to stay focussed on your topic and not go down every interesting avenue you pass, or you will end up wandering aimlessly in attention-deficit limbo.

— Ian Frazier



 

Navigation






<April 2014>
SMTWTFS
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910


 

25 Most-Visited Entries

 

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
 

Blogs I Read

 

Contact

Email me
 

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 4/3/2014

Totals
Posts - 2298
Comments - 2480
Hits - 1,620,247

Averages
Entries/day - 0.58
Comments/entry - 1.08
Hits/day - 410

Update every 30 minutes. Last: 10:29 PM Pacific

 

posted at 08:52 AM | | [1] |

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] ,