Viewing 15 posts - 76 through 90 (of 173 total)
Original post pretty sparse but here's a shot.
Start simple and work up, connect your people table to your upload table.
select *
FROM people p
RIGHT join upload1 u1 ON p.lastName = u1.lastName
...
November 20, 2007 at 11:34 am
OY! RTFPost...
only one table in a session can have the IDENTITY_INSERT property set to ON.
Running the set identity_insert in the sproc is residing in a different session.
October 25, 2007 at 3:05 pm
IDENTITY_INSERT can only be on for one table at a time. You are turning it on but never turning it off.
CREATE PROCEDURE usp_IdentityTest
AS
CREATE TABLE #table1(ID INT IDENTITY(1,1))
CREATE TABLE #table2(ID...
October 25, 2007 at 2:36 pm
This probably isn't the most efficient way but...
Create a date table (reasonable range)
weekdays (id, dayDate)
with only weekday dates.
FROM invc
inner join weekdays currDate on invc.mydate = currDate.dayDate --may need both at...
October 17, 2007 at 4:31 pm
I had a similar issue between script execution and sproc execution. Noticed the difference in the execution plans (query execution plan and profiler w/xml). Tweaked a...
October 16, 2007 at 9:25 am
Back when I was having a similar problem with a query in production taking an inordinate amount of time for the web site but not from the SSMS. (still...
October 15, 2007 at 4:19 pm
CREATE TABLE TableA
(RowID INT IDENTITY,
DocID int,
DocType varchar(15),
DocValue varchar(250)
)
INSERT INTO tableA (docID, docType, docValue)
SELECT 50,'FName','Mary' UNION ALL
SELECT 50,'LName','Jones' UNION ALL
SELECT 50,'EmpID','12345' UNION ALL
SELECT 62,'FName','John' UNION ALL
SELECT 62,'LName','Smith' UNION ALL
SELECT 71,'LName','Moore' UNION...
October 15, 2007 at 4:11 pm
Couple small items
a) remove the interesting case statements with a.* and test tempdb size
b) is nullif(expr1, '') = null more efficient then expr1 = ''?
August 30, 2007 at 4:14 pm
I was surprised that i could use # to alias a derived table. Looking into the execution times there was no difference (in time or plan). Further testing...
August 17, 2007 at 3:28 pm
from BOL
'
Use varchar(max) when the sizes of the column data entries vary considerably, and the size might exceed 8,000 bytes.'
Give it a shot
usage
Declare @EntryValue varchar(MAX) -- with the actual...
July 19, 2007 at 11:50 am
I haven't test this idea but...
DECLARE @RequestIDs varchar(MAX)
luck
Daryl
July 19, 2007 at 11:39 am
hmm. set all the variables so nicely above and then didn't replace
....
SELECT DATEADD(dd, (@aWeek - 1) * 7 + @aFridayOffset, @aJan1)
July 19, 2007 at 11:36 am
The code below should do the trick.. TSQL below not the actual function...
DECLARE @argYearWeek VARCHAR(6), @aWeek INT, @aJan1 DATETIME, @aFridayOffset int
SET @argYearWeek = '200733'
SET @aWeek = CAST(RIGHT(@argYearWeek,2) AS INT)
SET...
July 19, 2007 at 11:33 am
Not sure if this would fit your needs. Not an elegant solution... But it shouldn't be too much of a stretch to have some string manipulation to turn the...
July 18, 2007 at 4:05 pm
If you are using the SSMS...
right click [Databases] new database
in the new database wizard schroll to the right in the [Database files] area to the Path entry.
July 18, 2007 at 3:55 pm
Viewing 15 posts - 76 through 90 (of 173 total)