Label:--If the field does not have a default value, execute the following statement directly, adding the default value:ALTER TABLE name add default (1) for field name-If you have a default value, now you want to change the default value, you need to drop the original default value before adding a new default valueALTER TABLE table name DROP constraint default value constraint name--If you do not know the name of the default constraint, query with the following statement:SELECT [Name]From sysobje
Label: Modifying existing field properties in a tableALTER Table Table NameALTER COLUMN field name varchar (500)
--SQL Server builds a table table when you set the default value for the CREATE TABLE table (IDint, name varchar (Ten)default 'Zhang San', ageint)
--set the default value of a field when you add a field ALTER TABLE table add sexChar(2)default 'male'--set default values for existing fields
', @level0Name =n ' dbo ', @level1type = N ' table ', @level1name = N ' Data ' --Add comments to the view with extended attributesEXEC Sys.sp_addextendedproperty@name = N ' view comment ', @value =n ' This is an example of a view annotation. ', @level0type = N ' schema ', @level0Name =n ' dbo ', @level1type = N ' View ', @level1name = N ' View_show_chineselanguage ' --add annotations to stored procedures with extended attributesEXEC Sys.sp_addextendedproperty@name = N ' stored procedure comment
Compilations/sec;sql re-compilations/sec The number of requests, compilations, and recompilation per second that are optimized for reference.5.2 Lock waits the number of processes waiting for the lock.5.3 Log write waits number of processes waiting to be written to the log cacheThe 5.4 page IO latch waits statistics related to page I/O latches. Used to determine the bottleneck of memory or disk5.5 page latch Waits statistics related to page latches (
Label:Modify field length Syntax: ALTER TABLE ALTER TABLE Loaneeexpand ALTER COLUMN pro_series varchar (50) --添加带默认值的字段 AlterTabletmpTableAddNewintDefault1--修改该字段,必须先删除 默认值约束 Alter TabletmpTableDropConstraintDF__tmpTable__New__7D79703E--修改字段类型 AlterTabletmpTableAlterColumnNewbigint--字段重命名 Execsp_rename‘tmpTable.New‘,‘Big‘,‘Column‘--删除字段 AlterTabletmpTableDropColumnBigsyntax for SQL to modify field lengths: ALTER TABLE name modify field type; Example
Dede SQL query about custom properties
Self added a custom attribute flag inside adds a W
$sql = "SELECT * from ps_archives a,ps_addonarticle b where a.channel= ' 1 ' and A.id=b.aid and A.typeid in (SELECT ID from ps_a Rctype where Topid in (1,22,26)) and a.flag like '%w% ' ";
The data can be queried, but not written in {dede:php}{/dede:php}.
Replace W with
The Design view of access has a good feature-----design column annotations, which allows the designer to see clearly the meaning of each column. The general SQL Server does not have this function when building a table, but he has extended properties, this function is also good, you can write the comments here, and then the corresponding results as RS back to the page to apply
I think it might be useful to d
Access|server| Show | Page Access's Design view has a good feature-----design column annotations, which allows the designer to see clearly the meaning of each column. The general SQL Server does not have this function when building a table, but he has extended properties, this function is also good, you can write the comments here, and then the corresponding results as RS back to the page to apply
I think i
A case was encountered today: The following error message appears when you right-click a property of a database:Property owner is not available for database XXX, the object may not have this property, or it may be insufficient access to retrieve.The owner of the database was found to be null when the script was used to view the owner. The reason is because the owner of the database is a system administrator's account, because the colleague left, the system administrator took the account cleared,
The description of Extended properties in SQL Server Help is:The Extended Properties Sets or retrieves provider-specific connection information that cannot is explicitly desc Ribed through the property mechanism.The following actions are available for extended properties:
Copy Code code as follows:
EXEC
Tags: pad Enter cells val padding width 6.2 Rman ToolJava Commonly used in packages , classes, and classes, methods, and properties in packages
Common packages
java.io.*;java.util.*;java.lang.*;java.sql.*;java.text.*;java.awt.*;javax.swing.*;
package name
interface
class
method
properties
j
Data modeling after the creation of the corresponding database, in the development of programming often encounter a very troublesome thing, that is to write the table as the corresponding entity class, for the developer of a field of a field of the comparison, copy, paste ... This is a very crazy thing, and now specifically the corresponding script, has been tested in Oracle. The script is as follows:Select 'Private' ||DECODE (T.data_type,'VARCHAR2', 'String', 'CHAR',
Tags: style using strong SP on line BS size2014-10-13 10:32:12target : store Multi-valued propertiesanti-pattern : Create multiple columns. For example, a person has multiple phone numbers, landline numbers, mobile phone numbers and so on. 1, query: Multiple columns, query may have to use in, or more or;2, add, delete to ensure uniqueness, determine whether there are values: these are very troublesome;3. The number of columns in the field cannot be determined.how to recognize anti-patterns :
Label:The configuration file Applicationcontext.xml settings are as follows: Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/ Spring-beans-2.0.xsd "> Spring Connect Database Motion connection properties for MySQL, Oracle, and
1: Add a field to the tableAlter table [table name] add [column name] Type2: Delete FieldAlter table [table name] Drop column [column name]3: Modify the field type in the table (you can modify the type of the column, whether it is empty)ALTER TABLE [table name] ALTER COLUMN [column name] Type4: Add primary keyAlter table [table name] add constraint [constraint name] primary KEY ([column name])5: Add UNIQUE ConstraintAlter table [table name] add constraint [constraint name] Unique ([column name])
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.