SqlserverÓï¾ä´óÈ«
--Óï ¾ä¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¹¦ ÄÜ
--Êý¾Ý²Ù×÷
SELECT¡¡¡¡¡¡--´ÓÊý¾Ý¿â±íÖмìË÷Êý¾ÝÐкÍÁÐ
INSERT¡¡¡¡¡¡--ÏòÊý¾Ý¿â±íÌí¼ÓÐÂÊý¾ÝÐÐ
DELETE¡¡¡¡¡¡--´ÓÊý¾Ý¿â±íÖÐɾ³ýÊý¾ÝÐÐ
UPDATE¡¡¡¡¡¡--¸üÐÂÊý¾Ý¿â±íÖеÄÊý¾Ý
--Êý¾Ý¶¨Òå
CREATE TABLE¡¡¡¡--´´½¨Ò»¸öÊý¾Ý¿â±í
DROP TABLE¡¡¡¡ --´ÓÊý¾Ý¿âÖÐɾ³ý±í
ALTER TABLE¡¡¡¡ --ÐÞ¸ÄÊý¾Ý¿â±í½á¹¹
CREATE VIEW¡¡¡¡ --´´½¨Ò»¸öÊÓͼ
DROP VIEW¡¡¡¡ --´ÓÊý¾Ý¿âÖÐɾ³ýÊÓͼ
CREATE INDEX¡¡¡¡--ΪÊý¾Ý¿â±í´´½¨Ò»¸öË÷Òý
DROP INDEX¡¡¡¡ --´ÓÊý¾Ý¿âÖÐɾ³ýË÷Òý
CREATE PROCEDURE¡¡ --´´½¨Ò»¸ö´æ´¢¹ý³Ì
DROP PROCEDURE¡¡¡¡--´ÓÊý¾Ý¿âÖÐɾ³ý´æ´¢¹ý³Ì
CREATE TRIGGER¡¡¡¡--´´½¨Ò»¸ö´¥·¢Æ÷
DROP TRIGGER¡¡¡¡--´ÓÊý¾Ý¿âÖÐɾ³ý´¥·¢Æ÷
CREATE SCHEMA¡¡¡¡--ÏòÊý¾Ý¿âÌí¼ÓÒ»¸öÐÂģʽ
DROP SCHEMA¡¡¡¡ --´ÓÊý¾Ý¿âÖÐɾ³ýÒ»¸öģʽ
CREATE DOMAIN¡¡¡¡--´´½¨Ò»¸öÊý¾ÝÖµÓò
ALTER DOMAIN¡¡¡¡--¸Ä±äÓò¶¨Òå
DROP DOMAIN¡¡¡¡ --´ÓÊý¾Ý¿âÖÐɾ³ýÒ»¸öÓò
--Êý¾Ý¿ØÖÆ
GRANT¡¡¡¡¡¡--ÊÚÓèÓû§·ÃÎÊȨÏÞ
DENY¡¡¡¡¡¡--¾Ü¾øÓû§·ÃÎÊ
REVOKE¡¡¡¡¡¡--½â³ýÓû§·ÃÎÊȨÏÞ
--ÊÂÎñ¿ØÖÆ
COMMIT¡¡¡¡¡¡--½áÊøµ±Ç°ÊÂÎñ
ROLLBACK¡¡¡¡ --ÖÐÖ¹µ±Ç°ÊÂÎñ
SET TRANSACTION¡¡¡¡--¶¨Ò嵱ǰÊÂÎñÊý¾Ý·ÃÎÊÌØÕ÷
--³ÌÐò»¯SQL
DECLARE¡¡¡¡¡¡--Ϊ²éѯÉ趨Óαê
EXPLAN¡¡¡¡¡¡--Ϊ²éѯÃèÊöÊý¾Ý·ÃÎʼƻ®
OPEN¡¡¡¡¡¡--¼ìË÷²éѯ½á¹û´ò¿ªÒ»¸öÓαê
FETCH¡¡¡¡¡¡--¼ìË÷Ò»Ðвéѯ½á¹û
CLOSE¡¡¡¡¡¡--¹Ø±ÕÓαê close
PREPARE¡¡¡¡¡¡--Ϊ¶¯Ì¬Ö´ÐÐ×¼±¸SQL Óï¾ä
EXECUTE¡¡¡¡¡¡--¶¯Ì¬µØÖ´ÐÐSQL Óï¾ä
DESCRIBE¡¡¡¡ --ÃèÊö×¼±¸ºÃµÄ²éѯ
---¾Ö²¿±äÁ¿
declare @id char(10)
--set @id = ’10010001’
select @id = ’10010001’
---È«¾Ö±äÁ¿
---±ØÐëÒÔ@@¿ªÍ·
--IF ELSE
declare @x int @y int @z int
select @x = 1 @y = 2 @z=3
if @x > @y 
Ïà¹ØÎĵµ£º
Ò»¡¢Ö÷¼üÓë¾Û¼¯Ë÷Òý²¢²»ÊÇÒ»¶ÔһƥÅäµÄ
Ò»°ãÇé¿öÏÂÎÒÃǶ¼ÈÏΪ,¾Û¼¯Ë÷ÒýºÍÖ÷¼üÊÇÏ໥ƥÅäµÄ,ÒòΪֻҪÄãÔÚSQLServer±íÖж¨ÒåÁËÒ»¸öÖ÷¼ü,ÄÇôSQLServer»áΪÕâ¸öÖ÷¼ü×Ô¶¯Ìí¼Ó¾Û¼¯Ë÷Òý.µ«ÊÇ,Èç¹ûÄãÏÈÔÚ±íÖлùÓÚÈÎÒâÒ»Áн¨Á¢¾Û¼¯Ë÷Òý,È»ºóÔÙÑ¡ÔñÁíÒ»ÁÐ×÷ΪÖ÷¼ü,Õâʱ,Õâ¸öSQLServer½«»á»ùÓÚÕâ¸öÖ÷¼ü½¨Á¢Ò»¸öΨһ·Ç¾Û¼¯Ë÷Òý.
¶þ¡¢ ......
1.¾ø¶ÔÖµ
S:select abs(-1) value
O:select abs(-1) value from dual
2.È¡Õû(´ó)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.È¡Õû£¨Ð¡£©
S:select floor(-1.001) value
O:select floor(-1.001) value from dual
4.È ......
ÿ´Î´ò¿ªSQLServer²éѯ·ÖÎöÆ÷ºó£¬ÔÚÁ¬½Ó´°¿ÚÀïµÄSQLServer·þÎñÆ÷Ñ¡ÔñÏÂÀ¿òºÍµÇ¼Óû§ÃûÊäÈë¿òÀï¶¼»áÁôÓÐÀúÊ·µÇ¼µÄ¼Ç¼£¬ÓÐʱºòÎÒÃÇÊDz»Ï£ÍûÕâÑùµÄ£¬±ÈÈçÔÚÒ»¸ö·Ç˽ÓÐÁìµØ×öÁËÔÝʱµÄ¿ª·¢ºó£¬²»ÏëÁôÏÂÈκÎÁ¬½ÓÔ¶³ÌÊý¾Ý¿âµÄ¼Ç¼£¬ÈçºÎɾ³ýÄØ£¿»¹ÊÇ×¢²á±í£¬ÕÒµ½ÒÔÏ·¾¶£º
HKEY_CURRENT_USER\Software\Microsoft\Microsoft&n ......
In the latest installment of the SQL Server interview questions, we will outline questions suitable for a DBA interview to assess the candidates skills related to SQL Server system databases. In this tip, the questions are there to read, but the answers are intentionally hidden to really test your s ......
SqlServerÆô¶¯²ÎÊý
1.Sqlservr.exeÔËÐвÎÊý¡£
SqlServerµÄÆô¶¯¿ÉÒÔΪWindows·þÎñ·½Ê½£¨Ä¬ÈÏ£©£¬Ò²¿ÉÒÔÒÔÓ¦ÓóÌÐò·½Ê½Æô¶¯¡£ÏÂÃæ½éÉÜsqlservr.exeÒÔÓ¦ÓóÌÐò·½Ê½Æô¶¯Ê±µÄ²ÎÊýÎÊÌâ¡£
sqlservrÓ¦ÓóÌÐòÓ÷¨£º
sqlservr[-sinstance_name][-c][-dmaster_path][-f]
[-eerror_log_path][-lmaster_log_path][-m]
[-n][-Ttrace ......