Solved

SQL Server Express create table

Posted on 2014-03-25
3
310 Views
Last Modified: 2014-03-25
Hello Expert,

Needed a database to do some joins on lists of servers.
Downloaded MS SQL Server Express 2012.

Got my join statement to work.

Thought I could just put 'Create table' in front of it to turn the
query into a table but I get

Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'select'.

So I pulled out the word 'select'
and I get

Msg 102, Level 15, State 1, Line 4
Incorrect syntax near 'Change_short$'.

I could have sworn I have done this before.
but it looks like they have changed the syntax.
Like whats up with all the dollar signs?
And how do i create tables and views?

Thanks.

Allen in Dallas
 



+++++++++++++++++++join statement begin+++++++++++++++++++++
select

     Change_short$.Name, Change_short$.[IP Address], ['Srvrs Rtrs Swtches$'].Name AS Expr1, ['Srvrs Rtrs Swtches$'].IP_Address,
                         ['Srvrs Rtrs Swtches$'].Device_type
FROM            Change_short$ right JOIN
                         ['Srvrs Rtrs Swtches$'] ON Change_short$.[IP Address] = ['Srvrs Rtrs Swtches$'].IP_Address

+++++++++++++++++++join statement end+++++++++++++++++++++
0
Comment
Question by:9apit
[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
3 Comments
 
LVL 3

Expert Comment

by:englanddg
ID: 39954163
Create Table <table name> as (<select statement>) should work...
0
 
LVL 11

Accepted Solution

by:
John_Vidmar earned 500 total points
ID: 39954352
Before the from-clause, use an into-clause:
select ...
into <table name>
from ...
where ...
...

Open in new window

0
 

Author Closing Comment

by:9apit
ID: 39954484
this worked
select
     Change_short$.Name, Change_short$.[IP Address], ['Srvrs Rtrs Swtches$'].Name AS Expr1, ['Srvrs Rtrs Swtches$'].IP_Address,
                         ['Srvrs Rtrs Swtches$'].Device_type
into server2
FROM            Change_short$ right JOIN
                         ['Srvrs Rtrs Swtches$'] ON Change_short$.[IP Address] = ['Srvrs Rtrs Swtches$'].IP_Address

Thanks
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

734 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