DECLARE @BeginTime as DATETIME
DECLARE @EndTime as DATETIME
DECLARE @Hour as INT
DECLARE @Min as INT
SET @Min = DATEPART (Minute, GETDATE ())
IF @Min
BEGIN
SET @BeginTime = CONVERT (VARCHAR (), GETDATE (), () + ' + CAST (DATEPART (Hour,
To create an index on a table in SQL Server
#!/usr/bin/perl
Use DBI;
Use Switch;
Use Encode;
Use ENCODE::CN;
# my $source _name = "Zoe";
# my $source _user_name = "sa";
# my $source _user_psd = "123";
# my $db _name= "MySQLdb";
# my
Restore Database
Enterprise Manager
--Right Key "database"
--All Tasks
--Restore Database
--"Revert to Database Library" to enter the restored database name
--Restore Select "From Device"--Select device--add--Add your backup file--OK, back to
This article focuses on SQL Server 2005 maintenance plans that cannot be removed (SQL Server maintnance plan can not delete), and the following is full text:
A database to change the IP and host name, only the database instance modified, forget to
When users change the table structure in SQL Server 2008 Enterprise Manager, they must first delete the original table.
You can then re-create the new table to complete the changes to the table, and the following prompts appear if you force the
Windows Server 2008 R2 MS SQL Server 2008 R2 the database is running correctly before the Active Directory is installed. When the Active Directory is installed, the database is prompted to fail to start when it is started. The error message is also
Add Field
ALTER TABLE DOCDSP add Dspcode char (200)
Delete a field
ALTER TABLE table_name DROP COLUMN column_name
Modify a field type
ALTER TABLE table_name ALTER COLUMN COLUMN_NAME NEW_DATA_TYPE
Renamed
sp_rename
Changes the name of a
SQL Server 1069 error (Failed to start service due to logon failure) workaround
1. My Computer--control Panel--management tools--services--right key mssqlserver--properties--landing--Landing identity--Select "Local System Account"
2. My
server| problem
First, the patch installation process frequently asked questions
If you encounter a similar error when installing a patch:
1, during the installation process, "the previous program created a pending file operation, you must restart
server| detailed
Cube operatorTo use the cube, you first need to understand the group byIn fact, the difference between cube and rollup is not very large, but there is a difference between the possible combinations of creating and summarizing
server| Browser Reprint from the foreigner.
Very cool, just modify a few parameters on it, very helpful
var connstr= "Dsn=admin"; //
var userlogin= "SA"; Input empty Login and Password,
var userpassword= ""; If your DSN works via WinNT Trust
server| upload Need a adodb.connection, connect user name need sysadmin authority, first RadioButton need xp_cmdshell support, second \ Three need WSH support, When used, it adjusts itself as a result of the restrictions on the server. Example of a
I think the SQL database keyword is not commonly used in comparison will forget, but the flexible application of the data table is very important, so here to summarize some!First, commonly used keywordsALTER TABLE (modify tables) is used to add,
Recently modified the database table structure, the data synchronization problem, found that a lot of data has been modified, but filtered through the view or the original data, so suspect should be the view cache data, in the garden to find the
SQL 2012 and 20,081, you can do a maintenance plan to automatically backup the database.Now for a database maintenance plan, make a differential backup of the database at 0 points per day, make a full backup of the database every Sunday 0 o'clock,
SQL Server row and column transformation hidden groupPivot has a hidden group group, except for pivot column and value column, and other columns as groupingsExample:IF not EXISTS (SELECT * from sys.tables where name = ' Pivot_test ')CREATE TABLE
Today, the unit of an ASP, there is a function is exported data, found an export error, error content is: SQL Server blocked the component'Ad Hoc Distributed Queries'The STATEMENT'Openrowset/opendatasource'Access, because this component has been
Starting with SQL 2012, Microsoft has made a cache mechanism to make insert auto increment faster.Although this mechanism is good, but also has the troublesome situation, if your SQL suddenly restart, then this cache losesThis time causes your SQL
This article belongs to the managing SQL Server AlwaysOn series articleObjective:The previous series has covered SQL Server AlwaysOn knowledge points, installation demos, and considerations. But this is not the end, but more is the starting point.
The method used to determine whether a table or column does not exist in SQL Server.
1. How to determine whether a Column exists in the Table in SQL Server
First, I would like to share with you two methods for determining whether a Column exists in
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.