Viewing 15 posts - 376 through 390 (of 1,347 total)
>>Do I have to type in a database name as well? inorder to connect to a specific database.
When you connect, you are automatically in the default database associated with your login on...
July 11, 2006 at 10:37 am
Select getdate() As DateWithTime,
dateadd(d, 0, datediff(d, 0, getdate())) As DateOnly
Result:
DateWithTime DateOnly
2006-07-11 07:51:52.353 2006-07-11 00:00:00.000
July 11, 2006 at 8:55 am
Don't force the server to perform type conversion from date to string & back again. Use this as teh default:
dateadd(d, 0, datediff(d, 0, getdate()))
July 10, 2006 at 5:03 pm
>>while running the Stored procedure
How are you "running" the stored procedure ? Via query analyser ? Via a scheduled agent job ?
How is the stored procedure calling the DTS packages...
July 10, 2006 at 3:38 pm
Update t2
Set LetterColumn = t1.LetterColumn
From Table2 As t2
Inner Join Table1 As t1
On (t1.NumberColumn = t2.NumberCOlumn)
June 30, 2006 at 12:54 pm
Columns of datatype timestamp are maintained by the system and shouldn't be in your INSERT column list. The error is telling you that you're trying to insert an explicit value...
June 30, 2006 at 12:33 pm
UPDATE D
SET LicenseStateDifferent =
CASE WHEN P.State IS NULL THEN 'Y' ELSE 'N' END
FROM Drivers As D
LEFT JOIN Policy As P
ON ( D.Id = P.Id AND
(D.State = P.State...
June 30, 2006 at 12:13 pm
declare @sRecipients varchar (255), @sSubject varchar (1024)
Declare @CountResult As int
Declare @EmailBody As varchar(500)
SET @sRecipients = 'sqlserver@domain.com';
SET @sSubject = 'TestCount';
SELECT @CountResult = count(TypeCd)
from table1...
June 30, 2006 at 12:05 pm
If you have an expression generating a column in the resultset, and you need to GROUP BY the expression, you need to replicate all the code for the expression.
An alternative...
June 29, 2006 at 4:16 pm
>>When I said "remove the join" I actually meant to replace it with an extra search argument
By doing that, you are creating an entirely different scenario for the optimizer and...
June 29, 2006 at 3:09 pm
From Books Online:
UNION
Specifies that multiple result sets are to be combined and returned as a single result set.
ALL
Incorporates all rows into the results, including duplicates. If not specified,...
June 29, 2006 at 2:33 pm
>>and @CampaignID is retreived within the SP based on @UploadControlID, so yes it's local.
Why not take whatever query generates @CampaignID and make it a derived table that is joined to...
June 29, 2006 at 10:02 am
SELECT t1.OrgID
FROM YourTable As t1
WHERE NOT EXISTS (
SELECT *
FROM YourTable As t2
WHERE t1.OrgID = t2.OrgID
AND t2.RoleID = 2
)
June 28, 2006 at 2:08 pm
Select out of a derived table:
Select first, second, first + second
From
-- Create derived table within parentheses
(
Select 1 As first, 2 As second
From Yourtable
) dt
June 28, 2006 at 1:55 pm
Not enough info.
What is the source of the inserted rows ? A join of 2 or more tables ? Are there input parameters to the stored prcoedure that are used...
June 28, 2006 at 1:17 pm
Viewing 15 posts - 376 through 390 (of 1,347 total)