Return 0 (zero) when null SQL Server 2008 I have a calculated field like (Car.CarTot + Car.CarTax + Car.CarOther) - (Order.SubTot + Order.Taxes + Order.Other) My problem is this field sometimes returns Null When Values in "Order" is null. I would like to have 0 instead of Null Thanks for your help ... 24 Apr 2010 10:33
Speed in select statement I found that difference between 1) and 2). 1) is faster than 2). Why? How to make 2) faster? 1) select * into #mytemp from order where OrderID='123456' 2) decalre @orderid nvarchar(20) set @orderid = '123456' select * into #mytemp from order where OrderID=(a)orderid ... 12 Apr 2010 12:34
sql server 2008 db ownership question Hi, In my SQL Server 2008, there is a database DB1 which is a database restore from SQL Server 2000 .bak file. In the SQL Server 2000, the DB1's owner is User1. But when I restored the bak file to 2008, the 2008 doesn't have the user User1, so the default owner of the DB1 in 2008 is dbo. I then added the Us... 18 Apr 2010 20:51
Can't see default instance of sql 2008; login name oddness I am seeing two odd characteristics with a new windows 7 x64 box. The install and config steps were like so: [1] Computer OS installed, computer named Comp1. [2] Install sql server std 2008, developer version, including ssms, as default instance [3] Install sql server express 2005, named instance (sqlexpress).... 18 Apr 2010 18:38
Problem with Simple Create Script Hi There, Hope I'm posting this to the right group. I'm trying to write a simple script to create a database in SQL Server 2005. I keep getting the error "Could not locate entry in sysdatabases for database 'testdb'. No entry found with that name. Make sure that the name is entered correctly." Does anyone kn... 11 Apr 2010 17:56
Delete large table in chunks to minimise log file growth Helo All, I am deleting a large table in chunks to: 1) Avoid locking issues 2) Restrict log file growth Algorithm init_size = current size of transaction log while TRUE delete X records matching criteria current_size = current size of log If no records deleted then exit while ... 13 Apr 2010 15:06
Alter minimum size of transaction log Hello All, If you set the initial size of the log file to X when you create it, the nyou can never shrink the log file to below X. Suppose you decide that X is too large. Is there a way to reduce the minimum size of the log file? One way I can think of is: Detach the database, rename (or delete) the log fi... 10 Apr 2010 20:08
SQL 2008 on SBS 2003 Hi Have a client with SBS2003 Premium under VMWARE on one box and Terminal Server 2003 under XEN 5.5 on another box in the same sbs 2003 domain. Their 3rd party Database is on SQL on the SBS and they have been told they need to move to SQL 2008 Standard shortly to support the new version of the 3rd party so... 12 Apr 2010 20:23
DB in perptual single_user mode Hello: We have a DB that currently appears to be in a single user mode only, and attempts to alter this DB to multi users isn't working: alter database DB1 set multi_user --with rollback immediate /* Msg 5064, Level 16, State 1, Line 1 Changes to the state or options of database 'DB1' cannot be made at this... 9 Apr 2010 14:32
Is store procedure always fast than Access linked table via ODBC? I was assigned to upgrade one program from Access(using ODBC to connect to SQL 2000) to ASP.NET(using store procedure in SQL 2000). Finally, I tested them and found that ASP.NET is slower than Access. The mojority job of program is select some data from SQL 2000 tables, modify and then insert into some tables. Is ... 9 Apr 2010 11:10 |