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
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 '), ('
A few days ago found that the site's query a bit abnormal, in general, will first query the contents of a directory, click a table of contents will be queried after the level two directory. Until the bottom of the query to the file. But these days
i): Definition of view
A view is a virtual table defined by a query based on one or more tables, which saves the specific definition of the query, and the view contains no data.
The view has no difference in operation from the datasheet, but the
Today, use the example to summarize the usage of group by.
Sum up: Group By:all, Cube,rollup,compute,compute by
Create a data script
Create Table Salesinfo(ctiy nvarchar (50),OrderDate datetime,OrderID int)
INSERT INTO SalesinfoSelect N '
The first is the way to add a datasheet to a partitioned table:
[dbo]. [Sp_helper_partition_add]
@SrcTable nvarchar (256), table to be added
@DestTable nvarchar (256), target table
@idxOnDest nvarchar (1024), index creation statement on the target
Give an example to specify:There are two table SourceTable for the landing table, targettable for authorization table, if the access user in the landing table, Update authorization table authorization level, otherwise authorized 0 for visitors. The
By experience, this is an index fragmentation problem. Check the index fragment DBCC SHOWCONTIG (table) and get the following results: DBCC Showcontig is scanning the ' A ' table ...Table: ' A ' (884198200); index id:1, Database id:13A TABLE-level
An instance of SQL Server is given below, and the following SQL runs under 2008 environments:
DECLARE @g Geography;
SET @g = Geography::P arse (' LINESTRING (-122.360 47.656,-122.343 47.656) ');
SELECT @g;
SELECT @g.tostring ();
The result set
Encountered error: A cursor with thename ' already exists, want to see what code is causing. Find the following methods.
--Test declaration cursor and open
DECLARE vend_cursor cursor for
SELECT * Frompurchasing.vendor
open Vend_cursor
FETCH
Nonclustered index, this is a very familiar thing, sometimes we for business reasons, SQL write very complex, need to join a lot of tables, and then burst into tears ... At this time there is a DBA or Senior developer to show you this wretched SQL,
Regular backups of the SQL Server database are often required. Regular backup to this machine, or quite easy, planning tasks can be completed, but if the machine is hung, that backup to this machine is meaningless, then you need to consider backup
If our statement is:
IF not EXISTS (SELECT 1 from sys.views WHERE name= ' report_individualticket ')
BEGIN
CREATE View Report_ Individualticket
as
SELECT ticket.ticketnumber, Ticket.ticketid,
gisprocess.stagename,
Content.dtreceived, Content.
In and exists these two functions are similar, but because the optimization scheme is different, the not exists is usually faster than not, because the not exists can use the binding algorithm two not in, and the exists is not as fast as in, Because
In recent days, the company's technical maintenance staff frequently let me restore the database, because they are always less where conditions, resulting in the update, delete the consequences of unrecoverable, plus those libraries are dozens of G.
By the old colleague of the past, in the blog post this script:
exec sp_configure ' show advanced options ', 1
Reconfigure
exec sp_configure ' Ad Hoc distributed Queries ', 1
Reconfigure
SELECT * into Tmp_asset
From OPENROWSET ('
Several key points to address this problem are as follows:
1, this phenomenon will only appear in the NTFS file system.
2, by the NTFS file system access permissions caused.
The General manual solution is as follows:
1, Control Panel-> folder
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.