Add a new type of grating using SQL Server Management Studio

Learn how to use the SQL Server to add a new type of grating in the database.

Important: Before executing any queries on an Advance Steel database, make sure you create backup copies of the databases that will be modified, by adding them in a backup folder in a desired location on the disk.

To add a new type of grating:

  1. In the Object Explorer, attach the AstorGratings.mdf database.
  2. In the Object Explorer, right-click on the AstorGratings database and select New Query from the contextual menu.
  3. This will open a new tab window on the right side.
  4. In the new window, type the query lines that will:
    1. Copy the structure and content from an existing table to start from.
    2. Create a new table with a custom name.
    3. Change the RunName values to avoid duplicates.
    4. Add a line in the GratingStandardMaster table for the new grating.

      The following is an example of such a query:

      USE [C:\PROGRAMDATA\AUTODESK\ADVANCE STEEL 2018\USA\STEEL\DATA\ASTORGRATINGS.MDF]
      GO
      
      -- Create table structure
      CREATE TABLE [dbo].[CUSTOM_GRATING](
      	[Name] [nvarchar](255) NOT NULL,
      	[RunName] [nvarchar](64) NULL,
      	[Length] [float] NULL,
      	[Width] [float] NULL,
      	[Thickness] [float] NULL,
      	[Hatch] [nvarchar](255) NULL,
      	[ConnectorName] [nvarchar](64) NULL,
      	[ConnectorQuantity] [int] NULL,
      	[Material] [nvarchar](255) NULL,
      	[Coating] [nvarchar](255) NULL,
      	[Weight] [float] NULL,
      	[OwnerText] [nvarchar](15) NULL,
       CONSTRAINT [PK_CUSTOM_GRATING] PRIMARY KEY CLUSTERED ([Name]))
       GO
      
       -- Copy all data from an existing table
       INSERT INTO [dbo].[CUSTOM_GRATING]
       SELECT * FROM [dbo].[Amico_Standard_ExpandedMetal_AlFlat]
       GO
      
       -- Bulk replace RunName values from the original table
       UPDATE [dbo].[CUSTOM_GRATING]
       SET [RunName] = REPLACE([RunName], 'Amico Expanded Al', 'Custom grating')
       WHERE [RunName] LIKE 'Amico Expanded Al%'
       GO
      
       -- Add CUSTOM_GRATING to GratingStandardMaster
       INSERT INTO [dbo].[GratingStandardMaster]
       VALUES ('CUSTOM_GRATING',
      		 'Custom grating',
      		 'CUSTOM_GRATING',
      		 'Name',
      		 'DSC')
       GO
      
  5. After you add the query content in the query window, execute the query using the Execute command in the application toolbar.
  6. After the process is finished a confirmation message will be displayed at the bottom of the query window.
  7. The new custom grating is ready to use in Advance Steel.
Important: Besides copying and renaming existing grating types, you also need to apply other changes to the gratings. For this type of operations, several other query examples are provided in separate how-to documents.