Viewing 15 posts - 316 through 330 (of 2,007 total)
Why not use the system dmvs? e.g.
SELECT TOP 100 [Average IO] = (total_logical_reads + total_logical_writes) / qs.execution_count,
[Total IO] = (total_logical_reads + total_logical_writes), [Execution count] = qs.execution_count,
[Individual Query] =...
February 19, 2013 at 5:52 am
Could you do something like this?
IF object_id('s_sumar_s') IS NOT NULL
BEGIN
DROP TABLE s_sumar_s;
END;
CREATE TABLE s_sumar_s (
ID INT IDENTITY(1,1) NOT NULL,
faux_number VARCHAR(116) CONSTRAINT CK_faux_number CHECK (RIGHT('00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'+faux_number,116) LIKE...
February 19, 2013 at 5:41 am
Because nolock is not "go faster stripes" ? More seriously, probably because the nolock hint is performing a scan which needs to read more pages due to reading in...
February 19, 2013 at 4:50 am
You can fix the syntax like this: -
DECLARE @Dept AS INT
SET @Dept = 40
SELECT *
FROM plu_file_dates
WHERE pluid IN (SELECT pluid
...
February 19, 2013 at 4:36 am
In one sproc, maybe make use of Scope_identity()?
February 15, 2013 at 6:47 am
It'll potentially take some time: -
UPDATE yourTable
SET yourColumn = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
...
February 15, 2013 at 5:38 am
Sorry you feel that my reply was rude, it certainly wasn't intended to be. Terminology is often difficult on an international forum, something I try to take account of when...
February 15, 2013 at 4:30 am
Sample data: -
IF object_id('tempdb..#testEnvironment') IS NOT NULL
BEGIN
DROP TABLE #testEnvironment;
END;
SELECT ID, Name
INTO #testEnvironment
FROM (VALUES(1, 'Fred'),(2, 'Joe'),(3, 'Bob'))a(ID, Name);
Query: -
DECLARE @Delimitedlist VARCHAR(8000) = '1,3,2';
SELECT STUFF((SELECT ','+a.Name
...
February 14, 2013 at 4:58 am
This is not all that tricky, so rather than spoon feed you the answer I'm going to try and help you to arrive there on your own.
Firstly, it's always a...
February 14, 2013 at 4:42 am
JblakTSql (2/13/2013)
February 14, 2013 at 1:45 am
IF object_id('tempdb..#testEnvironment') IS NOT NULL
BEGIN
DROP TABLE #testEnvironment;
END;
SELECT CAST(dtDate AS DATETIME) AS dtDate, sDocIdPrefix, CNT
INTO #testEnvironment
FROM (SELECT '2013-02-11', 653, 3683 UNION ALL
...
February 13, 2013 at 8:50 am
So, the SQL Bits agenda has been released, anyone going? I'm planning on grabbing a Friday ticket tomorrow morning, but unsure about the Saturday.
February 13, 2013 at 8:10 am
anthony.green (2/13/2013)
February 13, 2013 at 6:20 am
Random guess: -
USE [IdealOffice_NSI_Live]
GO
DECLARE @RollNumber INT, @PDADate NVARCHAR(50), @Requiredby NVARCHAR(50), @UpdateDate1 DATETIME, @UpdateDate2 DATETIME,
@VisitDate NVARCHAR(10), @BookedDate NVARCHAR(30), @StatusUpdateDate NVARCHAR(30), @NewRefNum NVARCHAR(5), @OriginalRefNum NVARCHAR(5),
@ID UNIQUEIDENTIFIER, @status UNIQUEIDENTIFIER, @InspectorID SMALLINT,...
February 13, 2013 at 5:07 am
What does the original data look like? What is the DDL for the table?
February 13, 2013 at 2:52 am
Viewing 15 posts - 316 through 330 (of 2,007 total)