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 8534003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:05:42+00:00 2026-06-11T10:05:42+00:00

Does FitNesse/dbFit support inserting into a table with a single identity column and then

  • 0

Does FitNesse/dbFit support inserting into a table with a single identity column and then returning that value into a variable?

For example:

create table TestTable ( ID int identity(1,1) )

!|Insert|TestTable|
|ID?              |
|>>TestID         |

results in the following exception:

System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ')'.

Is there another way to accomplish this?

  • 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-11T10:05:43+00:00Added an answer on June 11, 2026 at 10:05 am

    Your problem is not with Fitnesse, but with the SQL engine. If you try the same query in SQL Server Management Studio you will receive the same error. Thus, given the restriction that you cannot use set identity_insert on the question you really need to ask is how to insert a record with no insertable fields in SQL Server independent of Fitnesse? This StackOverflow post provides a simple answer:

    INSERT INTO #TempTable DEFAULT VALUES
    

    Having that in hand, now the task is to map this to Fitnesse. Here is one solution:

    !|execute|CREATE TABLE #TestTable ( ID int identity(1,1) )|
    
    !|execute|INSERT INTO #TestTable DEFAULT VALUES|
    
    !|query|SELECT TOP 1 @@IDENTITY [ID] FROM #TestTable|
    |ID?                                                |
    |>>TestID                                           |
    

    Fitnesse’s INSERT command does not support the default construct, so you must switch to the more general EXECUTE command to do the insert. That, however, does not return results so you cannot glean the auto-inserted ID value directly. The final query gives you one way to grab the just-inserted identity value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of a free tool, similar to what is built into Visual
Does anyone know how I can implement a single Touch Event. A simple, one
Does anyone know of a Mootools script that provides nested sortable but also works
Does jQuery 1.5.1 support attribute selectors in the closest method? Given the structure below,
How to execute Sql Server Scripts(queries) in Fitnesse I know that there is a
Does anybody know of a good solution that can be used from php that
I have run into a very weird issue. I have several working Fitnesse tests
Change the environment variable `PATH' in Makefile does NOT take effect with make in
Does the Flex compiler pass a version number that's accessible to conditional compilation? The
My Fitnesse test does some underlying stuff and populates a Map with the results.

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.