Summary of Row-to-column conversion problems-1. Row-to-column conversion (various problems in the forum will be sorted out later)
--- 1. Simplest row-to-column Conversion/*
Question: Suppose there is a student orders table (TB) as follows:Name course scoreZhang San Language 74James math 83Zhang San physical 93Li Si language 74Li Si mathematics 84Li Si physical 94
(The following result is displayed ):Name, Chinese, Mathematics, PhysicsLi Si 74 84 94Zhang San 74 83 93*/-- TestingIf object_id ('[TB
Summary of Row-to-column conversion problems-1. Row-to-column conversion (various problems in the forum will be sorted out later)
--- 1. Simplest row-to-column Conversion/*
Question: Suppose there is a student orders table (TB) as follows:Name course scoreZhang San Language 74James math 83Zhang San physical 93Li Si language 74Li Si mathematics 84Li Si physical 94
(The following result is displayed ):Name, Chinese, Mathematics, PhysicsLi Si 74 84 94Zhang San 74 83 93*/-- TestingIf object_id ('[TB
logical reading of the statistical principle: why the results displayed in the unit is not page, nor K or KB. Sql server When you do the reading and writing, you run to a specific piece of code. Each time this code is called, Reads/write will add 1. So this value is larger than That statement must have done a lot of I/O, but not by this value to calculate the absolute number of I/O, this value reflects the
)--datename gets the string for the specified part select Datename (Weekday, ' 2013-2-17 ') --Return Sunday (parameter weekday can be changed to day,year etc. date plus corresponding value)--day (), Month (), year () gets the string for the specified part select Day (' 2013-2-15 ')--return 15Convert Date conversion functionTime format conversion using convert:convert (data_type [(length)], expression [, style])Data_typeThe data types provided by the target system, including bigint and sql_varia
= DB_ID(@DatabaseName) AND SPId -- SELECT @SQL EXEC(@SQL) A very similar to the SQL code above, an other code block can be used by using the coalesce as shown below DECLARE @DatabaseName nvarchar(50) SET @DatabaseName = N‘Works‘ DECLARE @SQL varchar(max) SELECT @
memory pages optionOn the Start menu, click the Run submenu, and then in the Open box, type gpedit.msc.On the Group Policy console, expand Computer Configuration, and then expand Windows settings.Expand Security Settings, and then expand Local Policies.Select the User Rights Assignment check box.The policy appears in the details pane.In the details pane, double-click Lock Memory Pages.In the Local Security Policy Settings dialog box, click the Add button.In the Select Users or Groups dialog box
server| Stored Procedures
SQL Server writes stored procedure gadgetsFunction: Create an update stored procedure for a given tableSyntax: sp_genupdate Take the Northwind database as an exampleSp_genupdate ' Employees ', ' EmployeeID ', ' upd_employees '
Note: If you create this procedure in the Master System database, you can use the procedure in all databases on
Tags: blog c java tar http aRecently summarized the database paging SQL usually used in the project. You can post more efficient SQL statements with paging.SQL Server PagingThe first method of pagingParameters to be required:PageSize How many data are displayed per pagePageNumber pages coming from the clientTotal number of records in the Totalrecouds table select
MemToLeave is 384mb,buffer pool can reach 3.664G. If AWE is also turned on, this 3.664GB can be used for all stolen in the buffer pool, and the remaining memory can be used for the database page pages. This is rare, however, where 64-bit operating systems are used to install 32-bit-_-.64-bit SQL Server. All the memory is applied indefinitely and there is a need to apply.3. Analysis of
A small part
All
All
---------------Reprint Please specify the source------------http://www.cnblogs.com/double-K/p/5049417.html-------------------- Simply explain the memory of SQL, there are a few things to note also simple mention: 1.WINDOWS does not lack memory SQL will not lack of memory it? A: This is very wrong (1) if it is 32 bits,
');Select stuff (SELECT ';' + Name FROM [dbo]. [Books] for xml path (''), 1, 1 ,'');As shown in the following figure:Cross-Origin operations The code is as follows:Copy code -- Modify the title attribute based on the ID in the Books table and the XmlData ID attribute in the Xml_Table table.-- That is, MSSQLServer2005 is encoded according to The 0001 name in books.-- Modify the title to MSSQLServer2005 encoded as 0001 in the book of the Xml_Table table.Declare @ d
Basic ways to import/export Excel from SQL Server
/*=================== Import/Export Excel basic methods ===================*/
From the Excel file, import the data into the SQL database, very simply, using the following statement directly:
/*===================================================================*/
--If the table that accepts the data import alre
Server
Rich data types Richer-Types
1, varchar (max), nvarchar (max), and varbinary (max) data types can hold up to 2GB of data and can replace text, ntext, or image data types.CREATE TABLE myTable(ID INT,Content VARCHAR (MAX))
2.
Encryption in SQL Server is hierarchical, and each upper level provides protection under. As shown in figure:
Instance:/**SMK (Service Master Key) is generated during SQL Server installation and is protected by Windows DPAPI (Data Protection API)**/
/** CREATE DATABASE level DMK (db Master Key), protected by SMK **
a master data file, and the file name extension of the master data file is. mdf.• Secondary (secondary) data files: All other data files except the master data file are secondary data files, some databases may not contain any secondary data files, and some databases contain multiple secondary data files, and the file name extension for secondary data files is. ndf.• Transaction log file: Contains information that restores all transaction logs for the database. Each database must have at least o
,colid int,ctext varbinary (8000), encrypted int,status int)
Insert #temp SELECT number,colid,ctext,encrypted,status from syscomments WHERE id = object_id (@objectName)
Select @number =max (number) from #temp
Set @k=0
While @k= @number
Begin
if exists (select 1 from syscomments where id=object_id (@objectname) and number=@k)
Begin
If @type = ' P '
Set @sql1 = (case when @number >1 then ' ALTER PROCEDURE ' +
Label:You installed the new SQL Server with the Installation Wizard, and finally you clicked the Finish button. Wow Oh ~ ~ ~ Now we can put our server into production! Sorry, that's not true, because your new SQL Server default configuration is wrong. Yes, you're right: The
.
Copy Code code as follows:
Problems that may arise:
There's a syntax error near Max.
There is no Max in server2000, so it is recommended that you change the max in the SQL script to a very large number, such as 4000 (4000 seems to be the upper limit).
ODB problem
Other databases I don't know,
Server
Describes the following configuration settings and what to consider when using: • Similarity mask • Lightweight pool • Max asynchronous IO max number of worker threads • Memory • Priority promotion • Set working set size
SQL Server can achieve very advanced performanc
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.