Viewing 15 posts - 166 through 180 (of 345 total)
Or if you want the results in a table format, you could try this:
select asset_year,
sum(case when asset = 'A' then 1 else 0 end) A,
sum(case when asset = 'B' then...
July 13, 2011 at 7:36 am
--create test data
create table test_count (asset_year int, asset varchar(10));
go
insert into test_count values (2009, 'A')
go 12
insert into test_count values (2010, 'A');
go 14
insert into test_count values (2009, 'B');
go 5
insert into test_count values...
July 13, 2011 at 7:19 am
SVR (7/12/2011)
I am given specific steps to follow. I do not know why he wants that to happen.
Seems if he was that specific, he'd know how to fix the problem...
July 12, 2011 at 2:04 pm
LutzM (7/8/2011)
July 8, 2011 at 10:44 am
True, but the OP said earlier, "Only one user is inserting records at anytime." So if this holds true, that this is the only user inserting into this table, IDENT_CURRENT...
July 8, 2011 at 7:56 am
Since you know the table, replace @@IDENTITY with SELECT IDENT_CURRENT('MailLog')
kramaswamy is right about this. if anyone else is working elsewhere in the database, @@IDENTITY could pick up an unrelated ID...
July 8, 2011 at 7:17 am
...
I have a program that inserts a record, returns the record id of the newly inserted record, then inserts another record in another table using the returned row id as...
July 7, 2011 at 4:01 pm
No reason to use error-handling for a DDL script. Just check if the object exists and create it if not, like so:
IF NOT EXISTS (SELECT 1 from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME...
July 7, 2011 at 3:09 pm
sqlquest2575 (7/7/2011)
July 7, 2011 at 1:10 pm
sqlquest2575 (7/6/2011)
Hi Todd..As suggested, I ran below statement in the database but the result came out empty
So, if this returned nothing
select * from information_schema.tables where table_name = 'qry_Reports'
then there...
July 6, 2011 at 4:18 pm
Very cool. Here is how we do it in the hood: fill in the @CartID and @ShopperID in the script below pulled from your proc and run it. It'll show...
July 6, 2011 at 4:10 pm
The only way I see @LeafCount not getting the right total is if @SingleDoorCount or @DoubleDoorCount is null.
July 6, 2011 at 3:23 pm
Congrats. Maybe I can use this as motivation to start studying for mine :pinch:
July 6, 2011 at 1:52 pm
GilaMonster (7/6/2011)
toddasd (7/6/2011)
GilaMonster (7/6/2011)
There are no other triggers on either table? Absolutely sure of that?
Exactly. There has to be an INSTEAD OF INSERT trigger on the archive table. Lowell and...
July 6, 2011 at 12:24 pm
Viewing 15 posts - 166 through 180 (of 345 total)