sqlserverÖÐתÒåµÄд·¨ÎÊÌâ
select * from export where Æ·ÅÆ is not null and ÎÄÕ±êÌâ like '%»¹ÒªÈ̶à¾Ã?·áÌïµÄ'ɲ³µ'Óë'»Ø¹é'%'
Õâ¾ä²éѯÓï¾äתÒåÔõôдѽ£¬Çë´ó¼Ò°ïÏÂ棬лÁË
SQL code:
select * from export where Æ·ÅÆ is not null
and ÎÄÕ±êÌâ like '%»¹ÒªÈ̶à¾Ã?·áÌïµÄ''ɲ³µ''Óë''»Ø¹é''%'
SQL code:
select * from export where Æ·ÅÆ is not null and ÎÄÕ±êÌâ like '%»¹ÒªÈ̶à¾Ã?·áÌïµÄ''ɲ³µ''Óë''»Ø¹é''%'
ÔÚ×Ö·û´®ÖÐ,Á½¸ö'µÈÓÚ³£¹æϵÄÒ»¸ö'
SQL code:
create table #(code varchar(20),value int)
declare @sql varchar(200)
set @sql='insert into # select ''AAA'',10'
-- AAA֮ǰµÄÒ»¶Ôµ¥ÒýºÅÓëÖ®ºóµÄÒ»¶Ôµ¥ÒýºÅ·Ö±ð´ú±íÒ»¸öµ¥ÒýºÅ
print @sql --²é¿´Õâ¸ö×Ö·û´®µÄʵ¼ÊÄÚÈÝ
/*
insert into # select 'AAA',10
*/
exec(@sql)
select * from #
/*
code value
-------------------- -----------
AAA 10
*/
--Èç¹ûÐèÒªinsertÒ»¸öֵΪ'A''AA'µÄ×Ö·û´®£¬ÈçÏ£º
set @sql='insert into # select ''A''''AA'',10'
--Á½²ãǶÌ×µÄ×Ö·û´®ÄÚ²¿£¬Ò»¸öµ¥ÒýºÅÐèÒª¾¹ýÁ½´ÎתÒ壬ÓÚÊDZä³ÉÁË4¸öµ¥ÒýºÅ
print @sql --²é¿´Õâ¸ö×Ö·û´®µÄʵ¼ÊÄÚÈÝ
/*
insert into # select 'A''AA',10
*/
exec(@sql)
select * from #
/*
code
Ïà¹ØÎÊ´ð£º
ÇëÎÊһϣ¬ÍâÍøÁ½Ì¨SQLSERVERʵÀýÊý¾Ý´«Ê䣬ÓÐûÓвÉÓÃÊý¾ÝѹËõºÍ¼ÓÃÜ¡£Ñ¹Ëõ±ÈÊǶàÉÙ£¬¼ÓÃÜÊÇʲô¼ÓÃÜËã·¨£¿Ïà¹ØÎĵµÄÄÀï¿ÉÒÔÕÒµ½£¿Ð»Ð»
ÎÒÒ²ÏëÖªµÀ£¡¹Ø×¢´ËÌù£¡
¹Ø×¢¡«¡«
Êý¾Ý¿â´óÅ£¶¼ÄÄÈ¥ÁË°¡£¿
......
ÓÐһ̨Êý¾Ý¿â·þÎñÆ÷£¬¿Í»§¶ËʹÓÃADO.NETÁ¬½Ósql£¬Ê¹ÓÃExecuteScalarÖ´ÐÐSQL INSERTÓï¾ä£¬È»ºó¿Í»§¶Ëˢв»Äܲéѯµ½ÐÂINSERTµÄÊý¾Ý£¬¹ý10Ãë×óÓÒ²ÅÄܲ鵽ÐÂÊý¾Ý
ʲôÔÒò
Äã×öÁË»º´æÂð£¿
û×ö»º´æ
Ôõô»áÄØ£¡ ......
ÈçºÎ½«SqlServerÊý¾Ý¿âÖеÄÊý¾Ýµ¼Èëµ½ExcelÖУ¿
ÓÃsql server ×Ô´øµÄ¹¤¾ß
ÒýÓÃ
ÓÃsql server ×Ô´øµÄ¹¤¾ß
SQL²éѯ·ÖÎöÆ÷
DTSµ¼Èëµ¼³öÊý¾Ý
¿ÉÒÔÓÃSqlServer×Ô´øµÄ¹¤¾ß
ËùÓÐÈÎÎñ£µ¼³öÊý¾Ý¡£
ÄãÏÈÓòéÑ ......
±àºÅ ¼¶±ð Ãû³Æ Éî¶È
1 0 ÐÂÎÅ 1
2 0 ²Æ¾ 1
3 1 ¾üÊ 2
4 2 ¹ÉƱ 3
5 0 ·¿²ú 1
6 1 Çé¸Ð 2
7 1 ¹úÄÚ 2
8 1 ¹ú¼Ê 2
14 2 ÓÊÕþµçÐÅ 2
15 2 »·±£ 2
16 5 ITÆó ......
ÈçºÎÆÁ±ÎSQLSERVERµÇ¼Óû§ºÍÆô¶¯µÇ¼Óû§
ÆÁ±ÎʲôÒâ˼¡£¡£¡£¡£
°²ÐÔÐÔ,µÇ¼Ãû,Ñ¡ÔñµÇ¼Óû§,ÓÒ¼üÊôÐÔ,״̬,½ûÓõǼ
SQL Server Management Studio-->°²È«ÐÔ-->µÇ¼Ãû-->Ñ¡ÔñµÇ¼Óû§-->ÓÒ¼ü ......