Create proc p_test
@ Name varchar (20 ),
@ Rowcount int output
As
Begin
Select * From t_customer where name = @ name
Set @ rowcount = @ rowcount
End
Go
Bytes ----------------------------------------------------------------------------------------
--
Executereader executes the command to return the line. To improve performance, executereader uses the Stored Procedure Call Command of the transact-SQL sp_executesql system. Therefore, executereader may fail to achieve the expected results if it is
Databases are the most common in our development projects. databases are used for complex projects and simple projects as long as data operations (add, delete, modify, query) are involved. Of course, the types of databases used vary with project
Ec (2); [PDO configuration] 1. Make sure that the PHP version is 5.2.5 or above (mainly for 5.2.5 I used. For the first time I did not know 5.1.x, the result has been poor ~ _~) 2. in php. find the DynamicExtensions Extension Section in ini, remove
ThinkPHP learning-CURD operations (I) written in front
Learn ThinkPHP this week and record the learning diary. We should not only learn how to use TP, but also learn the TP framework from the source code.
The diary is written every day, but not
For a simple PHP problem, I want to obtain the number of affected rows in the database & nbsp; but how does $ row obtain the number of rows affected by the returned results in the implementation class? this is not a problem for beginners, this bend
Merge column values
Original: zhujian
Adapted from: AI xinjue Luo. Lu Hua (flowers bloom in ice and snow forests in the past 18 years)-12-16 Guangdong and Shenzhen
Table structure. The data is as follows:Id value-----------1 aa1 bb2 aaa2 bbb2
SQL Server uses logs to restore the database
A full backup + the latest log backup is required.
* -- Description:Report data changes in the primary database to the standby database in a timely manner.The data of the standby database can be used
This blog briefly introduces several types of queries commonly used in SQL Server and their usage methods.
1. Obtain a single value using the ExecuteScalar Method
The ExecuteScalar method is one of the SqlCommand class methods. It executes the query
Add, delete, modify, and query objects and Methods
Recently, I have been working with my friends on data centers. I am responsible for layer D. When I re-write sqlhelper, I found that the query operation uses the SqlDataAdapter object. I remember
Executescalar () returns the value of the first column of the first row, which is generally used to execute such queries.
Select count (*) from table
The returned type is object. If the database does not have any records, how can we determine?
identity) column, which is also called an auto-increment column. in SQL Server 2000, the identity column is defined by identity, the following is an example of a function related to getting the id value of the last inserted record
SQL Server, you
Ke leyi adopts the C #. Net Language for compiling and has powerful functions. You can use the SQL Server Connector class to efficiently and conveniently access the SQL database. Ke leyi contains three parts: execution of simple SQL statements,
Using system;
Using system. Data;
Using system. Data. sqlclient;
Using system. configuration;
Using system. Web;
Using system. Web. Security;
Using system. Web. UI;
Using system. Web. UI. webcontrols;
Using system. Web. UI. webcontrols.
Table A records the following:
Aid anum1 a200501112 a200501123 a200501134 a200501145 a20050115
Table B records the following:Bid bname1 20060324012 20060324023 20060324034 20060324048 2006032408The experiment is as follows:1. Left joinThe SQL
Select count (*) requires a full table scan to return the number of rows in the table. This is a very time-consuming operation for a table with a large data size.
To obtain the number of all rows in a table, consider the alternative solution
SQL replace into usage
Replace runs like insert. There is only one exception. Assume that an old record in the table and a record used for primary
If the new record of a key or unique index has the same value, the old record is deleted before the
------ Convert decimal to eighteen bytes
Create Function f_int18 (@ num INT)
Returns nvarchar (50)
As
Begin
If @ num = 0
Return '0'
Declare @ s nvarchar (50)
Set @ s =''
While @ num> 0
Select @ s = substring ('0123456789abcdefhg ', @ num % 18 + 1, 1)
Table A records the following:
Aid anum
1 a20050111
2 a20050112
3 a20050113
4 a20050114
5 a20050115
Table B records the following:Bid bname1 20060324012 20060324023 20060324034 20060324048 2006032408The experiment is as follows:1. Left joinThe SQL
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.