Viewing 15 posts - 16 through 30 (of 77 total)
Garadin's post points out why I like to put the Carriage Return/Line Feed into a variable constant rather than repeating it over and over. His last one is incorrect 🙂
DECLARE...
October 7, 2008 at 3:00 pm
Jeff Moden (10/4/2008)
Although it has worked very well in the present and in the past, I wonder if folks understand that Updating an alias is actually an undocumented feature? 😉
Nope,...
October 6, 2008 at 3:42 pm
It really depends on the situation. We do a lot of combined Update/Insert SPs to import data. We do this as the data we get is often mostly updates with...
October 3, 2008 at 8:03 pm
Actually Jeff,
I did think about that... And in fact our team is now doing a skunkworks project undertaking reading the dictionary from Erwin and putting it in the DB as...
October 3, 2008 at 7:49 pm
To me, this looks like a great place to use a common table expression.
Create the CTE with a union of all your left joined queries and then do a...
October 3, 2008 at 7:47 pm
Creating a unique index is NOT the same as creating a Primary key.
Change from doing this
CREATE INDEX [PK_ptPhysicalExam]
ON [dbo].[ptPhysicalExam] ([PEID] ASC)
to
ALTER TABLE dbo.ptPhysicalExam
ADD CONSTRAINT...
October 3, 2008 at 7:17 pm
Simple way is to use a cursor loop..
DECLARE @SQL nvarchar(512),
@C cursor
SET @C = CURSOR FOR
SELECT 'EXEC sp_dropextendedproperty
...
October 3, 2008 at 1:01 pm
As Gail stated, it represents the last statement run. Often with nested cursors you want to set the value to a local variable so that it doesn't get over written...
September 11, 2008 at 10:35 am
I initially wrote my import SPs to use a flag that was set to check existence and then called one SP for inserts and another one for updates. Ultimately it...
September 10, 2008 at 8:29 pm
That's what I get for not reading it 2 or three times I guess.
This is certainly where your tally table would work great. 🙂
September 10, 2008 at 5:56 pm
Over my carreer I have worked at several different companies. They all had different standards.
Here is what I currently try to do...
Rule 1: No spaces in object names, or field...
September 10, 2008 at 4:15 pm
Lets simplify this a little. If you only want the top 40 records... just use the following...
SELECT TOP 40 {fieldlist}
FROM Foo
September 10, 2008 at 3:11 pm
garethmann101 (9/8/2008)
I am building a website that will have many users, they must...
September 10, 2008 at 3:07 pm
Convert the image field to varbinary to do your comparison.
create table foo
(
img image
)
go
select *
from foo a, foo b
WHERE...
September 10, 2008 at 2:57 pm
It would perform better if you correlated the sub query or used a left join.
SELECT *
FROM dbo.service_type_dim std
WHERE std.service_type_code not in
(
SELECT DISTINCT...
September 10, 2008 at 2:48 pm
Viewing 15 posts - 16 through 30 (of 77 total)