Viewing 15 posts - 2,386 through 2,400 (of 3,543 total)
temp tables (prefixed with #) are created in the tempdb database with the name you give it plus additional that is added by sql to make it unique. These temp...
January 26, 2005 at 10:26 am
OK, lets see if we can define it further.
Assuming following ddl
attrSFloat itemID int, attrID int, value float
attrRFloat itemID int, attrID int, minvalue float, maxvalue float
attrString itemID...
January 26, 2005 at 8:37 am
Answer to 2)
Select Firstname,Lastname,Address,Employee_Id
From Employee
Where Employee_Id = ISNULL(@ID,Employee_Id)
or
Select Firstname,Lastname,Address,Employee_Id
From Employee
Where @ID IS NULL OR Employee_Id = @ID
January 26, 2005 at 7:43 am
Volume will be the killer here.
Whatever solution you use must at least aggregate the Detail table. So the choice is where and when. I see two possibilities.
Create a sub query...
January 26, 2005 at 7:39 am
My suggestion would be to create a temp table of the attributes (attrID and value) from the tblSearchCr table (ignoring non supplied entries). Count the number of rows...
January 26, 2005 at 7:27 am
Use SUBSTRING to get data, eg
DECLARE @wanted varchar (1000)
SELECT @wanted = SUBSTRING(pr_info,1,1000)
FROM pubs.dbo.pub_info
WHERE pub_id = 9901
SELECT @wanted
Of course you are limited to 8000 (varchar), 4000...
January 25, 2005 at 7:19 am
Assuming orderno is unique
SELECT c.custno, h.entrydate, h.orderno
FROM customers c
INNER JOIN [order-header] h
ON h.custedp = c.custedp
WHERE h.orderno IN (SELECT TOP 6 h2.orderno
FROM [order-header] h2
WHERE h2.custedp =...
January 25, 2005 at 6:44 am
First, get the client app to convert the selected dates and ranges (formatted) into a single string eg yyyymmdd,yyyymmdd,yyyymmdd etc
If performance is acceptable (depending on size of table, indexes etc) then
WHERE...
January 21, 2005 at 6:52 am
If you want to capture the date/time of table changes then
create table changelog (table_name sysname, base_schema_ver int, change_date datetime)
insert into changelog (table_name, base_schema_ver, change_date)
select [name],base_schema_ver,GETDATE()
from sysobjects
where...
January 21, 2005 at 6:29 am
See if this works
DECLARE @yy int, @mm int, @yymm int, @rowct int, @intAddressID int
SET @yy = year(GETDATE())
SET @mm = month(GETDATE())
SET @yymm = (@yy * 100) + @mm
SET...
January 21, 2005 at 3:25 am
Try this
DECLARE @cmd varchar(255)
SET @cmd = 'echo line 1 > C:\outfile.txt && echo line 2 >> C:\outfile.txt'
EXEC master..xp_cmdshell @cmd
January 21, 2005 at 2:28 am
Something like this
exec sp_msforeachdb @command1 =
N'select ''?'' as [database],u.[name],u.sid,l.[name] as [login]
from ?.dbo.sysusers u
inner join master.dbo.syslogins l
on l.sid = u.sid
where u.issqluser = 1'
January 21, 2005 at 2:19 am
You have staff who are contracted (with date ranges)
You have jobs (with date ranges)
and you want see if any staff can fulfill any jobs
Questions
Where is the relationship between staff and...
January 20, 2005 at 7:30 am
![]() | I have altered a table by enterprise manager and then i look into the SysObject and there is... |
January 20, 2005 at 2:13 am
Viewing 15 posts - 2,386 through 2,400 (of 3,543 total)