Tutorials
Help
 Introduction
 Schema Browser
 Intro to SQL
 How To
    - Search
    - Graph
 Web Browsers

Copying Object IDs into Excel

Excel has a known problem with SkyServer data: SDSS Object IDs are too long. The Object IDs are 18 digits long, and Excel can display a maximum of only 15 digits. For example, look at this list of IDs from the Advanced Color project:

If you copy this list and paste it directly into Excel, the list will look like this:

The last three digits of every Object ID show up as zeroes. This is especially bad because if you try to search for these objects by ID in the Object Explorer, you won't be able to find them! The 15-digit limit is set by the CPU processor, so no settings in Excel could fix the problem.

The solution is to have Excel read the Object ID as a text string rather than a number. To tell Excel to read the ID as a string, enter single quotes (') at the beginning and end of the ID. Copy your list of Object IDs into a text editor (like Notepad) and enter the quotes by hand. Or, save your list as CSV and open it with Notepad (a .csv file is just text with commas, so you can edit it with a text editor - just make sure you save it as .csv!).

After you enter the single quotes at the beginning and end of the Object IDs, paste your list into Excel, or have Excel open the .csv file. You should get a screen like this:

If you enter these Object IDs (with single quotes) into the Object Explorer's "Search by ObjID" feature, you'll get the correct object.