由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - how to using sql generate sql statements?
相关主题
database design issueHow to insert a string into table? Thanks
urgent help! insert value into tableSQL help.
Help on Sql server huge table performanceUrgent help!!!
MS T-SQL 问题如何决定index
请教一个oracle的quick questionquestion: copy first N rows from table B to table A (DB2)
In toad, How to replace 0 with empty?
很弱的Oracle问题请问如何实现这样一个mysql的query, 谢谢
SQL Server stupid questions问一个SQL Server的问题
相关话题的讨论汇总
话题: sql话题: statements话题: generate话题: need话题: toad
进入Database版参与讨论
1 (共1页)
e****e
发帖数: 1775
1
for example, i would like to generate insert and update statements for all
the tables in my db1 database. Need these scripts in other code.
Thanks.
Will do it in Toad. it's a vely basic & simple question.
any reply will be appreciated!
c**t
发帖数: 2744
2
declare @sql varchar(1000)
set @sql='select * from TBALE'
execute @sql

for example, i would like to generate insert and update statements for all
the tables in my db1 database. Need these scripts in other code.
Thanks.
Will do it in Toad. it's a vely basic & simple question.
any reply will be appreciated!

【在 e****e 的大作中提到】
: for example, i would like to generate insert and update statements for all
: the tables in my db1 database. Need these scripts in other code.
: Thanks.
: Will do it in Toad. it's a vely basic & simple question.
: any reply will be appreciated!

e****e
发帖数: 1775
3
no.....
偶的意思是:
先举个例子:
select 'select count(*) from ' || table_name ||
';' || from user_tables;
结果偶就可以得到查所有表的记录数的sql语句
偶现在想要这样的一句来得到对所有表的insert语句
包含各个表的列名最好
产生的结果偶要在其他地方用
希望这回说明白了
谢谢

【在 c**t 的大作中提到】
: declare @sql varchar(1000)
: set @sql='select * from TBALE'
: execute @sql
:
: for example, i would like to generate insert and update statements for all
: the tables in my db1 database. Need these scripts in other code.
: Thanks.
: Will do it in Toad. it's a vely basic & simple question.
: any reply will be appreciated!

1 (共1页)
进入Database版参与讨论
相关主题
问一个SQL Server的问题请教一个oracle的quick question
Common Table Expression 问题In toad,
也問 Common Table Expression 问题很弱的Oracle问题
why this Trigger hang the Process *** thanks thanksSQL Server stupid questions
database design issueHow to insert a string into table? Thanks
urgent help! insert value into tableSQL help.
Help on Sql server huge table performanceUrgent help!!!
MS T-SQL 问题如何决定index
相关话题的讨论汇总
话题: sql话题: statements话题: generate话题: need话题: toad