1) if the default sorting rules of the database are not related to Chinese characters, the database may not accept any Chinese characters, and the input and output are directly garbled.Change the location of the default sorting rule: Database
Create trigger updateuserroletouserloginon tb_userrolefor insertasbegin update tb_userlogin set roleid = T. roleid from tb_userlogin tend
AboveCodeThe simple meaning is:
When data is inserted in the tb_userrole table, the value of the roleid
The requirement raised by a group of friends is very simple, that is, grouping statistics.
One Table tb_visit
Guid visitdate visitcount
No. access times
The requirement is that the number of visits can be calculated by year, month, or year,
-- Create view myview as select Re = rand () -- custom function: Get the random number of the specified range create function mydata (@ A int, @ B INT) returns decimal) as begin declare @ r decimal (38,0) Select @ r = cast (Re * (@ B-@ A) + @ A as
A subquery is a SELECT statement embedded in other SQL statements. It is also called a nested query.
Each subquery statement is a SELECT statement, so it has a return value.
The returned value can be in the following three cases:
① Single value
② A
There are two ways to back up SQL Server databases: one is to back up database files using backup database, and the other is to directly copy the database files MDF and log files LDF. The following describes the backup and recovery of the latter.
Advanced queries are most frequently used in databases and are also the most widely used.
Ø basic common Query
-- Selectselect * from student; -- all queries all select all sex from student; -- distinct filters duplicate select distinct sex from
Skillful Use of various SQL server usage will bring a lot of convenience to the query. Let's introduce T and intersect today. Note that this syntax is only supported in SQL Server 2005 and later versions.
Exist T refers to the data that exists in
How to Write net functions and stored procedures in SQL Server
Create a project> database project> Microsoft sqlserver> SQL clr> SQL Server Project
Add new class sqlclr. CS
Public sealed class sqlclr {// Regular Expression matching function
Programs that use SQL Server to save imagesIntroduction:This article is about saving and reading images from SQL servers using. net.Tools used:SQL Server 2000Microsoft. netversion 1.1C # (Windows Forms Based Application)Save image:Creating a table
. Scope_identity () is absolutely reliable and can be used in the stored procedure, even the trigger does not need to be created, without concurrency conflicts.Select ident_current ('tablename') -- returns the last tag value generated in the
The program robust control is added for some code snippets on the Internet.
The front-end interface is as follows:
No title page
Background code:
Using system;Using system. configuration;Using system. Data;Using system. Web;Using system. Web.
I believe that anyone who has used SQL server will have this experience. When we attach an SQL Server database, the append will fail, or the database will be read-only after the append is successful.
This may also cause the failure to automatically
Recently, a business website launched by the company was attacked by hackers. through SQL injection, the trojan was injected into the database, and the whole MSSQL Server
All the data is appended with malicious scripts. Recently, I found a batch
Obtain the hours of the current time in SQL:
select ltrim(datepart(hh,getdate()));
Problem conditions:
If the current time is before 8 hours, the accumulated rainfall after 8 hours of yesterday is used. If the time is after 8 days, the data is
On the basis of the database created in the previous article, we will continue to create data tables.
The syntax for the T-SQL to create a database is as follows:
Create TableTable Name
(
Field name 1 data type constraints,
Field name 1
What is a view?
As we all know, our country is now "God 7. From the moon landing in the United States, the heavens are no longer mythical. It is said that in the United States, you only need to pay a few hundred thousand dollars to make a space
SQL Server 2000 or components | Operating System Requirements
1>. Enterprise Edition and Standard Edition
Windows Server 2003, Standard Edition 1
Windows Server 2003, Enterprise Edition 1
Windows Server 2003, datacenter 1
Windows 2000 Server
Windows
You may ask ten questions about SQL Server development:
1. What are common name constraints for tables and fields?2. Is it possible to write a stored procedure without understanding the T-SQL?3. How to compare the performance of CLR Stored
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.