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

sqlʵÏÖIPµÄÕûÊýÓë×Ö·û´®×ª»¯

Êý¾Ý¿â²Ù×÷£ºÀûÓú¯Êý¼õÉÙ´æ´¢¿Õ¼ä£¨ÒÔʱ¼ä»»È¡¿Õ¼ä£©
ÀýÈçÒ»¸ö±íÓÐIPÁУ¬ÔÚ´æ´¢µÄʱºòÎÒÃÇΪÁ˼õÉÙ´æ´¢¿Õ¼ä£¬¿ÉÒÔ½«Ëüת»¯ÎªÕûÊý£¬´æ´¢ÔÚÊý¾Ý¿â£¬µ«ÊÇÔÚ´ÓÊý¾Ý¿âÀï²éѯ²¢ÏÔʾ¸ø´ó¼Ò¿´µÄʱºò£¬¿ÉÄÜÄãÊÇ¿´²»Ã÷°×ÕûÊý¾ßÌåÊÇʲô¡£ÕâÑùΪÁËÀûÓÚ´ó¼ÒÔĶÁ·ÖÎöÊý¾Ý£¬¿ÉÒÔÔÚ²éѯµÄʱºòÀûÓú¯Êý½«ÕûÊýIPתΪΪ×Ö·û´®
ÀýÈ磺
 
¹Ø¼ü¾ÍÊÇÕâ¸öIpToStringº¯ÊýµÄʵÏÖ£º
 
ÔÚ“º¯Êý”´¦£¬ÓÒ»÷£¬Ñ¡Ôñ“н¨”£¬ÔÙÑ¡Ôñ“±êÁ¿Öµº¯Êý”£¬ÔÚ³öÏÖµÄÒ³ÃæÀï¸ù¾ÝÌáʾ±àд×Ô¼ºµÄº¯Êý£¬ÏÂÃæµÄº¯ÊýÊǽ«IP¶ÔÓ¦µÄÕûÊýת»¯Îª×Ö·û´®
 
 USE [Test]
GO
/****** Object: UserDefinedFunction [dbo].[Ip2String] Script Date: 11/26/2009 11:42:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
ALTER FUNCTION [dbo].[Ip2String]
(
-- Add the parameters for the function here
@ip int
)
RETURNS nvarchar(16)
AS
BEGIN
-- Declare the return variable here
DECLARE @result nvarchar(16)
-- Add the T-SQL statements to compute the return value here
SELECT @result = Cast ((@ip / power(2,24)) & 0xFF AS nvarchar) + '.'
+ Cast ((@ip / power(2,16)) & 0xFF AS nvarchar) + '.'
+ Cast ((@ip / power(2,8)) & 0xFF AS nvarchar) + '.'
+ Cast (@ip & 0xFF AS nvarchar)

-- Return the result of the function
RETURN @result
END


Ïà¹ØÎĵµ£º

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......

sql serverÊÓͼµÄ×÷Óã¨×ª£©

    ËùνÊÓͼ£¨View£©ÆäʵÊÇÖ´ÐвéѯÓï¾äºóµÃµ½µÄ½á¹û£¬µ«Õâ¸ö²éѯ½á¹û¿ÉÒÔ·ÂÕæ³ÉÊý¾Ý±íÀ´Ê¹Óã¬ËùÒÔÓÐÈËÒ²³ÆËüΪ“ÐéÄâÊý¾Ý±í”£¬ÊÓͼÔÚ²Ù×÷ÉϺÍÊý¾Ý±íûÓÐʲôÇø±ð£¬µ«Á½ÕߵIJîÒìÊÇÆä±¾ÖÊÊDz»Í¬µÄ£ºÊý¾Ý±íÊÇʵ¼Ê´æ´¢¼Ç¼µÄµØ·½£¬È»¶øÊÓͼ²¢²»±£´æÈκμǼ£¬Ëü´æ´¢µÄʵ¼ÊÉÏÊDzéѯÓï¾ä£¬ÆäËù³ÊÏÖ³ ......

sql ²Ù×÷

 exec   sp_rename   't_2.lname','lastname','column' 
exec   sp_rename   ‘tabelname’,'new'
 
»ñµÃsqlÓï¾äµÄÖ´ÐÐʱ¼ä£º
SET STATISTICS TIME ON
// sql Óï¾ä£ºselect * from table
SET STATISTICS TIME OFF
 
 
´´½¨Ë÷Òý£ºCRE ......

javaÓësql server 2005µÄÏà¹Ø²Ù×÷

//±¾³ÌÐòÁ¬½ÓµÄÊÇsql server 2005£¬ÓëÁ¬½Ósql server 2000Óе㲻ͬ£ºdriverNameºÍURL¶¼²»Í¬
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class create{
   public void getConnection() th ......

ORACLE·ÖÒ³²éѯSQLÓï·¨


--1:ÎÞORDER BYÅÅÐòµÄд·¨¡£(ЧÂÊ×î¸ß) ­
--(¾­¹ý²âÊÔ£¬´Ë·½·¨³É±¾×îµÍ£¬Ö»Ç¶Ì×Ò»²ã£¬ËÙ¶È×î¿ì£¡¼´Ê¹²éѯµÄÊý¾ÝÁ¿ÔÙ´ó£¬Ò²¼¸ºõ²»ÊÜÓ°Ï죬ËÙ¶ÈÒÀÈ»£¡) ­
SELECT * ­
  from (Select ROWNUM AS ROWNO, T.* ­
           from k_task T &s ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ