In many cases, after too many SQL Server logins, the login name is different from the original password, that is, the logon password is incorrect and you can only re-enter the password, while some passwords are randomly generated strings, it is hard
"10 minutes to learn SQL Server T-SQL tutorial" (Chinese title: "SQL Server programming must know") This book is suitable for the use of SQL Server 2000/2005 databaseProgramClerk, I am reading slowly: I read five chapters with a cup of tea. There
Sqlserver 2005 uses 'sqlserver Authentication' to log on. The cause of the error is: 'user 'sa 'Login Failed. This user is not associated with a trusted SQL server connection. It takes only half a day to get it done on the internet today.
The
By default, if you try to use order by in subqueries, functions, and views,
Create ViewDBO. vsortedordersAsSelectOrderid, customeridFromDBO. OrdersOrder ByOrderidgo
The following error may occur:
Message 1033, Level 15,
Syntax: Set nocount {on | off}The default value is off.
When set nocount is off, return the count.
When set nocount is on, no count is returned (indicating the number of rows affected by the transact-SQL statement ).The @ rowcount function is
The system includes the following databases by default:
1. Master: It is composed of some system tables which track the system installation as a whole and other databases subsequently created. Although no database has a set of system directories
Format description:
Data Type
Description
Same meaning
Bit
1 bit; Value: 0 or 1
Int
Integer
4 bytes; value range:-2 ^ 31 ~ 2 ^ 31-1
Smallint
2 bytes; value range:-2 ^ 15 ~ 2 ^ 15-1
Tinyint
1 byte; value range: 0 ~ 255
Decimal (P, S)
Numeric data
Database Administrators familiar with SQL Server 2000 know that DTS can import and export data. In fact, we can also use Transact-SQL statements to import and export data. In a Transact-SQL statement, we mainly use the OpenDataSource function and
Select name + "," From syscolumns where object_name (ID) = 'equipment''Equipment' is the table name.
The output format is changed to text.
The result is as follows:Else ---------------------------------------------------------------------------------
From: http://www.builder.com.cn/2006/1224/347745.shtml
All information about the SQL Server database is stored in its system table. I doubt whether you have spent a lot of time checking system tables, because you are always busy with user tables.
SQL Server database Regular automatic backup []
In SQL Server, regular database backup is required for data security considerations. The backup database is generally performed in the early morning when there are basically no database operations, so
When I use SQL Server Profiler to track SQL statements, the following execution is always performed, and it will appear every few seconds. It is very annoying. After searching for half a day, I found that
The table in the reportserver database.
I was useless when I first started using SQL Server.Show execution planTo analyze the query. I have always thought that all the SQL queries I submitted are optimal, while ignoring the query performance, so I did not pay enough attention to the
When operating the database today, You need to convert the string to the decimal type. The Code is as follows:
Select cast ('0. 12' as decimal (18, 2 ));
Select convert (decimal (18, 2), '0. 12 ');
When you need to convert the numeric string of
Faster a full-text search
Now you're ready to actually do some searches. for these examples, I added a full-text index to the productname column in the northwind Products table. four T-SQL predicates are involved in full-text searching:
FREETEXT
-- Office 2003-- If the table to be imported already existsInsert into demotable select * fromOpenRowSet ('Microsoft. Jet. oledb.4.0 ', 'excel 5.0; HDR = yes; database = D: \ demo.xls', sheet1 $)-- If you import data and generate a tableSelect *
Create a new database accounting with the default configuration
Use master;GoCreate Database accounting;GoMethod 1: select database> F2 from the object Resource Manager on Microsoft SQL Server Management Studio (SSMs), or right-click Database>
For the sake of simplicity, suppose the following table:
Di1 Id2 myvalue
---------------------------
A x 2A x 1A y 2A y 1B x 3B y 2B y 2
Use the sum () function to aggregate the values of the third column:
Code highlighting produced by Actipro
Suppose you want to test the data in the production environment, such as modifying and testing the stored procedure, changing and optimizing the index. However, when you connect to the database, you cannot disconnect the database. How can I obtain
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.