To :csdn3ks(3ks)
大哥我有3030个表,太累了。我开局时曾改过一天一晚哪!!!
给个SQL SERVER 7.0的语句吧!!!
解决方案 »
- sqlbase求助
- SQL里面大家怎么分析执行计划的!期待高手分享经验
- 数据库读取慢
- 请教:有关SQL2000发布与订阅的问题
- 如何从一个数据库表中查询出记录集,然后在另一个数据库中新建一个表,并将查询出的数据集写入到这个新建的表中!
- 删除相同记录,但保留一条的SQL
- 关于外联接的问题
- 在有物理防火墙的情况下,已经打开1433端口,不通过WEB服务器,通过VB的ADO是否可以存取SQL SERVER的数据?我这里没有物理防火墙,无法验
- 问个sql的写法........
- 能否用sql语句更改sql server自己的用户登陆的密码?
- 请问怎样用vb导出某表的结构?谢谢
- 怎样在SQL SERVER 里插入图象数据,和查看图象数据?
你可以先update 一下你的数据:update qww
set Fee1=cast(Fee1 as numeric(18,2)
goALTER TABLE ALTER COLUMN Fee1 nymeric(18,2)
go
2、将real替换成Numeric(12,2)
3、用数据import/export功能将原来的数据导入到新的数据库中,仅导入数据
新的数据库就是完成修改的功能后的数据库。
试试吧。
“
SP_MsForEachTable ”
的具体语句怎么样写?
您是高手请指教!!
唉~~~年事已高,年代久遠,忘記怎麼用了,呵呵:D語法挺複雜的,我先查查看那張帖子在不在了再說。
Exec sp_msforeachtable "Select * From ? " ,"?"整個SP的內容如下,俺沒時間去研究Text
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- create proc sp_MSforeachtable
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null,
@command3 nvarchar(2000) = null, @whereand nvarchar(2000) = null,
@precommand nvarchar(2000) = null, @postcommand nvarchar(2000) = null
as
/* This proc returns one or more rows for each table (optionally, matching @where), with each table defaulting to its own result set */
/* @precommand and @postcommand may be used to force a single result set via a temp table. */ /* Preprocessor won't replace within quotes so have to use str(). */
declare @mscat nvarchar(12)
select @mscat = ltrim(str(convert(int, 0x0002))) if (@precommand is not null)
exec(@precommand) /* Create the select */
exec(N'declare hCForEach cursor global for select ''['' + REPLACE(user_name(uid), N'']'', N'']]'') + '']'' + ''.'' + ''['' + REPLACE(object_name(id), N'']'', N'']]'') + '']'' from dbo.sysobjects o '
+ N' where OBJECTPROPERTY(o.id, N''IsUserTable'') = 1 ' + N' and o.category & ' + @mscat + N' = 0 '
+ @whereand)
declare @retval int
select @retval = @@error
if (@retval = 0)
exec @retval = sp_MSforeach_worker @command1, @replacechar, @command2, @command3 if (@retval = 0 and @postcommand is not null)
exec(@postcommand) return @retval
***扬帆破浪***大侠的语句十分好使!!!应该写成:
update qww
set Fee1=cast(Fee1 as numeric(18,2))
goALTER TABLE ALTER COLUMN Fee1 numeric(18,2)
go一劍飄香兄的sp_msforeachtable 语法验证通过,但没什么作用?
请一劍飄香兄再指点指点!!!
谢谢各位大侠了!!!