Is it possible to create tables in stored procedures using
a variable for the table name?
Answers were Sorted based on User's Feedback
Answer / skybeaver
create proc ShowMeHow
as
declare @Cities table(
AirportCode char(3) not null primary key,
CityName varchar(255) not null
)
insert into @Cities values('LAX', 'Los Angeles')
insert into @Cities values('ORD', 'Chicago')
select * from @Cities
go
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / pradeep
One Can create Table using a variable. As #1 Answer
describe. You can only create a temp (memory) table but can
not create physical table.
It will give an error while attempting to execute : -
Create Table @VariableName( EmpID varchar(10),
EmpNm Varchar(100)
)
| Is This Answer Correct ? | 1 Yes | 0 No |
How to restart SQL Server in single user mode? How to start SQL Server in minimal configuration mode?
How dts is used to extract, transform and consolidate data?
What are trace files?
what is denormalization? : Sql server database administration
What is the difference between TRUNCATE and DROP?
What can be used instead of trigger?
What is difference between Triggers and store procedure?
Explain basic SQL queries with SELECT from where Order By, Group By-Having?
Explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?
What it means to be triggered?
How do we know if any query is retrieving a large amount of data or very little data?
if 3 duplicate records in a table,i want to delete 2 duplicate records by keeping 1 duplicate and 1 original as it is,how?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)