Performance Tuning for SQL Server | Brent Ozar Unlimited:
'via Blog this'
viernes, 21 de junio de 2013
viernes, 14 de junio de 2013
martes, 11 de junio de 2013
Best Practices + Table Partitioning: Merging Boundary Points | Brent Ozar Unlimited
Best Practices + Table Partitioning: Merging Boundary Points | Brent Ozar Unlimited: "Best Practices + Table Partitioning: Merging Boundary Points"
'via Blog this'
'via Blog this'
jueves, 30 de mayo de 2013
Data Encryption and Decryption in SQL Server 2008
Data Encryption and Decryption in SQL Server 2008: "CREATE CERTIFICATE can also load a certificate from a file or assembly."
'via Blog this'
'via Blog this'
martes, 28 de mayo de 2013
SQL Server Code Deployment Best Practices
SQL Server Code Deployment Best Practices: "SQL Server Code Deployment Best Practices"
'via Blog this'
'via Blog this'
lunes, 27 de mayo de 2013
martes, 21 de mayo de 2013
jueves, 16 de mayo de 2013
The database 'model' is marked RESTORING and is in a state that does not allow recovery to be run.Could not create tempdb. You may not have enough disk space available. Free additional disk space by deleting other files on the tempdb drive - Karthick PK 's Blog - Site Home - MSDN Blogs
The database 'model' is marked RESTORING and is in a state that does not allow recovery to be run.Could not create tempdb. You may not have enough disk space available. Free additional disk space by deleting other files on the tempdb drive - Karthick PK 's Blog - Site Home - MSDN Blogs: "Start SQLServer with Traceflag 3608,3609,-c,-f"
'via Blog this'
'via Blog this'
miércoles, 15 de mayo de 2013
Part 2: Resource Governor CPU Demo on multiple CPUs - SQL Server SQLOS team blog - Site Home - TechNet Blogs
Part 2: Resource Governor CPU Demo on multiple CPUs - SQL Server SQLOS team blog - Site Home - TechNet Blogs: "select scheduler_id, cpu_id, status, is_online from sys.dm_os_schedulers"
'via Blog this'
'via Blog this'
martes, 14 de mayo de 2013
lunes, 13 de mayo de 2013
SQL Consolidation Planning and recommended practices - Team blog of MCS @ Middle East and Africa - Site Home - TechNet Blogs
SQL Consolidation Planning and recommended practices - Team blog of MCS @ Middle East and Africa - Site Home - TechNet Blogs: "Consolidation strategies
SQL server consolidation can be achieved mainly through one of the below strategies:
Virtualization: using a single physical machine to host multiple virtual machines (VMs) running Microsoft® SQL Server® data management software
Multiple Instances: using a single machine to host multiple SQL Server instances,
Multiple databases: using a single instance of SQL Server to host multiple databases
Each of these strategies has different advantages and disadvantages related to security and compliance requirements, high availability and disaster recovery requirements, resource management benefits, level of consolidation density, and manageability tradeoffs"
'via Blog this'
SQL server consolidation can be achieved mainly through one of the below strategies:
Virtualization: using a single physical machine to host multiple virtual machines (VMs) running Microsoft® SQL Server® data management software
Multiple Instances: using a single machine to host multiple SQL Server instances,
Multiple databases: using a single instance of SQL Server to host multiple databases
Each of these strategies has different advantages and disadvantages related to security and compliance requirements, high availability and disaster recovery requirements, resource management benefits, level of consolidation density, and manageability tradeoffs"
'via Blog this'
Resource Governor Workload Management Scenarios
Resource Governor Workload Management Scenarios: "Monitor the Resource Governor performance counters and query the DMVs that will return information about resource usage for a workload group."
'via Blog this'
'via Blog this'
domingo, 12 de mayo de 2013
Welcome to the World of SQLServer.........: Resource Governor: What, How to Configure and Monitor
Welcome to the World of SQLServer.........: Resource Governor: What, How to Configure and Monitor: "CREATE FUNCTION rgclassifier1() RETURNS SYSNAME
WITH SCHEMABINDING
AS
BEGIN
DECLARE @grp_name AS SYSNAME
IF (APP_NAME() = 'ME2ME')
SET @grp_Name = 'wrkgroupCritical'
ELSE if(App_name()='GKPRD')
set @grp_Name = 'wrkgroupCritical'
else if (App_name()='Kate_Audit')
set @grp_Name = 'wrkgroupCritical'
else
SET @grp_Name = 'wrkgroupNormal'
RETURN @grp_name
END;"
'via Blog this'
WITH SCHEMABINDING
AS
BEGIN
DECLARE @grp_name AS SYSNAME
IF (APP_NAME() = 'ME2ME')
SET @grp_Name = 'wrkgroupCritical'
ELSE if(App_name()='GKPRD')
set @grp_Name = 'wrkgroupCritical'
else if (App_name()='Kate_Audit')
set @grp_Name = 'wrkgroupCritical'
else
SET @grp_Name = 'wrkgroupNormal'
RETURN @grp_name
END;"
'via Blog this'
viernes, 10 de mayo de 2013
sql server 2008 - How to print out the query SQL text of a transaction by querying the "fn_dblog" or DBCC LOG('DataBaseName')? - Database Administrators Stack Exchange
miércoles, 8 de mayo de 2013
martes, 7 de mayo de 2013
lunes, 6 de mayo de 2013
Optimizing tempdb Performance
Optimizing tempdb Performance: "Note that a dual-core CPU is considered to be two CPUs."
'via Blog this'
'via Blog this'
miércoles, 1 de mayo de 2013
Sql Server 2005 – Twelve Tips For Optimizing Query Performance by Tony Wright | Business Application Development for Strategic Advantage Melbourne | Hazaa
Optimizing MERGE Statement Performance
Optimizing MERGE Statement Performance: "CREATE TABLE dbo.Stock (StockName nvarchar(50) PRIMARY KEY, Qty int CHECK (Qty > 0));
"
'via Blog this'
"
'via Blog this'
martes, 30 de abril de 2013
lunes, 29 de abril de 2013
martes, 23 de abril de 2013
domingo, 21 de abril de 2013
Sql Server 2005 – Twelve Tips For Optimizing Query Performance by Tony Wright | Business Application Development for Strategic Advantage Melbourne | Hazaa
sábado, 30 de marzo de 2013
Pattern Matching in Search Conditions
Pattern Matching in Search Conditions
Normalmente usamos LIKE con el símbolo % para indicar que nuestra búsqueda deberá coincidir hasta cierto punto.
El siguiente ejemplo
SELECT [EmployeeID]
,[LastName]
,[FirstName]
,[MiddleInitial]
,[SSN]
FROM [Employee]
WHERE LastName LIKE 'Ste%'
Retornará
EmployeeID LastName FirstName MiddleInitial SSN
----------- ------------------------------ ----------------------------- ------------- -----------
1 Stein Nidprxmvtyjnat 123-07-9951
14 Stein Qfgakkjblwfbkb 763-07-9431
27 Stein Ysscitlqms 590-07-8911
40 Stein Txhqy 437-07-8391
Pero el signo % no es el único que podemos usar. SQL server incluye los siguientes comodines.
Wildcard
|
Comportamiento
|
---|---|
%
|
Cualquier string de cero o más caracteres.
|
_
|
Un caracter solamente.
|
[ ]
|
Un rango.
|
[^]
|
Un caracter que no este dentro del rango
|
En la siguiente condición SSN deberá no iniciarse con "1", en la siguiente posición deberá existir un número comprendido entre 0 y 9, la tercera posición deberá ser un número comprendido entre 4 y 8, en las siguientes 4 posiciones podrá ser cualquier cosa, pero a continuación deberá ser solamente un "9", el resto no nos interesa.
SELECT [EmployeeID]
,[LastName]
,[FirstName]
,[MiddleInitial]
,[SSN]
FROM [Employee]
WHERE SSN LIKE '[^1][0-9][4-8]____9%'
Este será el resultado
EmployeeID LastName FirstName MiddleInitial SSN
----------- ------------------------------ ----------------------------- ------------- -----------
2 Eflin Ysgphbplbhoksy 327-07-9911
7 Makai Lnudwgnbtoyvix 467-07-9711
24 Infante Raluqhoqtkd 967-07-9031
251 Stein Nidprxmvtyjnat 247-06-9951
255 Olphant Tqbigir 857-06-9791
Comparison Operators Modified by ANY, SOME, or ALL
Comparison Operators Modified by ANY, SOME, or ALL
El operador IN nos permite saber si un valor se encuentra en un conjunto de valores. Normalmente lo usamos en el WHERE.
Por ejemplo
SELECT [EmployeeID]
,[LastName]
,[FirstName]
,[MiddleInitial]
,[SSN]
FROM [Employee]
WHERE LastName IN ('Stein','Chen')
Nos retorna
EmployeeID LastName FirstName MiddleInitial SSN
----------- ------------------------------ ----------------------------- ------------- -----------
1 Stein Nidprxmvtyjnat 123-07-9951
4 Chen Mju 750-07-9831
14 Stein Qfgakkjblwfbkb 763-07-9431
17 Chen Jdjoemmumy 733-07-9311
27 Stein Ysscitlqms 590-07-8911
30 Chen Eyeqkrvwoewil 327-07-8791
Los otro operadores de conjuntos que provee SQL son ALL, SOME y ANY
ANY retorna verdadero si la comparación se cumple para alguno del conjunto. Es lo mismo que IN.
SELECT [EmployeeID]
,[LastName]
,[FirstName]
,[MiddleInitial]
,[SSN]
FROM [Employee]
WHERE LastName = ANY (
SELECT 'Stein'
UNION
SELECT 'Chen')
ALL retorna verdadero si la condición se cumple para todo el conjunto
En el siguiente ejemplo ALL retornará los menores a 4, ya que los mismos son menores a 4 y a 8
SELECT [EmployeeID]
,[LastName]
,[FirstName]
,[MiddleInitial]
,[SSN]
FROM [Employee]
WHERE EmployeeID <= ALL
(
SELECT 8
UNION
SELECT 4
)
EmployeeID LastName FirstName MiddleInitial SSN
----------- ------------------------------ ----------------------------- ------------- -----------
1 Stein Nidprxmvtyjnat 123-07-9951
2 Eflin Ysgphbplbhoksy 327-07-9911
3 Quint Ysoawvtycuwv 593-07-9871
4 Chen Mju 750-07-9831
(4 row(s) affected)
User with last access
User with last access
select name, updatedate , accdate, case when sysadmin = 1 then 'sa' else '' end as rol , lastProcessfrom syslogins lleft join (select loginame, max(last_batch) lastProcess from master..sysprocesses group by loginame) a on a.loginame = l.nameorder by lastprocess desc, accdate desc
Suscribirse a:
Entradas (Atom)