473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to create a series of tables with a variable name?

hi all,
I am new to MSSQL and I am thinking whether I can create a table with its name containing a variable. That is , I want to create a variable number of tables depending on the parameter passed to the stored procedure. Need Help on that. Thanks in advance.
Jul 13 '07 #1
2 1048
debasisdas
8,127 Expert 4TB
yes you can easily do that by little programming knowledge.
Jul 13 '07 #2
srinit
43
hi all,
I am new to MSSQL and I am thinking whether I can create a table with its name containing a variable. That is , I want to create a variable number of tables depending on the parameter passed to the stored procedure. Need Help on that. Thanks in advance.
HI
I am sending an example .It will help you
[code]
create pro pro1(@a int)
as
begin
while(@a>0)
begin
exec('create table table+'+@a)
set @a=@a-1
end
end
Jul 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
2
by: Helge | last post by:
I wonder how this can be accomplished: I've got a list, containing several strings. The strings look like this: I would like to create one object for each item in the list, and the name...
2
by: terence.parker | last post by:
I am often faced with the dilemma of whether to use a JOIN query across three tables in order to grab a bunch of results - or whether to create another table to represent what I want. The latter is...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
2
by: Bruno Remeyse | last post by:
Hi, I need help for the following problem : At the start of my application, i found the items of the configuration in the register. This items represent tools connected to the system at this...
12
by: Doug Bell | last post by:
Hi, I am having problems trying to create a (temporary) DataTable from a selection from a DataGrid (dgOrders). dtOrdDetails is declared as a Public DataTable Sub is: Dim stFilter as String...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
2
by: =?Utf-8?B?T2xkQnV0U3RpbGxMZWFybmluZw==?= | last post by:
I want create an instance of an object which accepts a Data Reader as a constructor. I realize that I could create a gigantic case statement in which I test for each text name, but that case...
0
by: TrevRex | last post by:
Hello, I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.