Viewing 15 posts - 2,941 through 2,955 (of 3,233 total)
Of course, you could combine these 2 updates into one using a more complex case statement, but this should get you heading in the right direction.
declare @t table (Recreate_flag bit,...
April 12, 2006 at 9:18 am
The only way to make this work with one statement would be to use dynamic SQL; however, this does not mean, that from a maintenance perspective, that it would be...
April 11, 2006 at 4:51 pm
INSERT INTO t1 (CustID, CustType)
SELECT t2.CustID,
t2.CustType
FROM t2
LEFT JOIN t1
ON t1.CustID = t2.CustID and t1.CustType = t2.CustType
WHERE t1.CustID IS NULL and t1.CustType IS NULL
DELETE t1
FROM t1
LEFT JOIN t2
ON t1.CustID =...
April 11, 2006 at 3:17 pm
All of the solutions suggested will work based off of what you've posted as your requirements. Why do you think you need to have it all in one statement? You...
April 10, 2006 at 4:14 pm
I had the tables in my where clause transposed.
DELETE table1 FROM table1 t1
LEFT JOIN table2 t2
ON t1.custid = t2.custid
WHERE t2.custid IS NULL and t1.custtype = 'Employee'
If table...
April 10, 2006 at 3:51 pm
You've got a few options here, all of which will work. First, you can create dynamic SQL, which should be your last resort. Second, you can create separate SELECT statements, one...
April 10, 2006 at 2:17 pm
They both ensure that no duplicate values can be entered into a column (or set of columns), but there are differences in how they should be used. See UNIQUE Constraints...
April 10, 2006 at 11:30 am
You need an outer join on table1 and table2 using custID. Try this:
DELETE table1 FROM table1 t1
LEFT JOIN table2 t2
ON t1.custid = t2.custid
WHERE t1.custid IS NULL and t2.custtype...
April 10, 2006 at 10:18 am
This thread has been posted in 2 places.
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=21&messageid=271326&post=true
April 5, 2006 at 10:35 am
I do not have XML experience with T-SQL, but from what I can tell, you should be able to join your XML doc and treat it like a table, correct? ...
April 5, 2006 at 10:33 am
I think the installation message regarding your OS is telling you all you need to know. SQL Server will not install on your OS. It appears that the OS version...
April 4, 2006 at 3:15 pm
Books On-Line (SQL Server Help files). Yes, you will be able to use the sysfiles table in dynamic SQL.
April 4, 2006 at 10:28 am
select sCallDate as 'Date',
SUM(Case sProject when 'A' then dHours else 0 end) as 'Project A',
SUM(Case sProject when 'B' then dHours else 0 end) as 'Project B',
SUM(Case sProject when 'C' then...
April 3, 2006 at 11:21 am
Are you getting errors in your SQL Server logs? Have you run profiler/perfmon while this is happening? I would guess that the process gets to a point to where it...
March 31, 2006 at 2:10 pm
Viewing 15 posts - 2,941 through 2,955 (of 3,233 total)