Viewing 15 posts - 166 through 180 (of 395 total)
Batches are terminated by the GO command.
October 3, 2012 at 4:06 am
You should avoid joining on different data types if you possibly can.
If you use cast() in the join, at least everyone can see what's happening. An implicit cast is...
October 3, 2012 at 4:01 am
Its about covering indexes. If a query only uses those 3 columns, SQL Server may use the index to get the data & not look at the table at...
October 3, 2012 at 3:55 am
It's because the seek doesn't use Id, & Id is the first column in the index.
An index can only be used for an index seek if the key to seek...
October 3, 2012 at 3:34 am
Have a look at my post on this thread - it's a similar problem:
http://www.sqlservercentral.com/Forums/Topic1366725-391-2.aspx
October 2, 2012 at 1:18 pm
I think this does what you want - ie shows users who haven't taken all curriculums, & a list of curriculums they haven't taken:
--========== TEST DATA ======================
if object_id('[dbo].[Curriculum]') is not...
October 2, 2012 at 9:57 am
This might be what you want, but I'm guessing on the join:
--=========== TEST DATA ===========================
-- Reset all NOT NULL to NULL...
--Source Table:
if object_id('[dbo].[CMC_BLCO_COMM_ITEM]') is not null drop table [dbo].[CMC_BLCO_COMM_ITEM]
CREATE TABLE...
October 2, 2012 at 8:38 am
If CMC_BLCO_COMM_ITEM.BLEI_CK is NULL then set BILL_ENTY_SK = -1
What's the link between the two tables? You need to know which record to update.
October 2, 2012 at 8:02 am
--I am trying to get mtd, yesterday and previos month data in 1 table.
--Can someone please help me..
--===== TEST DATA =========
declare @a table
(Id int, OrderDate DateTime, OrderQty int...
October 2, 2012 at 5:52 am
How are you trying to reference the local server?
October 2, 2012 at 5:22 am
This will work in 2005. Only the test data has changed (& variable declaration).
Please note: You should post on a 2005 forum for 2005 answers 🙂
--===== TEST DATA =========
declare...
October 2, 2012 at 5:01 am
kk 93815 (10/2/2012)
also is it possible to auto return all columns in the table or we need to explicitly specity all the columns in a select query?
You should always specify...
October 2, 2012 at 4:50 am
unfortunately I can't use SQL 2008, sorry didn't mention this earlier.
What version are you using?
October 2, 2012 at 4:48 am
Record num 3 should be retrieved with the marital status and employment status from record two as they were null.
I read this as 3 being a later record than 2.
The...
October 2, 2012 at 4:46 am
This works for the test data. It picks up values from the 3rd row if the 2nd has nulls too.
--===== TEST DATA =========
declare @Person table
(Id int, Name varchar(20),...
October 2, 2012 at 3:23 am
Viewing 15 posts - 166 through 180 (of 395 total)