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

  • Home
  • SEARCH
  • 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 5946069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:46:13+00:00 2026-05-22T16:46:13+00:00

Hi when i execute the following TSQL, i get the error message below. But

  • 0

Hi when i execute the following TSQL, i get the error message below. But there is nothing wrong with the SQL syntax is there?

create table #tb ([t1] tinyint, [t2] varchar(50))
insert into #tb values
    (1, 'a'), 
    (2, 'b')

Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ‘,’.

There is nothing else in the SQL query window. Running SQL Server 2005.

  • 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-05-22T16:46:13+00:00Added an answer on May 22, 2026 at 4:46 pm

    As jmoreno mentions, theVALUES (), () syntax is SQL Server 2008+ supported but you tagged this as SQL Server 2005.

    Use:

    CREATE TABLE #tb ([t1] tinyint, [t2] varchar(50))
    
    INSERT INTO #tb 
    SELECT 1, 'a'
    UNION ALL
    SELECT 2, 'b'
    

    It’s also possible to do this in a single query, using the SELECT ... INTO clause, but the temp table can’t already exist:

    SELECT *
      INTO #tb
      FROM (SELECT CAST(1 AS TINYINT) AS t1, 
                   CAST('a' AS VARCHAR(50)) AS t2
            UNION ALL
            SELECT 2, 'b') x
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following error when I try to execute a particular recursive CTE:
Consider the following psuedo T-SQL code (performed by a stored procedure): CREATE TABLE #localTable
When I execute the following query, I get an exception telling me that 'feedItemQuery'
When I execute the following query on a database containing a table comm_list and
I'm trying to execute the following line: exit | sqlplus username/password@sid @test.sql Works great
I am using SQL Server 2008 management studio to execute the following SQL statements,
I execute following code on windows xp and python 2.6.4 But it show IOError.
Why jQuery does not raise any error event when I execute following script? thought
In T-SQL you can do following SELECT SUBSTRING(COLUMN1, 1, 3), * FROM TABLE1 But
I want to execute following code on button click but the follwing code executes

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.