472,805 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

VS2015+SSDT SQL Unit Tests 'INSERT INTO' syntax

I'm having trouble using some of the newer/odder INSERT/SELECT INTO syntax's
They run just fine from a .SQL dialog from VS2015, but not within a SQL unit-test.
In all cases I am populating a temp table and using MSSQL 2015.

This standard syntax works just fine in both a SQL unit-test and as a SQL script in DevStudio;
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO #Expect ([Name], [System_Type_Name]) VALUES ('Mail_Option', 'Varchar(20)'
However, these will not work in a unit-test but if you copy-n-paste into a script they work fine;
Expand|Select|Wrap|Line Numbers
  1. SELECT * INTO #Actual FROM OPENROWSET('sqlncli', 'server=xxx;Trusted_Connection=yes;','EXEC xxx')
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO #Actual EXEC dbo.Xxx
The error is;
Expand|Select|Wrap|Line Numbers
  1. System.Data.SqlClient.SqlException: Incorrect syntax near the word 'INTO'.
Your help is appreciated.
Jul 23 '20 #1
0 3456

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Andre | last post by:
Hello Can anyone help me translate this from access so that it can work in mssql (i need to get next value, but cannot use identity as if row is deleted, another must get new next column number...
by: brianbasquille | last post by:
Hello all, Strange little problem here... am just trying to insert some basic information into an Access Database using OleDB. I'm getting a "Syntax error in Insert Into statement" when it...
by: jking482 | last post by:
I am using Access 2000. I am using INSERT INTO syntax that works most of the time, but sometimes it doesn't insert the record. The data base has been heavily used for five or more years now. ...
by: kisalabs | last post by:
I have been trying to insert a new record into an access database and cannot get any of the scripts to work.. I can access the db and pull up/display records but cannot get one added. Please help. ...
by: vacuit | last post by:
Can you see where I am going wrong? 'SAVE THE RESULTS TO THE DATABASE Dim c_strAccessMDBFile As String = CStr(IBM.txtdblocation.Text) & "CrustaceanIBM.mdb" Dim...
by: dbertanjoli | last post by:
I have problems writing data from my webform to two linked tables. I am quiet sure that my insert into syntax is not correct. Please take a look if you have a moment, if not I understand: <% ...
by: Ed Pisa | last post by:
Hello, I have been working with this problem now for several days. I can delete and Update my data but I can not get it to insert a new record. I receive the syntax error insert into. I am not...
by: Grant Andrews | last post by:
I an adding data into an access table via c# and have run into a roadblock. The syntax is addSQL = "INSERT INTO history (, , , , , ) VALUES ('" + thisid + "','" + chat.DialogPartner + "','" +...
by: Joe Y | last post by:
I created a button, when clicked, supposed to create a new record on a different form which is bound to table ‘TProduct’. Values from these text boxes are to be inserted in to new record in...
by: JCK101 | last post by:
None of these codes are appending/inserting a new record when I run them, and yet I don't get an error, all it does is increase the autonumber in the table but no record is created. 'Original ...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
by: lllomh | last post by:
How does React native implement an English player?
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.