Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 SQL Enterprise Manager Function

Author  Topic 

patrickjao
Starting Member

24 Posts

Posted - 2011-10-24 : 08:58:28
I am using SQL Server Enterprise Manager "View" facility to create query ; I have difficulty to do the the subtraction/or addition of 2 field in 2 tables, just because there are NULL value in the field. in ACCESS there are Nz() function to solve this problem, Please advice there are similar function in sql server?

Best Regards

Patrick

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-10-24 : 09:00:02
use ISNULL( <column name> , 0 )


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-24 : 09:13:27
or COALESCE()

http://sqlblogcasts.com/blogs/madhivanan/archive/2007/10/04/isnull-or-coalesce.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

patrickjao
Starting Member

24 Posts

Posted - 2011-10-24 : 12:21:56
Well done, thanks, how about "Iif" function in Sql?
Go to Top of Page

Cindyaz
Yak Posting Veteran

73 Posts

Posted - 2011-10-24 : 13:15:06
IIF is present in VB I guess, not in SQL.

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-24 : 13:44:48
quote:
Originally posted by Cindyaz

IIF is present in VB I guess, not in SQL.


Available from Denali onwards

http://blog.sqlauthority.com/2011/09/10/sql-server-denali-logical-function-iif-a-quick-introduction/

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

patrickjao
Starting Member

24 Posts

Posted - 2011-10-24 : 23:05:56
Are there any link table facility for SQL server? I want to link 1 table in database to other's database. I can link SQL table to ACCESS using ODBC, but I couldn't find the link table facility in SQL
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-25 : 04:21:18
quote:
Originally posted by patrickjao

Are there any link table facility for SQL server? I want to link 1 table in database to other's database. I can link SQL table to ACCESS using ODBC, but I couldn't find the link table facility in SQL


its called linked server in sql

see

http://sqlserverpedia.com/wiki/Linked_Servers/Remote_Stored_Procedures_Overview

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

patrickjao
Starting Member

24 Posts

Posted - 2011-11-03 : 05:10:43
How to combine the auto number id with the text to become a text ; for example ABC + 0001 = ABC0001
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-03 : 05:19:22
see

http://www.sqlteam.com/article/custom-auto-generated-sequences-with-sql-server

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -