Viewing 15 posts - 18,271 through 18,285 (of 18,926 total)
I tried the code in a stored proc and it returned the error as expected without any furter message. The problem comes when you try to return a value...
April 4, 2005 at 7:34 am
Now I understand why you have so many posts Frank... You type 2-3 responses when none or 1 could do .
April 4, 2005 at 7:25 am
You could always do something like this :
Select 'This is a tables "' + name + '" / id = ' + cast(id as varchar(10)) from dbo.SysObjects where XType...
April 4, 2005 at 7:22 am
Tried on my machine too. Looks like ms forbids you to do this as it could become some kind of infinte loop or something like that. Maybe someone...
April 4, 2005 at 6:27 am
Here's another thaught: the in clause will kill the performance because the whole list will be scanned untill a match is found. Since
where 1 in (3,1,2)
is the same...
April 1, 2005 at 10:37 pm
I also thaught of something similar but I didn't pursue it because I wanted a set based approach. This temp table solution would however be much faster than the...
April 1, 2005 at 10:27 pm
try running this... it works for me :
CREATE FUNCTION [dbo].[ufn_WeekdaysBetween]
(@StartDate datetime, @EndDate Datetime)
RETURNS int
AS
BEGIN
DECLARE @Day1 int
DECLARE @Day2 int
SET @Day1 = Datepart(dw, @StartDate)
SET @Day2 = Datepart(dw, @EndDate)
DECLARE @dSunday...
April 1, 2005 at 2:18 pm
Sorry but we don't see anything here.. can you just post the code and err message?
April 1, 2005 at 1:53 pm
IF EXISTS(SELECT User_ID FROM dbo.User_Information
WHERE First_Name = @FirstName AND Last_Name = @LastName AND Email_1 = @Email)
begin
Select col1, col2... from YourTable
return 1
end
else
begin
return 0
end
April 1, 2005 at 1:49 pm
This wouldn't be any faster than PW's solution. The advantage that PW's solution has is that an index can be used on the date because no modification has to...
April 1, 2005 at 12:50 pm
Select C.company, E.fname, E.lname, ISNULL(e.Phone, C.phone) as Phone
from tblCompany C inner join tbkEmployees E on C.id = E.companyidfk
You just need to apply this technique to the insert/update statement you will...
April 1, 2005 at 12:47 pm
Here's somthing to play with (I wouldn't recommend it on a 8 M lines table though).
SELECT O.XType
--, count(*) AS TotalHits_Found
, O.name
, (SELECT CEILING(COUNT(*) * 0.9) FROM dbo.SysObjects O4 WHERE...
April 1, 2005 at 12:16 pm
One way to accomplish this would be to do a backup of A and restore to B.
April 1, 2005 at 9:28 am
This solution has already been posted, also if you only want the date portion you're still better off using dates than strings as they will compare must faster than varchars.
April 1, 2005 at 8:00 am
Have you actually run this statement??
select CAST(dateadd (d, 0, datediff(d, 0, getdate())) AS SMALLDATETIME)
March 31, 2005 at 9:32 pm
Viewing 15 posts - 18,271 through 18,285 (of 18,926 total)