Viewing 15 posts - 211 through 225 (of 240 total)
The following SQL returns 'BBBBBB' and 'CCCCCC', the customers that are in the customer table but not in the DR table.
declare @master-2 Table (customer varchar(20))
declare @Customer Table (customer varchar(20))
declare @DR...
February 14, 2006 at 2:28 pm
By adding 'WHERE DR.CUSTOMERNUMBER IS NULL' to the select it will only return rows not in the DR table because for rows that are in the DR table and in...
February 14, 2006 at 2:23 pm
Try this if table1 has multiple rows in it and you need the longest for each row:
declare @Table1 Table(value varchar(14))
declare @Table2 Table(value varchar(12))
insert @Table1 Values('1216574754745')
insert @Table1 Values('1216575854745')
insert @Table1 Values('1219905854745')
insert @Table1...
February 14, 2006 at 2:17 pm
Try this:
declare @Table1 Table(value varchar(14))
declare @Table2 Table(value varchar(12))
insert @Table1 Values('1216575854745')
insert @Table2 Values('1')
insert @Table2 Values('121')
insert @Table2 Values('1216')
insert @Table2 Values('121657')
insert @Table2 Values('1216574')
insert @Table2 Values('12165747')
select top 1 *
from @Table1 t1
inner join @Table2...
February 14, 2006 at 2:07 pm
You should use LEFT OUTER JOINS for this purpose
An example of the query is:
INSERT INTO DR
SELECT m.customer,
...
FROM dbo.Master m (NOLOCK)
INNER JOIN dbo.Customer...
February 14, 2006 at 1:59 pm
I believe part of your message was cut off. Could you repost the complete question?
February 14, 2006 at 1:42 pm
You need to use either
SELECT @F_NM=@F_NM + '%'
OR
SET @F_NM=@F_NM + '%'
February 14, 2006 at 12:20 pm
One thing to do is to store the SOUNDEX of each row as a column. Also, store the stripped down names as colums. It's easier to amortize the cost of...
February 14, 2006 at 11:33 am
SQL Server does this by design to allow some objects to be created after other objects. What SQL Server does when created an object, if any reference object exists, the...
February 14, 2006 at 11:22 am
This won't create a table with 1 row for each incorrect answer. The output may look like what is desired but this is only a function of Query Analyzer.
February 14, 2006 at 10:22 am
Try something like this using your table definitions:
select cast(createdate as varchar) as 'Data'
from syslogins
where name = 'sa'
union
select cast(language as varchar)
from syslogins
where name = 'sa'
union
select cast(status as varchar)
from syslogins
where name...
February 14, 2006 at 9:00 am
Try looking at the SOUNDEX and DIFFERENCE functions.
--Jeff
February 14, 2006 at 8:42 am
The value of 'adCmdStoredProc' should be defined in the file 'adovbs.inc' and the declaration should be: Const adCmdStoredProc = &H0004. It tells ADO what type of statement is being executed, in...
February 14, 2006 at 8:37 am
Looking at the code, there are several things that I would do differently.
One, the first cursor, SCHOOLNUM2_CURSOR, loops through the table and resets the variable @STARTDATE to one of two values. ...
February 13, 2006 at 1:10 pm
If by tally, you mean the total number of seconds that each type of event takes then the following should work:
declare @events table (EventTime datetime, Event char(4))
insert @Events values ('8:23:00','GOOD')
insert @Events...
February 13, 2006 at 12:01 pm
Viewing 15 posts - 211 through 225 (of 240 total)