Viewing 15 posts - 5,041 through 5,055 (of 7,610 total)
I admit I can't imagine this type of proc being exposed to an external application or user. It seems much more internal to me, and thus the chance for...
June 11, 2015 at 9:03 am
Been busy today, but I think I've got the errors fixed now. I'm definitely not using XML and STUFF when a few simple functions will do. Just the...
June 10, 2015 at 4:40 pm
ALTER PROCEDURE sampleprocedure
@tablename AS varchar(4000),
@date AS date
AS
SET NOCOUNT ON;
DECLARE @query nvarchar(4000);
SET @query = 'SELECT * FROM ' +
...
June 10, 2015 at 3:40 pm
Put in a query hint to force a HASH join. I'd rely more on that than on an ARITHABORT setting.
June 10, 2015 at 3:32 pm
Lynn Pettis (6/10/2015)
ScottPletcher (6/10/2015)
ALTER PROCEDURE sampleprocedure
@tablename AS varchar(4000),
@date AS...
June 10, 2015 at 2:52 pm
Sorry, I was being lazy and didn't include checks for db name and schema:
ALTER PROCEDURE sampleprocedure
@tablename AS varchar(4000),
@date AS date
AS
SET NOCOUNT ON;
DECLARE...
June 10, 2015 at 2:40 pm
CREATE PROCEDURE sampleprocedure
@tablename AS varchar(4000),
@date AS date
AS
SET NOCOUNT ON;
DECLARE @query nvarchar(4000);
SET @query = 'SELECT * FROM ' + QUOTENAME(@tablename) +
...
June 10, 2015 at 2:09 pm
In the above sample, would there be an advantage to having indexes on the otherrefkey and refentrykey columns in MainTable?
No, except in perhaps extraordinarily rare cases.
As a secondary question, will...
June 10, 2015 at 11:54 am
DECLARE @MyVari varchar(20)
SELECT [ProductID]
,[prod].[Name]
,[ProductNumber]
,[MakeFlag]
,[FinishedGoodsFlag]
,[MyRow] = @MyVari
FROM [AdventureWorks2014].[Production].[Product] prod
INNER JOIN [Production].[ProductModel] Prodmod
ON prod.Name = Prodmod.name
WHERE @MyVari = Case When [Production].[Product].[MakeFlag] = 0
...
June 10, 2015 at 11:34 am
...
where o.person_id not in (select distinct person_id from #wch_have where person_id is not null )
...
June 8, 2015 at 3:50 pm
Ed Wagner (6/5/2015)
ScottPletcher (6/5/2015)
If they're always Mondays, why waste resources with table I/O at all? Very simple date arithmetic can tell you what the starting and ending dates are.
You...
June 5, 2015 at 11:29 am
If they're always Mondays, why waste resources with table I/O at all? Very simple date arithmetic can tell you what the starting and ending dates are.
June 5, 2015 at 9:54 am
You can't avoid blocking, and you don't want to. It is an integral part of SQL's engine to maintain data integrity.
June 5, 2015 at 9:48 am
Is there some reason you want to use multiple queries? One query can do this just fine. I've properly clustered the table to match lookup requirements.
DECLARE @MyTable AS...
June 5, 2015 at 9:45 am
It's my understanding that modern VINs are indeed unique. The year byte in the VIN code is reused every thirty years, but the 17-digit combination will still be unique.
Btw,...
June 4, 2015 at 2:20 pm
Viewing 15 posts - 5,041 through 5,055 (of 7,610 total)