Viewing 15 posts - 15,331 through 15,345 (of 15,376 total)
I think the confusion is that sql converts '' to 1/1/1900. If you need to use this date and also have "blank" try inserting null instead of ''. If this...
April 17, 2009 at 2:50 pm
Basically, I would write a cursor to loop through all the rows. Do a control break type logic such that you stick the AccountName in a variable. Start by initializing...
April 17, 2009 at 10:18 am
Upgrade to 2005. 😛
You are probably going to have to do this row-by-row. :sick:
I can probably find some time later today to come up with a rough idea if you...
April 17, 2009 at 9:52 am
There is certainly a better way to do this but you could probably use the
sys.tables where create_date > @LastSyncDate or modify_date > @LastSyncDate
to get a list of tables.
Then...
April 17, 2009 at 9:17 am
Are you saying the structure of your production databases changes daily? :w00t: That sounds a little scary. Maybe you should look into something like doing a backup of prod and...
April 17, 2009 at 8:41 am
Yes it is very normal (even normalized :-P) to have several foreign key relationships to any given table. If you have time I would defintely recommend catching up on some...
April 16, 2009 at 2:55 pm
At a glance I don't see anything wrong with this trigger. The record in the original table is not really gone yet. It is in the middle of a transaction...
April 16, 2009 at 2:33 pm
These should be foreign keys. Think of hard it will be if you store the program name in multiple tables and the name of the program changes. :w00t: What if...
April 16, 2009 at 2:25 pm
JacekO (4/16/2009)
My solution has a simpler execution plan and lower query cost so it might perform faster. But of course both them work and it's your call. 🙂
I agree....
April 16, 2009 at 1:41 pm
Try this and this if this gets you what you want. I included my create and insert scripts too. 😉
create table Account
(
Accountname varchar(50),
Booknumber int,
Bookname varchar(50)
)
insert account select 'StoreOne',...
April 16, 2009 at 12:50 pm
Glad that worked for you. Let me know if you need some more help on it and I will see what I can do. 😀
April 16, 2009 at 8:05 am
I tweaked your code a little bit more. I removed the in because it was checking for a single value and removed the statusid check at the end. I think...
April 16, 2009 at 7:58 am
Actually, when i was looking again at your code the case statement has only 1 valid path. You are filtering out every value for StatusID except what is in
April 16, 2009 at 7:52 am
Can you post the create scripts, some sample data and the desired output? That way we are on the same page. It sounds like the case is exactly what you...
April 16, 2009 at 7:51 am
Are you just trying to select this info? If so then just take the alias of the columns.
Try this.
CASE (a.statusdetail)
WHEN NULL THEN 9
ELSE 11
END as StatusID
April 16, 2009 at 7:28 am
Viewing 15 posts - 15,331 through 15,345 (of 15,376 total)