Hi All,
I want to create tables csdplandata_1_x in a database, where 'x' is a value of column in other table in the same database.
Table1:
col-x
1
2
3
I need to create tables csdplandata_1_1,csdplandata_1_2,csdplandata_1_3 in one shot. Can anybody help me in writing T-SQL for this.
5 1841
You can generate a script but you need to know what columns new tables will have.
Script can look something like this
[PHP]
Select ‘Create table csdplandata_1_’ + convert(varchar(10), col-x) + ‘(column1 datatype, column1 datatype)’
From Table1[/PHP]
Hi ,
I need a T-SQL statement. I wud be glad if u can give a T-SQL code
This is a T-SQL statement to generate a script.
I don't know which columns will be in your new tables so there is no way for me to make it work for you.
When you generate this script you should get following:
Create table csdplandata_1_1(column1 datatype, column1 datatype)
Create table csdplandata_1_2(column1 datatype, column1 datatype)
Create table csdplandata_1_3(column1 datatype, column1 datatype)
Just execute these generated statements.
you can add 'go' in between the tables created..
This is a T-SQL statement to generate a script.
I don't know which columns will be in your new tables so there is no way for me to make it work for you.
When you generate this script you should get following:
Create table csdplandata_1_1(column1 datatype, column1 datatype)
Create table csdplandata_1_2(column1 datatype, column1 datatype)
Create table csdplandata_1_3(column1 datatype, column1 datatype)
Just execute these generated statements.
I manage dto generate the table using a cursor..thanks for the help
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Phil Powell |
last post by:
create table if not exists nnet_produkt_varegruppe (
nnet_produkt_varegruppe_id int not null auto_increment,
primary key(nnet_produkt_varegruppe_id),
nnet_produkt_varegruppe_navn varchar(255) not...
|
by: dev |
last post by:
how create a temp table as a copy of a existing table and then update1 field
and insert the hole temp table back in the existing table?
please any help?
if i have 10 fields in 1 record and...
|
by: Michael Jackson |
last post by:
I have a stored procedure to create a table. In my program I want the user
to name the table to be created, therefore I pass a parameter to the SP for
the table name. I cannot get it to work.
It...
|
by: Wolfgang Kreuzer |
last post by:
Hello all,
I have two tables - Projects and ProjectStruct
Table Projects contains master records of the projects, ProjectStruct
allows to define a project herarchie and contains the fields...
|
by: poohnie08 |
last post by:
i have a excel spreadsheet showing staff name, date,work hour, ot
hour, slot1, slot2, slot3, slot4 and others). The "()" will keep
repeating from day 1 until end of month.
eg in excel spreadsheet,...
|
by: flkeyman |
last post by:
Work in legal office. Trying to create solid designed database
structure. This is list of tables w/fields and primary keys. Any
comments/advice greatly appreciated.
tbl-Defendants
CaseNumber...
|
by: Peter Nurse |
last post by:
For reasons that are not relevant (though I explain them below *), I
want, for all my users whatever privelige level, an SP which creates
and inserts into a temporary table and then another SP...
|
by: max |
last post by:
Hello,
I am a newbye, and I'm trying to write a simple application.
I have five tables with three columns; all tables are identical; I need to
change some data in the first table and let VB...
|
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...
|
by: lakuma |
last post by:
Hi,
I have a table called A (say) with columns called name, place, animal and thing.
I would want to write an on insert trigger on this table, which would create a table with the name of the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
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...
| |