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 |
Introduction of rollup clause using sum and group by clause?
What are the operating modes in which database mirroring runs?
What are three major types of constraints?
Hi..here i would like to know the Backup and Restore models?
How many files can a database contain in sql server?how many types of data files exists in sql server? How many of those files can exist for a single database?
How to verify a user name with sqlcmd tool?
What is the difference between push and pull subscription? : sql server replication
How do you create a data source?
How to count the number of duplicate items in a table?
what is the output for this query select * from employee where 1=1;
How efficient you are in oracle and SQL server?
What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security
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)