C ++ can import msado15.dll to operate SQL Server or access database. msado15.tlh and mmsado15.tli files are generated based on the parameters during import, these two files encapsulate the COM component class in msado15.dll in smart pointer.
For
Recently, SQL Server Express was used in the project. Unlike other SQL Server versions, SQL Server Express is a free database engine, but it is more powerful than access or SQL ce, after installation, an independent Database Engine service is
-- Column_name column name
-- Column_data_type
-- Max_length
-- The number of valid precision digits is similar to that of decimal.
-- Scale ratio
-- Whether is_nullable can be empty
--EMPIs the name of the queried table.
Select C. Name as
The table structure is as follows:Id int 4Entryid int 4Blogid int 4At the time of insertion, you are not allowed to insert records with the same entryid and blogid. That is, the two records in the table cannot have the same entryid and blogid.
To use the stored procedure in C #, first check the SQL statement for creating the test table:
Create Table Test55 ( UID Int Identity ( 1 , 1 ) , Class1 varchar ( 20 ) , Class2 varchar ( 20 ) , Uname varchar ( 20 ) , Birth
Analyze the cause of the error:
The gridview uses sqlsponse for Data Binding. When binding, the insert, delete, and update statements are generated, and the edit and delete functions are enabled. However, when running, click Edit, after you modify
InSQL ServerMedium,Global VariablesIs a special type of variable, the server will maintain the value of these variables. Global variables start with @ and do not need to be declared. They are system-defined functions. The following table lists some
1. Obtain the names of all user tables in the SQL Server database.
Obtain all user tables: (xtype: U User table; V view; P Stored Procedure)
SQL = "select ID, name from sysobjects where xtype = 'U' and name <> 'dtproperties' order by name"
1. @ identityReturns the last inserted id value. This variable is very useful. When you insert a row of data, you can use @ identity to obtain the ID (ID column) of the row at the same time.Example: In the following example, insert a row to a table
Generally, the database we construct has only two files, MDF file and LDF file. However, this has two disadvantages,
(1): files may be too large,
We know that the MDF file is a database file, which means that the MDF will increase accordingly as
Database optimization methods:
1. Create an index for the key fields.
2. Using Stored Procedures makes SQL more flexible and efficient.
3. Use as few cursors as possible.
4. Try to avoid repeating the relationship between the table and the table.
5.
Ident_current returns the last generated id value for any session and specific tables in any scope.
ExampleCode:
================================
Alter procedure [DBO]. [pr_test]@ TXT as varchar (100 ),@ Last as int outputAsBeginDeclare @ SQL
In SQL Server, the like keyword can be used for fuzzy query to determine whether a specific string matches the specified mode. The mode can contain regular characters and wildcards.
In SQLServerThe like keyword can be used to perform fuzzy
There is a recursion in the work that needs to be used in many places. I don't want to define every stored procedure, but the view cannot define variables, so I have to write them as functions.
Create Function [DBO]. [f_getdwdata](@ ID int)Returns
Reinstall the machine today and re-install SQL 2005. The following problems are encountered:
Solution for failing to execute the SQL Server System Configuration checker due to WMI Configuration
I searched the internet, but there were not many
1. Return: Exit unconditionally from the query or process. It can be used to exit from the process, batch processing, or statement block at any time. The statement after return is not executed. If it is used for stored procedures, return cannot
Import data in a fixed format from the TXT file to SQL Server.
Bulk
Insert Table Name
From
'
C: \ your local file. txt
'
With (Fieldterminator
=
'
What symbols are used to split data?
' , Rowterminator
=
'
End with \ n
' )
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.