Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problems inserting records in a SQL Table

Posted on 2008-10-20
4
Medium Priority
?
257 Views
Last Modified: 2012-05-05
I am using the following command to insert records in a table:
insert into grel01.falcon.dbo.job_ext(select * from tsdaft.falcon.dbo.job_ext where id > 140213)

I keep getting the following error:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'select'.
Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near ')'.

The query seems perfectly fine
0
Comment
Question by:wademi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 2000 total points
ID: 22761149
try this instead:

insert into grel01.falcon.dbo.job_ext
select * from tsdaft.falcon.dbo.job_ext where id > 140213
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 22761240
Couple of minor points..
(1)  Your database name is grel01.falcon, correct?
(2)  It's widely considered proper design to INSERT specifying all columns, and not with the all-columns asterisk (*).  
0
 

Author Closing Comment

by:wademi
ID: 31507960
You are the best. THANKS
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22761371
jimhorn, I completely agree.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question