Showing posts with label address. Show all posts
Showing posts with label address. Show all posts

Thursday, March 22, 2012

Conecting linked servers using VB6.0

I have an SQL web site linked to may SQL Server. I am using the IP address t
o
do this.
Then I tried to make an ODBC to link VB6.0 to update some tables in the
linked server, but it always give me an error message saying that the server
doesn't exist or i do not have permitions. I am using the same permitions I
used to create the linked server, so i do not know what else i can do.
can any body help me?Why aren't you simply connecting directly to the server instead of through S
QL
Server's linked server?
If you want to connect to a single source but have data from multiple source
s,
then create stored proces and views that query the linked server. Granted, t
his
will be slower than querying the linked server directly.
HTH
Thomas
"Lina Manjarres" <LinaManjarres@.discussions.microsoft.com> wrote in message
news:0C040BE5-A598-489C-9EC9-F681841EE641@.microsoft.com...
>I have an SQL web site linked to may SQL Server. I am using the IP address
to
> do this.
> Then I tried to make an ODBC to link VB6.0 to update some tables in the
> linked server, but it always give me an error message saying that the serv
er
> doesn't exist or i do not have permitions. I am using the same permitions
I
> used to create the linked server, so i do not know what else i can do.
> can any body help me?|||Of course, why didn't I think about it before?
Thanks a lot!
"Thomas" wrote:

> Why aren't you simply connecting directly to the server instead of through
SQL
> Server's linked server?
> If you want to connect to a single source but have data from multiple sour
ces,
> then create stored proces and views that query the linked server. Granted,
this
> will be slower than querying the linked server directly.
>
> HTH
>
> Thomas
>
> "Lina Manjarres" <LinaManjarres@.discussions.microsoft.com> wrote in messag
e
> news:0C040BE5-A598-489C-9EC9-F681841EE641@.microsoft.com...
>
>sqlsql

Monday, March 19, 2012

Conditional suppression formula PLEASE HELP

I have Crystal reports 8.5 and Im trying to generate a report that will give all of my sales orders with the part numbers price and the address they shipped to but I keep getting alot of duplicate fields so I used a suppresion forumla below

{InvoiceDetail.PartNumber} = previous({InvoiceDetail.PartNumber})

That did a great job of eliminated the duplicates but I found out that I have some orders that are in succesion with identical part numbers and they were being suppressed so I tried this formula

{InvoiceDetail.PartNumber} and {InvoiceHeader.SONumber} = previous({InvoiceDetail.PartNumber}) and {InvoiceHeader.SONumber}

thinking that will suppress any field that has the same part number and so number but it errors our and tells me I need a boolean.

I've tried just about everything and Im sure im missing something very simple but I dont know what it is.

PLEASE HELP{InvoiceDetail.PartNumber} and {InvoiceHeader.SONumber} = previous({InvoiceDetail.PartNumber}) and {InvoiceHeader.SONumber}

The very first thing is try to find out why you are getting duplicate data. Something must be wrong with you linking.

To suppress try this:

{InvoiceDetail.PartNumber} = previous({InvoiceDetail.PartNumber}) AND {InvoiceHeader.SONumber} = previous({InvoiceHeader.SONumber})

Sunday, March 11, 2012

conditional split problem

I have been transfering data from text file to sql databases.

I have a conditional split where i check to if the address has changed for a particular person.If yes i direct to update else i direct to default output which means no change.

when i connect error output of conditional split to a database or union all couple of rows are directed to error output.But i dont understand the reason.How would i be able to know why they r directed to error.

Please let me know.

When the rows are sent to the error output they should have two new columns (ErrorCode and ErrorColumn) added to them. To determine the cause of the error, I would start by looking at these values, and then researching the code(s) that they contain.|||

This is a way of doing what Matthew suggested:

By default every error output in your dataflow will add a couple of columns: ErrorNumber and error column. The you can use script task to get the description of the error. Jamie has an explanation of that on his blog:

http://blogs.conchango.com/jamiethomson/archive/2005/08/08/1969.aspx

Conditional sorting in order by clause

Hi,
I have a query as

select name, age, address from employee order by name

Now i want to do sorting as ASC or DESC in order by clause dynamically.

I tried something like this :-

declare @.Order int
set @.Order = 1

select name, age, address from employee
order by name
CASE
WHEN @.Order = 0 THEN ASC
WHEN @.Order = 1 THEN DESC
END

But its giving me error, Is it correct or is there any other way to do conditional sorting?

order by is usually the last statement in a query and u cant do it this way...simple way is use if-else ...

if(@.order=1)

select ...order by name desc

else

select ...order bu name asc

u may try to use dynamic sql and achive it too, but its not adviseable...

|||

Use the following query it is a conditional sorting...

Declare @.Order int
Set @.Order = 1

Selecct name, age, address from employee
Order By
CASE WHEN @.Order = 0 THEN Name End ASC,
CASE WHEN @.Order = 1 THEN Name End DESC

Sunday, February 12, 2012

Concatinate without Nulls

I am building a view and I want to return a combined field of all that make
up a full address (Address1, Address2, City, State and ZipCode). If any of
the fields are Null it returns a null. Do I have to use something like
COALESCE on each one as any of them can be null. Thanks.
DavidUse Isnull(field_name, '') to return an empty string from a null.
"David C" <dlchase@.lifetimeinc.com> wrote in message
news:#63iepDGFHA.2156@.TK2MSFTNGP10.phx.gbl...
> I am building a view and I want to return a combined field of all that
make
> up a full address (Address1, Address2, City, State and ZipCode). If any
of
> the fields are Null it returns a null. Do I have to use something like
> COALESCE on each one as any of them can be null. Thanks.
> David
>|||>> Do I have to use something like COALESCE on each one as any of them can
That is one simple and recommended way to avoid NULLs being returned.
Anith|||You can also use ISNULL.
Example:
select isnull(lastname + ', ', '') + isnull(firstname)
from employees
go
AMB
"David C" wrote:

> I am building a view and I want to return a combined field of all that mak
e
> up a full address (Address1, Address2, City, State and ZipCode). If any o
f
> the fields are Null it returns a null. Do I have to use something like
> COALESCE on each one as any of them can be null. Thanks.
> David
>
>|||You could also investigate the session option
CONCAT_NULL_YIELDS_NULL
Most client tools set this value to ON to give you the behavior you're
seeing. But if want nulls to be treated as empty strings during
concatenation operations, you can
SET CONCAT_NULL_YIELDS_NULL OFF
The setting (as with all SET options) only applies to the current
connection, or, if you set it in a stored procedure, it applies to that
procedure.
Changing this option will also invalidate the use of indexed views or
indexes on computed columns.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"David C" <dlchase@.lifetimeinc.com> wrote in message
news:%2363iepDGFHA.2156@.TK2MSFTNGP10.phx.gbl...
>I am building a view and I want to return a combined field of all that make
>up a full address (Address1, Address2, City, State and ZipCode). If any of
>the fields are Null it returns a null. Do I have to use something like
>COALESCE on each one as any of them can be null. Thanks.
> David
>

concatenation Nullfields in T-SQL

Hi,
I have a list box for Address which shows available addresses for buildings.
I want the list box to concatenate the address and show it.
in Access I used to write :

Select [address] & " " & [city_] & " " & [state] & " " & [bldgzip] AS [Building Address] From tblAdrs

This would show the whole thing even if it had some Null fileds (it wouldn't show if I used + instead of &)

But I don't know why it won't do the same in T-SQL?

Can anyone help?on most servers Null + <any data type> = Null

you can disable this feature or use the ISNULL function.

Select isnull([address],'') + ' '+ isnull([city_],'') + ' '+ isnull([state],'') + ' '+ isnull([bldgzip],'') AS [Building Address] From tblAdrs|||Thanks Paul

Originally posted by Paul Young
on most servers Null + <any data type> = Null

you can disable this feature or use the ISNULL function.

Select isnull([address],'') + ' '+ isnull([city_],'') + ' '+ isnull([state],'') + ' '+ isnull([bldgzip],'') AS [Building Address] From tblAdrs