Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 RANK FUNCTION

Author  Topic 

Suhanti
Starting Member

9 Posts

Posted - 2009-02-26 : 07:59:11
Hello All,

I am currently writing syntax in the blind as I don't have access to data or the database.
Can you help me.

Can you create table as
cREATE TABLE xyx as
Select *
from existing table
;

Kind regards
Su

bjoerns
Posting Yak Master

154 Posts

Posted - 2009-02-26 : 08:09:24
[code]SELECT *
INTO xyz
FROM existing_table[/code]
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-02-26 : 08:17:33
quote:
Originally posted by bjoerns

SELECT *
INTO xyz
FROM existing_table




And if you just need the structure without the data, then

SELECT *
INTO xyz
FROM tran_bookings where 1=2
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-02-26 : 08:21:07
Not sure you are asking this though, your subject speaks of something else.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-26 : 08:46:00
quote:
Originally posted by Suhanti

Hello All,

I am currently writing syntax in the blind as I don't have access to data or the database.
Can you help me.

Can you create table as
cREATE TABLE xyx as
Select *
from existing table
;

Kind regards
Su



But you need to have necessary permissions first.
Go to Top of Page

Suhanti
Starting Member

9 Posts

Posted - 2009-02-26 : 10:23:32
Sorry folks,
Had another ranking question, but I didn't put it down.
thanks!
Just realised that this is SQL Server 2000.
Can it handle advanced query functions?
Go to Top of Page

Suhanti
Starting Member

9 Posts

Posted - 2009-02-26 : 10:29:02
Hello Again,
It's my mistake, again. Sorry really blur.
Okay I understand.

Posted - 02/26/2009 : 08:17:33
--------------------------------------------------------------------------------

quote:
--------------------------------------------------------------------------------
Originally posted by bjoerns


SELECT *
INTO xyz
FROM existing_table


--------------------------------------------------------------------------------



And if you just need the structure without the data, then

SELECT *
INTO xyz
FROM tran_bookings where 1=2

As for, it merely recreates the table "shell" ? then reimport the data?
Thank you I am very new to this.

Sincerely
Su
Go to Top of Page
   

- Advertisement -