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
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
ÉèÖÃȨÏÞ
²»ÂÛÓû§»ò½ÇÉ«£¬¶¼ÊÇȨÏÞµÄÉèÖöÔÏó¡£³ýÁËÓ¦ÓóÌÐò½ÇÉ«½ÏÌØÊ⣬ÓëÆäËû½ÇÉ«¼°ÓÃ
»§ÓÐÏ໥ÅÅ³â¹ØÏµÍ⣬Êý¾Ý¿â½ÇÉ«¼°³ÉÔ±ÔÚȨÏ޵ĹØÏµÉϷdz£ÃÜÇС£Ò»¸öÓû§¿ÉÄÜͬʱÁ¥
ÊôÓÚ¶à¸öÊý¾Ý¿â½ÇÉ«£¬Ã¿Ò»½ÇÉ«ÓÖ¿ÉÓµÓв»Í¬È¨ÏÞ£¬´ËʱÓû§»ñȡʵ¼ÊȨÏÞµÄÔÔòÊÇ“²¢
¼¯”£¬³ý·ÇÓÐ deny£¨½ûÖ¹£©µÄÉèÖá£Èç½ÇÉ« A ½ ......
±êÇ©£ºÊý¾Ý·ÃÎÊ LINQ LINQ to SQL ²¿·Ö
ä¯ÀÀLINQ to SQL¹ØÏµ Á½¸ö¹ØÁªµÄ±í£º
& ......
/*Á½ÖÖ·½·¨µÄǰÌ᣺1.±¾µØ·þÎñÆ÷µÄsqlserver agent·þÎñ±£Ö¤´¦ÓÚÆô¶¯×´Ì¬
2.Ô¶³Ì¼ÆËã»ú£¨¼ÆËã»ú¹ÜÀíÀ½¨Á¢Ò»¸öÆÕͨȨÏÞÓû§£¬²¢ÎªÆä¼ÓÉÏÃÜÂ루ÀýÈçÓû§ÃûΪkyle£¬ÃÜÂëΪ1234£©£¬Í¬Ê±ÔÚÄÇ̨»úÆ÷µÄ·ÇϵͳÅÌÀィһ¸öÃûΪbackupµÄ¹²ÏíÎļþ¼Ð£¬ÎªÁ˰²È«ÁíÍâÉèÖÃÕ ......
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 ......