Database diagrams cannot be viewed after attaching a database, and database diagrams cannot be established
My solution is as follows:
1, set the compatibility level is 90 (2005 is 90) (2000 is 80)
Copy Code code as follows:
Use
On this topic, I also see there are other ways to solve the Internet.
But in terms of performance and code, I have a better idea.
Here to share with you.
The principle is actually very simple,
Knowledge 1, Length function len ();
Knowledge 2, or the
The code is as follows:
Copy Code code as follows:
Use [tempdb]
Go
/****** object:userdefinedfunction [dbo]. [Fun_getpy] Script date:05/23/2012 18:03:45 ******/
SET ANSI_NULLS on
Go
SET QUOTED_IDENTIFIER ON
Go
/*
Get the first
Most people know that OLE DB is used to read data to a dataset, but how to deal with a dataset after reading is strange. Many people use loops to splice SQL, which is not only error-prone but inefficient, System.Data.SqlClient.SqlBulkCopy is still
Once the hacker gets the Webshell, the hacker knows your SQL Server administrator password, and if SQL Server is not securely set up then the hacker can easily claim and create a new system administrator account, then the hacker will be able to
If you use the Datename () function to get the full English name of the month, but the report needs it, just display the month name abbreviation.
The 12-month abbreviation, only May is the full name and abbreviation, the other month abbreviation
Therefore, the plan first inserts the data into a temporary table, and then analyzes the data for the temporary table.
The question point is how to create a temporary table dynamically. The original insus.net was implemented using the following code:
How to restore a backup from a backup device (Enterprise Manager)Restore a backup from a backup device
Expand the server group, and then expand the server.
Expand the Databases folder, right-click the database, point to All Tasks submenu, and then
1. Sub-query Concepts(1) is the query in the WHERE clause in the judgment based on the results of another query, so that constitutes an external query and an internal query, this internal query is from the query.(2) Self-query classification1
For a database to have more or less to master, the first basic SQL statements to understand. Here's a summary of some entry-level SQL statements.
Create related
Show Database; Show the existing databaseuse database_x; Now you want to use the
Copy Code code as follows:
--Create test table, insert data
CREATE TABLE Test (code varchar (), [values] varchar (a), [count] int)
INSERT Test SELECT ' 001 ', ' AA ', 1
UNION all SELECT ' 001 ', ' BB ', 2
UNION all SELECT ' 002 ', ' AAA ',
Copy Code code as follows:
--Set up data table CreateTable TestData
(
ID int Identity (1,1) primary key,
Data int,
Cola varchar (20),
Colb varchar (20)
)
Go
--Inserting test data
DECLARE @counts int
DECLARE @i int
Set @counts = 100
Through the interface design is able to manually operate, can not achieve my batch modification thousands of servers.
Because of this a foot would have been executed in bulk.
Environment: Redgate + MSSQL 2008 R2
The following code is used as a minor
Development often encounter the need for a variety of conditional combination of inquiries, such as three tables, Grade table grade (Gradeid,gradename), Class Class (Classid,classname,gradeid), Student table student (Stuid, STUNAME,CLASSID), now
A very powerful date format function in SQL Server:
Get current system time, GETDATE (): January 08, 2008 Tuesday 14:59
Select CONVERT (varchar), GETDATE (), 0): 2008 10:57am
Select CONVERT (varchar), GETDATE (), 1): 05/16/08
Select CONVERT
The first column is grouped by Goodsid and then sorted by Audittime in ascending order in the grouped records to show how many times a product has changed.
The second column is to take the last change price of the product Newprice, and then assign
SqlBulkCopy a given value of type String from a data source cannot be converted to the type nvarchar of the specified destination column.
Found on the Internet, mostly because the field in the database is too small (A given value of type String
Enterprise Manager does not change the database name function, if you must use Enterprise Manager to achieve, you can back up the database, and then restore, in the restore time can be specified another library name, and then delete the old library
Myth #9: Database file shrinkage does not affect performance
Error!
Shrinking a database file does not affect performance only if there is space left at the end of the file, and the TRUNCATEONLY option is specified in the shrink file.
The
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.