日期:2014-05-18  浏览次数:20811 次

sqlserver 2000导出问题
sqlserver 2000 能不能导出的数据都带双引号啊!要是可以请问怎么样操作。就是每个字段都带上双引号
例如:"1","wer","werqer","wqer","2012-1-1"

------解决方案--------------------
我印象里面好像不行,因为双引号在SQL语句中比较特殊。而且我刚才也打开【导出数据】功能。没找到,不知道有没有人能找到怎么设置。
------解决方案--------------------
SQL code

select ''''''+列名1+'''''',
       ''''''+列名2+''''''
from table1

--要显示双引号,你要用6个单引号在SQL里

------解决方案--------------------
SQL code

CREATE TABLE t1
(
    arrid VARCHAR(10),
    array VARCHAR(2000)
)
INSERT INTO t1
SELECT 'A',    '20,223,2544,25567,14' UNION ALL
SELECT 'B',    '30,-23433,28' UNION ALL
SELECT 'C',    '12,10,8099,12,1200,13,12,14,10,9' UNION ALL
SELECT 'D',    '-4,-6,-45678,-2' UNION ALL
SELECT 'E',    '5,18,258,6,-52' UNION ALL
SELECT 'F',    '1,2,3,45,-678' UNION ALL
SELECT 'G',    '1,58,6'

SELECT    ''''''+arrid+'''''',
        ''''''+array+''''''
FROM    t1

-----------------------
''A''    ''20,223,2544,25567,14''
''B''    ''30,-23433,28''
''C''    ''12,10,8099,12,1200,13,12,14,10,9''
''D''    ''-4,-6,-45678,-2''
''E''    ''5,18,258,6,-52''
''F''    ''1,2,3,45,-678''
''G''    ''1,58,6''