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

sql»ù±¾³£Ê¶ÎÊÌâ

declare @aa varchar(50)
set @aa='select * from table'
¿ÉÒÔÖ´ÐÐÕâ¸ö@aaÂ𠣿Èç¹û¿ÉÒÔÔõôִÐУ¿ лл
SQL code:
declare @aa varchar(50)
set @aa='select * from table'
exec(@aa)


SQL code:
declare @aa varchar(50)
set @aa='select * from table'
EXEC(@AA)


SQL code:

declare @aa varchar(50)
set @aa='select * from table'
exec(@aa)--ʹÓö¯Ì¬SQL



SQL code:
¶¯Ì¬SQLÓï¾ä

1:ÆÕͨSQLÓï¾ä¿ÉÒÔÓÃExecÖ´ÐÐ
eg: Select * from tableName
Exec('select * from tableName')
exec sp_executesql N'select * from tableName' -- Çë×¢Òâ×Ö·û´®Ç°Ò»¶¨Òª¼ÓN


2:×Ö¶ÎÃû£¬±íÃû£¬Êý¾Ý¿âÃûÖ®Àà×÷Ϊ±äÁ¿Ê±£¬±ØÐëÓö¯Ì¬SQL
eg:
declare @fname varchar(20)
set @fname = '[name]'
Select @fname from sysobjects -- ´íÎó
Exec('select ' + @fname + ' from sysobjects') -- Çë×¢Òâ ¼ÓºÅǰºóµÄ µ¥ÒýºÅµÄ±ßÉÏÒª¼Ó¿Õ¸ñ
exec sp_executesql N' select ' + @fname + ' from sysobjects'
µ±È»½«×Ö·û´®¸Ä³É±äÁ¿µÄÐÎʽҲ¿É
declare @s varchar(1000)
set @s = 'select


Ïà¹ØÎÊ´ð£º

sqlת»»ÎÊÌ⣬¼±£¡ - ÉçÇøÖ§³Ö / ¡¶³ÌÐòÔ±¡·ÔÓÖ¾

select convert(varchar(50),cast(convert(numeric(18,2),1275674000000/100000000)as real))+'ÒÚ'
select cast(convert(numeric(18,2),1275674000000/100000000)as real)
ΪʲôÉÏÒ»¸öÓÃvarcharת»»ºó¾ÍÖ»±£ÁôÁËÒ ......

Asp+sql serverÎÊÌâ - Web ¿ª·¢ / ASP

ÎÒÒ»¸öÏîÄ¿£¬Óиö²åÈë²Ù×÷£¬¾ßÌåÊÇÕâÑùµÄ£º
ÎÒÓнø»õÐÅÏ¢±í¡£ÔÚ³ö»õʱѡÔñÏàÓ¦µÄ½ø»õÐÅÏ¢£¬ÊäÈëÊýÁ¿£¬Ñ¡Ôñ²¿Ãź󣬵㱣´æ°´Å¥£¬ÓÉÓÚÍøÂçÑÓʱ£¬µãÒ»ÏÂûÓз´Ó³£¬ÓÚÊÇÓû§¾ÍÓÖµãһϣ¬µ¼ÖÂÒ»´Î²åÈëÁËÁ½Ìõ¼Ç¼:
Àý£º ......

ÇóÒ»sqlÓï¾ä - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÏÖÔÚÓÐÁ½ÕÅ±í£ºÎÄÕÂÖ÷±íA(articleId,articleTitle)£¬ÎÄÕÂÆÀÂÛ±íB(commentId,articleId,commentTitle)
ÏÖÔÚÎÒÏëʵÏÖÕâÑùµÄ¹¦ÄÜ£ºÁгöÎÄÕÂÁÐ±í£¬ÆäÖÐÿƪÎÄÕ±êÌâÏÂÃæÁгö´ËÎÄÕµÄǰ2¸öÎÄÕÂÆÀÂÛ£¬ÇëÎÊsqlÓï¾äÔõôд°¡ ......

¹ØÓÚSQL Server Mobile Edition - .NET¼¼Êõ / ASP.NET

¹ØÓÚSQL Server Mobile Edition
ÓÃMicrosoft SQL Server2005 Management Studio Express9.00.3042.00´´½¨SQLCEÊý¾Ý¿âsqlmobile.sdf
ÔÚmobileϵͳÖÕ¶ËÉÏÓÃSQL Server Mobile Edition3.0Äܲ鿴sqlmobile.sdfÀï±íÊý¾Ý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ