¶¯Ì¬´´½¨sqlʵÀý
string error_syntaxfromSQL, error_create
string new_sql, new_syntax
new_sql = 'SELECT emp_data.emp_id, ' &
+ 'emp_data.emp_name ' &
+ 'from emp_data ' &
+ 'WHERE emp_data.emp_salary>45000'
new_syntax = SQLCA.SyntaxfromSQL(new_sql, &
'Style(Type=Form)', error_syntaxfromSQL)
IF Len(error_syntaxfromSQL) > 0 THEN
// Display errors
mle_sfs.Text = error_syntaxfromSQL
ELSE
// Generate new DataWindow
dw_new.Create(new_syntax, error_create)
&
Ïà¹ØÎĵµ£º
How To Use Dynamic Sql in Sql Server ?
¶¯Ì¬SQL ÔÚsql server ProcedureÖеÄÓ¦ÓÃ
Create PROCEDURE [dbo].[Proc_Get_Serial_No]
(
@Table_Name varchar(20),
......
1¡¢ÔÚ°²×°ÓÐSQL SERVER 2000µÄµçÄÔÉÏ´ò¿ª“ʼþ̽²éÆ÷”£¬²Ù×÷Èçͼ£º
2¡¢Ôړʼþ̽²éÆ÷”ÖÐн¨Ò»¸ö¸ú×Ù£ºÎļþ/н¨/¸ú×Ù
3¡¢ÊäÈëÁ¬½Ó·þÎñÆ÷µÄÃØÃÜ£¬×¢ÒâÊÇU8µÄÊý¾Ý·þÎñÆ÷£¬¿ÉÒÔ¸ù¾Ýʵ¼ÊÐÞ¸ÄIPµØÖ·¡£
4¡¢¸ü¸Ä¹ýÂËÉèÖ㺿ÉÒÔÔÚ¡¾Îļþ/ÊôÐÔ¡¿´ò¿ªÕâ¸ö¶Ô»°¿ò£¬µ«ÊÇÒª¸ü¸Ä£¬Ê× ......
Êý¾Ý¿â±¸·Ý ×÷ÒµÖеÄSqlÓï¾ä£º
DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '_')
set @strPath = REPLACE(@strPath, '-' , '_')
set @strPath = REPLACE(@strPath, ' ' , '_')
set @strPath = 'F:\Êý¾Ý¿â±¸·Ý\' + myData_'+@s ......
SQL Server µ¼Èë/µ¼³ö½Ì³Ì
¸ü¶àÇë²é¿´£º http://faq.gzidc.com/index.php?option=com_content&task=category§ionid=12&id=21&Itemid=43
1¡¢´ò¿ª±¾µØÆóÒµ¹ÜÀíÆ÷£¬ÏÈ´´½¨Ò»¸öSQL Server×¢²áÀ´Ô¶³ÌÁ¬½Ó·þÎñÆ÷¶Ë¿ÚSQL Server¡£
²½ÖèÈçÏÂͼ£º
ͼ1:
2¡¢µ¯³ö´°¿ÚºóÊäÈëÄÚÈÝ¡£"×ÜÊÇÌáʾÊäÈëµÇ½ÃûºÍÃÜÂë" ......
ϵͳº¯Êý
1.case when ... then ..else ..end(ÓÃÓÚ¶ÔÌõ¼þ½øÐвâÊÔ)
e.Select id,case when name='deepwishly' then 'ÀÏ´ó' else 'ÆäËû' end as Type
ÏÔʾ id type
1 ÀÏ´ó
2.cast()/convert() Ç°Õß¾ßÓÐANSI SQL-92¼æÈÝÐÔ£¬ºóÕß¹¦ÄܸüÇ ......