Skip to main content

Posts

Showing posts with the label ArcSDE

Making Code Samples Readable Online

After lazily just pasting code in <pre> blocks for years, this morning I finally got around to researching a code highlighter like you see on almost all the programming websites. Thanks to SyntaxHighlighter adding this feature was embarrassingly easy. It is self-contained javascript that works on a pre or script tag decorated with a html class calling a brush alias, e.g. <pre class="brush: sql"> INSERT INTO MyWebsite (pre, script) VALUES (complete, awesomeness) </pre> Oh, but it's not just SQL, no there's a whole easel of brushes included: Brush name Brush aliases File name ActionScript3 as3, actionscript3 shBrushAS3.js Bash/shell bash, shell shBrushBash.js C# c-sharp, csharp shBrushCSharp.js C++ cpp, c shBrushCpp.js CSS css shBrushCss.js Delphi delphi, pas, pascal shBrushDelphi.js Diff diff, patch shBrushDiff.js Groovy groovy shBrushGroovy.js JavaScript ...

Repairing Broken Data Sources

What do you do when you open your map and you have a layer that looks like this? What does it mean? The red exclamation point is a visual indicator that something is incorrect in the layer's data source.  To fix it you'll need to know where the data lives and tell the layer in the map this information.  You're giving direction to poor lost layer so it can find itself, you're a metaphysical geographer!  Repairing a data source: Right-click on the layer, from the contextual menu choose Properties In the Properties dialog box choose the Source tab Click Set Data Source Browse to the location of the data layer, select and click Add OK out of the Properties dialog If all went well your data is now displayed. But what if it isn't one layer?  What if you have an entire map of mis-pathed layers? Here's where ArcCatalog comes to the rescue: Locate the map in ArcCatalog Right-click and select Set Data Source(s)   Highlight one of the Data Layers ...

An Inquiry into IN Query

I had to select a ton of records today for a project in ArcGIS. You know the normal method, hellish SQL repetition: ID = 1 OR ID = 5 OR ID = 6 OR ID = 12 OR ID = 14 OR ID = 27 OR ID = 41 OR ID = 43 The past few months I've been working a lot in SQL Server and this experience made this repetition seem like too much work. So I got lazy and I made an inquiry into IN query: ID IN (1,5,6,12,14,27,41,43) And it just worked. There's no documentation in the main help file that even mentions it. If you do open the ArcGIS Help and search on "SQL Reference" nearly half way down you find a section on Subqueries. Here they explain that IN queries are supported in geodatabases and EXISTS is supported as well! Who knew? How was I supposed to know this if I hadn't gotten lazy? Here's what you'll find in the ArcGIS Help File: Subqueries NOTE: Coverages, shapefiles, and other non-geodatabase file-based data sources do not support subqueries. Subqueries done on a v...

Saving changes not permited in SQL 2008

There's a nasty little checkbox selected by default in SQL Server Management Studio 2008 that prevents table changes from being committed. It's not permissions, it is an installation and user specific checkbox hidden under tools > options > designers. Uncheck "Prevent saving changes that require table re-creation". Source and more info: http://pragmaticworks.com/community/blogs/brianknight/archive/2008/06/04/sql-server-2008-designer-behavior-change-saving-changes-not-permitted.aspx

Restoring Orphaned SQL Server 2008 Users

We keep moving databases across servers and reinstalling SQL Server at my office. Almost everything transitions perfectly except SQL Server Users. Unless the user already exists in the Master Security table, the database user is left orphaned inside the database without the ability to perform any useful function. Like you right now, but we're gonna change that. Here is an example, note how there is a User Name but no Login Name. User Name but no Login Name Step 1: Recreate the User in Master First, if they don't already exist, is to recreate the user in the master database by browsing to the root level Security folder in SQL Server Management Studio, choose Logins and right-click create user. You tried to check the database database under the "User Mapping" page didn't you? Create failed for User 'UserName'. That was a good idea hotshot, but it ain't gonna work for you. Just create the user and Ok your way out of there. Time for Step 2. Step 2: ...