Viewing 15 posts - 18,346 through 18,360 (of 18,926 total)
Select ISNULL(FirstName + ' ', '') + ISNULL(middlename + ' ', '') + ISNULL(lastname + ' ', '') + ISNULL(suffix, '') as FullName from dbo.Contacts
March 22, 2005 at 11:46 am
Forgot to mention this... the first query will run faster (once fixed) because AS400 will be filtering out the results using its own indexes instead of sending out a few...
March 22, 2005 at 11:12 am
That was my point .
The most likely explanation is that AS400 doesn't understand exactly what you want to filter in the where condition. ...
March 22, 2005 at 11:10 am
I just moved the exists to eliminate the @JobsDB variable
IF EXISTS (SELECT * FROM sysobjects WHERE name = 'Configure' AND XType = 'U')
begin
select * from Employees inner join CTJobs.DBO.Jobs Jobs...
March 22, 2005 at 11:03 am
I've never used more than 10 parameters in my progs (almost all queries are done by access in adps).. I can't imagine using more than 25-100 parameters in a sp.
March 22, 2005 at 10:51 am
This is the way to change collation in a query.
Note that you can also change it in the table definition, but that would obviously change every query that touches the...
March 22, 2005 at 10:49 am
this is more a flow job than sql job...
if I got your requirements right I would do this :
if @JobsDB = 1
begin
select * from Employees inner join CTJobs.DBO.Jobs...
March 22, 2005 at 10:00 am
I would use this as a last resort as sql server would input the full table before applying the where condition.
March 22, 2005 at 9:54 am
The go keyword tells sqlserver to end this batch and start a new one. Even if the return keyword is executed (don't know where it would return to... but...
March 22, 2005 at 9:25 am
Actually I redid some test and it turns out that pw's solution is better than mine :
Substring(name, 3, 999) seems to be a tad faster than right(UserField1, len(UserField1) -...
March 22, 2005 at 8:32 am
Update d_details
set UserField1 = 'efgh' + right(UserField1, len(UserField1) - 4)
where left(UserField1, 4) = 'abcd'
I'm using len(UserField1) - 4 in case the field can be more than 8 chars (can be...
March 22, 2005 at 8:09 am
I don't know if you misunderstood, but the results you are getting are correct. The post is about shorcircuiting the or operator. Like in my previous post, when...
March 22, 2005 at 8:02 am
It will exit after the first hit.
Select * from dbo.SysObjects WHERE
1 > 0
OR
--this is shortcircuited
1/0 > 0--should throw an error
Complete article on WindowsItPro
March 22, 2005 at 7:36 am
You can't use another table unless you're inside the udf or inside a trigger. Maybe you could send the parameters needed to calculate the first field in the 2nd...
March 21, 2005 at 1:14 pm
You'll have to run a trace and scan for the alter procedure text in it.
March 21, 2005 at 11:40 am
Viewing 15 posts - 18,346 through 18,360 (of 18,926 total)