Viewing 15 posts - 1,306 through 1,320 (of 2,645 total)
I also realize that this post is really old but below is a script I put together that could be helpful to others running across this post. This...
November 18, 2019 at 10:49 pm
Regarding question #3, let's say I didn't have columns called "Installed" and "Date Received." I just put those in there to give examples of other fields. So I I...
November 18, 2019 at 2:08 am
November 18, 2019 at 1:11 am
I usually don't accept a method claimed to be "most efficient" without data to support. More importantly, I don't like your tone. Could you please not use words like...
November 17, 2019 at 5:54 pm
I think you need a new CycleParts table with two columns CycleId and PartId. You need 2 foreign keys on this table. One pointing to the Cycle table the other...
November 17, 2019 at 4:41 pm
this is a very typical leading zero problem. I listed the following five ways doing this. Method 5 is the shortest one. Google may provide more hints.
Why on Earth...
November 17, 2019 at 4:01 pm
First I would try adding this index to table CommoditySupplier:
CREATE INDEX IX_CommoditySupplier_CommodityID_INC_SupplierID
ON CommoditySupplier(CommodityID) INCLUDE (SupplierID);
If that doesn't...
November 15, 2019 at 11:00 pm
SELECT STUFF('00000', 5, 1, '1');
00001
SELECT STUFF('00000', 4, 2, '12');
00012
SELECT STUFF('00000', 3, 3, '698');
00698
lol, I take it that is a joke?
November 15, 2019 at 5:04 pm
declare @i as int=16
select right('00000'+convert(varchar,@i),5)
November 15, 2019 at 4:34 pm
Why have you posted this in SQL 2017 when it's for SQL 2014? What do you mean by getting struck? Did you mean stuck? What are you trying to do?...
November 15, 2019 at 2:04 pm
One other thing it could be is missing indexes, the additional I/O load on the disk can cause high CPU. Have you checked the activity of the disks while you...
November 15, 2019 at 12:18 pm
It can also make life easier for developers if all the primary keys are integers, it's a bit like having a design pattern that will make coding faster and more...
November 14, 2019 at 3:49 pm
Just a thought, but instead of
IF NOT EXISTS(SELECT * ... or IF EXISTS(SELECT * ... , why not use Top 1? all you need to know is only 1...
November 14, 2019 at 3:27 pm
I think you mean "surrogate" key, as there is no identity column on your table. I would use a surrogate identity column as the PK so create the table like...
November 14, 2019 at 3:23 pm
Performance Tip: The conditional behavior described for the MERGE statement works best when the two tables have a complex mixture of matching characteristics. For example, inserting a row if it doesn't...
November 14, 2019 at 2:44 pm
Viewing 15 posts - 1,306 through 1,320 (of 2,645 total)