Redian新闻
>
how to using sql generate sql statements?
avatar
how to using sql generate sql statements?# Database - 数据库
e*e
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!
avatar
c*t
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!

avatar
e*e
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!

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。