In VB6 I have a designer report that needs to call some
t-sql code to populate the report. The issue is that the t-sql code creates a recordset that pulls from 2 tables that are in separate databases each with their own security. I can run the code from the query analyzer and it returns the...
I just changed the type on uid from int to nvarchar on the second line of the function. Nothing else changed. It is now:
Create Function Getep
(@uid nvarchar(50))
Returns VarChar(8000)
As
Begin
Declare @Result VarChar(8000)
Select @Result = IsNull(@Result + ',', '') + ep
From UserAccess...
After changing the type on the @Result in the function I got the following result:
AT000033 MKT562,MKT562,MKT562,MKT562,MKT562
AU001529 MKT441,MKT441,MKT441
CA009436 MKT211,MKT211,MKT211
CH066601 MKT544,MKT544,MKT544
CZ000015 MKT412,MKT412,MKT412
CZ000022 MKT552,MKT552,MKT552
JP001043...
Not sure what's going on but here is a partial list of the resulting recordset.
AT000033 NULL
AU001214 NULL
AU001428 NULL
AU001507 NULL
AU001529 NULL
CA009436 NULL
CH066601 NULL
CH370817 NULL
CZ000015 NULL
CZ000022 NULL
DE010275 NULL
DE010298 NULL
DE010549 NULL
DE010833 NULL
ES100946 NULL...
Here is the select and result:
select distinct uid, ep from useraccess order by uid
AT000033 MKT562
AU001214 MKT441
AU001428 R930
AU001507 9987593000
AU001507 Country
AU001507 Market
AU001507 MKT441
AU001507 R109
AU001529 MKT441
CA009436 MKT211
CH066601 MKT544
CH370817 Market
CH370817...
Yes, I read through this but I don't see how that can be used in my situation. I may have several columns that need to be concatenated into the single field being returned but this doesn't seem to address that scenario.
I have a table with the following columns: userid, ep
When I run a simple select query I get something like this:
userid ep
us0123 mkt1
us4567 mkt2
us0123 mkt3
What I want is this:
userid ep
us0123 mkt1, mkt3
us4567 mkt2
I can't figure out how to do this...
I am creating a new text file from an existing one in DTS. Each record I read from the existing file needs to create 4 new records in the new text file with various changes depending on the record read. I haven't been able to determine how to write multiple records in the new file. Is the "Main...
OK, I'm stumped. I've been writing vb code for quite a while now and this is extremely easy code that is failing. Someone please tell me what I am missing here.
Function Main()
dim new_cc
dim new_acct
dim period
period = mid(DTSSource("Col001"),1, 4)
if period = 2003 Or period = 2004 then...
I'm trying to import an Excel spreadsheet into a table using DTS. The data I'm importing is a mix of text characters and numbers in Excel that I've formatted into text. When I import it to a SQL table I get values for the text, but NULLS for the numeric data. I am creating the field as nvarchar...
Perhaps I misunderstood what a data driven query is. I did get the process to work and I suppose that is what I used not knowing what it was called. I created the lookup witha simple query:
SELECT SAP
FROM account_conversion$
WHERE (Acct = ?)
and created the connection to the...
Thanks Katy44,
I appreciate your response, but I don't understand why the lookup function won't work in this case. That is what I thought this was designed for. I must be missing something. I looked at your response on the "Data Driven Queries" question and that looks like what I need. I tried...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.