ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
Is it possible to create tables in stored procedures using 
a variable for the table name?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Is it possible to create tables in stored procedures using a variable for the table name?
Answer
# 1
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 ?    5 Yes 0 No
Skybeaver
 
  Re: Is it possible to create tables in stored procedures using a variable for the table name?
Answer
# 2
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
Pradeep
 
 
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
is it possible to use a variable in a query with the IN clause (a,b,c..z), without getting quotes or conversion errors?  2
How do you simulate a deadlock for testing purposes  1
How to find out name of all employees who has salary less than 200 Rs.?  7
write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Name : emp2 empid empname 1 <Null> 2 <Null> Solution : emp1 names are updated in emp2, write a query?  7
What is BCP? When do we use it?  1
how many joins we can write if at all we have n no of tables Tanla-Solutions4
What are the pros and cons of creating extended stored procedures?  1
What is the difference between HAVING clause and the WHERE clause?  4
how we can count records as a group of days like sum of records for(four mondays),(four tuesday)........ in a month. group the column for weekdays.  1
what is replication? where do u use Go Keyword? Satyam1
can you any body tell me which service pack is installed in the sql server?  3
From where can you change the default port?  3
What is a view?  4
what is meant by deafult in sql server?  2
what is the difference between Delete and Truncate Geo-Research-Centre3
can we call functions from stored procedure in SQL Server 2005 ? How?  2
i want only duplicates rows from coloumn ex. emp_id(colomn name)1,1,2,3,3,4,5,5. so i want only duplicates no. iFlex2
WHAT OPERATOR PERFORMS PATTERN MATCHING? CTS2
what is physical sort data and logical sort data in index?  2
Write a query to delete duplicate records in SQL SERVER Infosys19
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com