Today I have a depressing question about the database table name.
The table name of a SQL Server database can begin with a number, but you cannot write the table name directly when you query, as follows:
SELECT *Form 1_tablename
In the course of
No nonsense, please read the detailed below.
Use Db_csharp
go
select *,
remark =case when
grade>=90 then ' excellent results ' when
grade=80 Then ' good grades ' when
grade=70 Then ' fail '
Else ' fail ' End from
Tb_grade
If
SQL Server bulk Export stored procedures
In Query Analyzer, select the database--right--"task"--"Generate script" from the pop-up menu--"Next"--"Select the database where you want to store the procedure--""Next"--check "stored Procedures" and next--
The examples in this article describe the common methods of SQL Server query for the first N records. Share to everyone for your reference. Specifically as follows:
SQL Server Query the first n records are the operations we often use, the following
In the database query, we sometimes have such a requirement, is to find the data table specified range of data records, such as to find the data table 10th to the 20th row of these 10 data, then how do we achieve it?
In the usual way, we have to
Table sysdatabases: Saving database information in a DBMS
Select [Name] from [sysdatabases] ORDER by [name]
You can get the database information in the DBMS.
Table sysobjects: Saving data table information in a database
Con. ChangeDatabase (dbname)
Reload MS SQL Server 20,001 needs to completely remove the original installation files, previously always unable to reinstall, the default is accounted for, and now online see the Special
Use the following methods to deal with installation suspend
If your hard disk space is small and you do not want to set the database log to be minimal (because you want other normal logs to still be logged), and high speed requirements, and clear all the data suggest you use Turncate table1, because truncate
According to the network situation, may reach 10 seconds of delay, that is, the main database added, deleted, updated content, generally in 10 seconds can be synchronized to the standby database.
Three-minute video operation demo at the bottom, don'
Many people look at the SQL statement waiting for the time is through the sys.dm_exec_requests view, waiting for the type is also through Wait_type, Sys.dm_os_waiting_tasks can see the session waiting so what is the difference? ....
No more
Package JSP;
Import java.sql.*; JDBC Package
public class Sql_data {
String url = "Jdbc:inetdae:192.168.2.70?sql7=true"; Use your hostname and port number
String login = "sa"; Use your Login
String password = ""; Use your password
Public Connection
1. Open MS SQL Server Enterprise Manager, SQL Server Group-management-database maintenance plan
-Right-click the new maintenance plan as shown below:
Next: Select the database you want to back up
Next:
Continue to the next step:
Next:
Recently help the Web site Management Server, found a SQL Server database was created D99_cmd, D99_tmp, D99_reg, site security has done a lot of, do not know where the problem, here to share the temporary solution
1, prohibit the creation of
The following are shown in the Illustrated form:
First, SQL Profiler
Event class Stored procedures\rpc:completed tsql\sql:batchcompleted
Event-critical Fields Eventsequence, EventClass, SPID, DatabaseName, Error, StartTime, TextData, HostName,
Today's article, I want to give you a brief description of how to set up random recordsets in SQL Server.
SELECT * from Person.person
-NEWID () go
This introduces a new uniqueidentifier data type column, where SQL Server does a physical
For example, data column name
Copy Code code as follows:
Name
A
B
C
D
The final result
Copy Code code as follows:
a*b*c*d*
Declare @test table (Namevarchar (10))Insert into @testvalues (' a '), ('
SELECT Ps.name as Psname,
Dds.destination_idas partitionnumber,
fg.name as Filegroupname,fg.name,
t.name ,
f.name as FileName from
(((sys.tables as T
INNER JOIN sys.indexes as I
(t.object_id = i.object_id))
inner join
The following trigger are used to monitor changes to stored procedures.To create a monitoring table:
CREATE TABLE auditstoredprocedures (
DatabaseName sysname
, objectname sysname
, LoginName sysname
, ChangeDate datetime
, eventtype sysname
,
The following cross apply and outer apply keywords in SQL Server are presented as follows:
1.CROSS Apply and outer apply
The MSDN explanation is as follows (personal understanding is not very clear):
Use the APPLY operator to call a table-valued
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service