Swedish Standard Industrial Classification (SNI koder)

This short blog post is mostly targeted to my Swedish visitors. I have created a downloadable database backup that contains all SNI codes with both Swedish and English descriptions.

The database has four tables, corresponding to the 2-5 digit codes (levels of detail):

SNI koder
SNI koder

I also created a stored procedure that generate a XML document of the SNI code hierarchy like the sample below. The name of the stored procedure is GenerateXMLSNI and it is included in the backup.

<SNI2007>
  <Huvudgrupp>
    <Huvudgrupp>01</Huvudgrupp>
    <Benamning>Jordbruk och jakt samt service i anslutning härtill</Benamning>
    <Description>Crop and animal production, hunting and related service activities</Description>
    <Grupp>
      <Grupp>011</Grupp>
      <Benamning>Odling av ett- och tvååriga växter</Benamning>
      <Description>Growing of non-perennial crops</Description>
      <Undergrupp>
        <Undergrupp>0111</Undergrupp>
        <Benamning>Odling av spannmål (utom ris), baljväxter och oljeväxter</Benamning>
        <Description>Growing of cereals (except rice), leguminous crops and oil seeds</Description>
        <Detailjgrupp>
          <Detailjgrupp>01110</Detailjgrupp>
          <Benamning>Odling av spannmål (utom ris), baljväxter och oljeväxter</Benamning>
          <Description>Growing of cereals (except rice), leguminous crops and oil seeds</Description>
        </Detailjgrupp>
      </Undergrupp>
      <Undergrupp>
        <Undergrupp>0112</Undergrupp>
        <Benamning>Odling av ris</Benamning>
        <Description>Growing of rice</Description>
        <Detailjgrupp>
          <Detailjgrupp>01120</Detailjgrupp>
          <Benamning>Odling av ris</Benamning>
          <Description>Growing of rice</Description>
        </Detailjgrupp>
      </Undergrupp>

Download the backup here.

To restore the backup run the following T-SQL, but replace all three file locations to something that works on your server:

USE [master]
RESTORE DATABASE [SNIdb] FROM  DISK = N'C:\MSSQL\Backup\SNI.bak' WITH  FILE = 1,  MOVE N'SNI' TO N'C:\SQLFiles\Data\SNI.mdf',  MOVE N'SNI_log' TO N'C:\SQLFiles\Data\SNI_log.ldf',  NOUNLOAD,  REPLACE,  STATS = 5
GO

Tomas Lind

Tomas Lind - Consulting services as SQL Server DBA and Database Developer at High Coast Database Solutions AB.

Leave a Reply