my code stock.com

Luis  Hernandez

Excel columns to generate queries to import metadata from e-library
by Luis Hernandez

Excel columns to generate queries to import metadata from e-library

Snippet options

Download: Download snippet as excel-columns-to-generate-queries-to-import-metadata-from-e-library.sql.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

="INSERT INTO atbl_HSE_DocumentsLibrary (DocumentName, StatusID, CreatedBy, ApproverLogin, Created, ApproveOn, NextDue, Comments, CategoryID, SubcategoryID)
values(
'" & B1 & "',
'102492',
(SELECT TOP 1 Email FROM AVIW_HSE_PEOPLE
WHERE LOWER(FirstName +' '+ LastName) = LOWER('" & C1 & "') ),
(SELECT TOP 1 Email FROM AVIW_HSE_PEOPLE
WHERE LOWER(FirstName +' '+ LastName) = LOWER('" & C1 & "') ),
CAST('" & TEXT(D1, "MM/DD/YY") & "' AS DATETIME),
CAST('" & TEXT(D1, "MM/DD/YY") & "' AS DATETIME),
CAST('" & TEXT(E1, "MM/DD/YY") & "' AS DATETIME),
'" & F1 & "',
'102481',
NULL
);"

/****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP 1000 [PrimKey]
      ,[DocumentCategoryID]
      ,[Name]
  FROM [PimsR4_app].[dbo].[atbl_HSE_LU_DocumentCategory]
  SELECT TOP 1000 [PrimKey]
      ,[DocumentCategoryID]
	  ,[DocumentSubCategoryID]
      ,[Name]
  FROM [PimsR4_app].[dbo].[atbl_HSE_LU_DocumentSubCategory]

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.