Viewing 15 posts - 3,316 through 3,330 (of 3,544 total)
Is this what u want
create table #tblResponses (Resp int, ProdName char(1), Value varchar(3))
insert into #tblResponses values (1, 'A', 'Yes')
insert into #tblResponses values (1, 'B', 'No')
insert into #tblResponses values (1, 'C',...
Far away is close at hand in the images of elsewhere.
Anon.
May 7, 2003 at 8:21 am
Are you saying
1 A Yes
1 B Yes
1 C Yes
produces
A 1
AB 1
AC 1
BC 1
and
1 A Yes
1 B Yes
1 C No
produces
A 1
AB 1
Far away is close at hand in the images of elsewhere.
Anon.
May 7, 2003 at 7:46 am
How about this for a wacky & crazy solution ![]()
create table #tblResponses (Resp int, ProdName char(1), Value varchar(3))
insert into #tblResponses values (1, 'A', 'Yes')
insert into #tblResponses values...
Far away is close at hand in the images of elsewhere.
Anon.
May 7, 2003 at 6:49 am
Can I ask some qualifying q's
How do you get 8 combinations from 3 products? If you want unique combinations then there are only 6
select a.ProdName,b.ProdName,c.ProdName
from prodx a
cross join prodx b
cross...
Far away is close at hand in the images of elsewhere.
Anon.
May 7, 2003 at 2:58 am
Since you are naming each server in turn then
INSERT INTO ##all_logins
SELECT name,'jupiter'
FROM jupiter.master.dbo.sysxlogins
WHERE name like '%Ivanov%'
INSERT INTO ##all_logins
SELECT name,'saturn'
FROM saturn.master.dbo.sysxlogins
WHERE name like '%Ivanov%'
Far away is close at hand in the images of elsewhere.
Anon.
May 6, 2003 at 6:26 am
Select into will always create a temp table.Try
CREATE TABLE
tempdb.##all_logins
([UserID] [int] IDENTITY (1, 1) NOT NULL ,
[UserName] [varchar] (100))
Then try to add records to it:
INSERT INTO ##all_logins
SELECT name
FROM jupiter.master.dbo.sysxlogins
WHERE...
Far away is close at hand in the images of elsewhere.
Anon.
May 6, 2003 at 3:23 am
Sorry, cockup on quotes (could'nt test)
DECLARE @search VARchar(3000)
DECLARE @scop VARchar(20)
DECLARE @sql nvarchar(1000)
set @scop='C:\'
set @search='ilan '
set @sql = 'SELECT TOP 10 *
FROM OPENQUERY(NTindex,
''SELECT DocTitle,create,path,filename, rank,VPath,Contents,characterization
FROM SCOPE ('''''+@scop+''''')
WHERE FREETEXT(Contents, ''''"'+@search+'"'''')'')'
exec sp_executesql...
Far away is close at hand in the images of elsewhere.
Anon.
May 2, 2003 at 11:03 am
Nice one Jay, did not think of that one. Probably make cleaner code as well.
Far away is close at hand in the images of elsewhere.
Anon.
May 2, 2003 at 10:01 am
Try this
DECLARE
@SearchField VARCHAR(100),
@A varchar(5),
@Temp VARCHAR(100),
@Output VARCHAR(100),
@counter INT
SET @SearchField = 'select1 select2 select3'
SET @Temp = @SearchField
Print @Temp
SET @Output = ''
SET @A = ''
WHILE (@Temp <> '')
BEGIN
SET @Counter = CHARINDEX(' ',@Temp+'...
Far away is close at hand in the images of elsewhere.
Anon.
May 2, 2003 at 9:53 am
The problem is you are sending the query with @scop and @search not the contents of the variables. You need to create the whole query (inc variable values) in a...
Far away is close at hand in the images of elsewhere.
Anon.
May 2, 2003 at 9:06 am
Why not user a join, it is faster and you do not need an top/order by in the subquery.
SELECT a.* FROM t_Retail a
FROM t_Retail a
INNER JOIN (SELECT Pcde6P
FROM t_Retail
WHERE LEN(RTRIM(Pcde6P))...
Far away is close at hand in the images of elsewhere.
Anon.
May 2, 2003 at 8:02 am
Don't really know if there is a best way. It depends on volume and type of data. You only gave example of 3 rows with one character data. The only...
Far away is close at hand in the images of elsewhere.
Anon.
May 2, 2003 at 7:06 am
In EM right click on the server (the one you are linking to) and select properties. Select the Connections tab, click on ANSI warnings and ANSI nulls (to put tick...
Far away is close at hand in the images of elsewhere.
Anon.
May 2, 2003 at 2:25 am
declare @c int,@sql nvarchar(1000),@table varchar(20)
set @table = 'tablename'
set @sql = 'select @c=count(*) from '+@table
exec sp_executesql @sql,N'@c int output',@c output
select @c
Far away is close at hand in the images of elsewhere.
Anon.
April 30, 2003 at 10:43 am
Have you tried setting them on the linked server for connections? (providing it does cause problems elsewhere!)
Far away is close at hand in the images of elsewhere.
Anon.
April 30, 2003 at 10:30 am
Viewing 15 posts - 3,316 through 3,330 (of 3,544 total)