Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8692067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:14:46+00:00 2026-06-13T00:14:46+00:00

I am using excel concatenation to generate SQL insert statement but i find it

  • 0

I am using excel concatenation to generate SQL insert statement but i find it very hard to define the concatenation for the below SQL values…can anyone advise? on the concatenation formula to use?

VALUES ( 
NEWID(),'ABC', 'ABC', 'ABC', 'abc', 'abc', 'abc', NULL,  CONVERT(datetime, '1999/01/01',     101)
,  CONVERT(datetime, '1999/12/31', 101), 1, 0, 1, LOWER(NEWID())
, 'abc',  getdate(), 'system'
,  getdate());
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:14:47+00:00Added an answer on June 13, 2026 at 12:14 am
    ="INSERT SOMETABLE VALUES ( \
    NEWID(),'" & A2 & "', '" & B2 & "', 'ABC', 'abc', 'abc', 'abc', NULL, \
    CONVERT(datetime, '1999/01/01',     101) \
    ,  CONVERT(datetime, '1999/12/31', 101), 1, 0, 1, LOWER(NEWID()) \
    , 'abc',  getdate(), 'system' \
    ,  getdate());"
    

    Note: When you see \ in the above it means the line joins to the next line. The entire formula should be on a single line.

    I have replaced the first two fixed values of “ABC” with A2 and B2 being cells from the sheet, e.g. you may have this formula in X2, which you would copy down. If your cell values themselves can contain single quotes, it becomes more complicated and you’ll need to add SUBSTITUTE to double them up. e.g.

    ="INSERT SOMETABLE VALUES ( \
    NEWID(),'" & SUBSTITUTE(A2,"'","''") & "', '" & B2 & "', 'ABC', 'abc', 'abc', 'abc', NULL, \
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using Excel Interop libraries from .NET, I can find a Range object representing
I am using Excel to generate a whole slew of INSERT statements, similar to
i'm curently using Excel 2003 to generate reports, but i'm thinking of migrating to
Using Excel 2010 and SQL Server 2008 R2. I used import and export data
I'm using Excel 2010 to read some SQL data using an ODBC data connection.
I've written several very helpful excel add-ins using VBA. I'm using Excel for Mac
Using Excel 2007 VBA Have a sheet Dashboard, have other sheets but some special
I am using excel sql queries to fetch data from the backend according to
First: I'm using Excel 2007, but the code has to work for Excel 2003
I'm using (Excel.Application)Marshal.GetActiveObject(Excel.Application) It returns me a _ComObject type but I was wondering how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.