Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL server 2000 ÈçºÎÅжÏÁÙʱ±íÊÇ·ñ´æÔÚ


 
 
1.ÅжÏÒ»¸öÁÙʱ±íÊÇ·ñ´æÔÚ
if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tempcitys') and type='U')
   drop table #tempcitys
×¢ÒâtempdbºóÃæÊÇÁ½¸ö. ²»ÊÇÒ»¸öµÄ
---ÁÙʱ±í
if exists(select * from tempdb..sysobjects where name like ‘#tmp1%‘)
drop table #tmp1
»ò
if exists( select * from tempdb..sysobjects where id=OBJECT_ID('tempdb..#tmp') )
drop table #tmp1
--ÊÓͼ
if exists (select * from sysobjects where id = object_id(N‘[dbo].[ESTMP]‘)
and OBJECTPROPERTY(id, N‘IsView‘) = 1)
  drop view ESTMP
ÅжϱíÊÇ·ñ´æÔÚ
if exists (select * from sysobjects where id = object_id(N'[dbo].[phone]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[phone]


Ïà¹ØÎĵµ£º

VBʵÏÖSQL ServerÊý¾Ý¿â±¸·Ý/»Ö¸´

VBʵÏÖSQL ServerÊý¾Ý¿â±¸·Ý/»Ö¸´
http://blog.csdn.net/cncco/archive/2006/05/15/729356.aspx
’**Ä£ ¿é Ãû£ºfBackupDatabase_a
’**Ãè    Êö£º±¸·ÝÊý¾Ý¿â,·µ»Ø³ö´íÐÅÏ¢,Õý³£»Ö¸´,·µ»Ø""
’**µ÷    ÓãºfBackupDatabase_a "±¸·ÝÎļþÃû","Êý¾Ý¿âÃû"
’**²ÎÊý˵Ã÷£ ......

sql server µ¼Èëµ¼³öÊý¾Ýµ½execl

1 Export data to existing EXCEL file
from SQL Server table
insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\testing.xls;',
'SELECT * from [SheetName$]') select * from SQLServerTable
2 Export data from Excel to new SQL Server table
select *
into SQLServerTab ......

ÓÃSQLÈ¥³ý±íÖÐijÁеÄIdentiferÊôÐÔ

sp_configure 'allow updates', 1
GO
reconfigure with override
GO
update syscolumns set colstat = colstat & 0x0000
where id=object_id('±íÃû') and name='ÁÐÃû'
GO
sp_configure 'allow updates', 0  ......

ÅäËÍÒѵ½»õ¶©µ¥ºÅ²éѯ sql Óï¾äÓÅ»¯

select c0501 "¶©µ¥±àºÅ",
   c0503 "¹©Ó¦É̱àÂë",a0302 "¹©Ó¦ÉÌÃû³Æ",
   to_char(c0515,'yyyy.mm.dd') "¶©»õÈÕÆÚ",
   to_char(c0516,'yyyy.mm.dd') "Ô¤¶¨½»»õÈÕÆÚ"
   from c05,a03 where c0503=a0301 and
 &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ