Viewing 15 posts - 2,836 through 2,850 (of 7,614 total)
Maybe try CASTing to an explicit length?:
,CASE
WHEN T.[PD_ID] in (@Part)
THEN CAST('PD_ID_Match' AS varchar(30))
WHEN T.[Flat_PD_ID] in (@Part)
THEN CAST('FLAT_PD_ID_Match' AS varchar(30))
WHEN T.[Like_PD_ID] in (@Part)
THEN CAST('Like_PD_ID_Match' AS varchar(30))
WHEN T.[Flat_Like_PD_ID]...
April 29, 2019 at 5:53 pm
Off the top, just streamline it as much as you can:
BEGIN
RETURN (
SELECT product = CASE...
April 25, 2019 at 3:24 pm
What row was just FETCHed from, that is the row that SQL will delete, since that is the current position of the cursor.
April 24, 2019 at 6:58 pm
Don't force SQL to fully reprocess the conditions before DELETEing each row, instead use WHERE CURRENT OF in the DELETE:
DECLARE @user VARCHAR(50)
DECLARE @role VARCHAR(50)
DECLARE db_cursor CURSOR LOCAL...
April 24, 2019 at 6:41 pm
;WITH
cteTally10 AS (
SELECT * FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) AS numbers(number)
),
cteTally100 AS (
SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) AS number
...
April 19, 2019 at 8:20 pm
FYI, just in case you care, I was able to get my code fully corrected.
April 18, 2019 at 8:33 pm
I personally wouldn't use "+2", as it's nebulous unless you already know what it's doing; instead, I'd use the actual base date. And, if you shift from Excel, the base...
April 18, 2019 at 6:51 pm
Under no circumstances should you use the actual SSN to link accounts. You might have to store the SSN in one place, but you sure don't have to store it...
April 18, 2019 at 4:40 pm
Sorry, I thought you only wanted it down to the minute based on your initial description
duration in terms of minutes
April 17, 2019 at 5:52 pm
SELECT SUM(DATEDIFF(MINUTE, '1899-12-30', duration)) AS duration_in_mins
April 17, 2019 at 4:39 pm
SELECT emailaddress, COUNT(DISTINCT emailID) AS emailID_Count
FROM ##myTable
GROUP BY emailaddress
HAVING COUNT(DISTINCT emailID) > 1
April 16, 2019 at 4:45 pm
Table "C" only has each unique Name and EIN combination only 1 time, no matter how many fiscal years or amounts it has. That't the whole point of the "C"...
April 15, 2019 at 9:14 pm
You can use either VALUES or SELECT, you can't combine them:
Insert into Cntrl.tbl_Entity_master
select distinct [Entity Name], [Entity EIN] from B
April 15, 2019 at 6:53 pm
Yep, just create another table.
CREATE TABLE dbo.Entity_master (
[Entity Name] nvarchar(60) NOT NULL, [Entity EIN] char(10) /*or whatever*/ NOT NULL,
CONSTRAINT Entity_master__PK PRIMARY KEY ( [Entity Name], [Entity EIN] )
)
April 15, 2019 at 6:41 pm
Itzik Ben-Gan books and/or videos.
Books will typically you a much more in-depth knowledge. If you'd rather just have an overview level of knowledge, then a video(s) would work.
April 15, 2019 at 6:13 pm
Viewing 15 posts - 2,836 through 2,850 (of 7,614 total)