SELECT * INTO NewTable FROM existingdb.dbo.existingtable;

I am executing this query but it is showing me the error as undeclared variable:Quanti

(as quanti is my NewTable)

Recommended Answers

All 3 Replies

Not enough information to go on. What is the exact statement you are executing? What is the exact error message you are receiving? Where are you executing the statement (e.g. SSMS, or from a program, or some other tool)? What is the data structure of the old table? Are you trying to create the new table in the same database?

Can't help if it's too vague.

U may want to check your syntax well.

RSELECT select_list
RINTO [New_Table_Name]
RFROM Table_List

Please ignore the 'R', i was on my mobile so i did not notice those errors
Here's the correct syntax:

SELECT select_list
INTO [New_Table_Name]
FROM Table_List
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.