By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,856 Members | 2,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,856 IT Pros & Developers. It's quick & easy.

insert rows dynamically

P: 30
Respected Sir,

i want to check it out, when insert returns zero rows affected ?

insert into Question_Copy(,column_name1,column_name2,column_na me3)
SELECT top 1 column_name1,column_name2,column_name3
FROM tablename where column_name1 not in (select column_name1 from Question_Copy)
--and column_name2 not in (select column_name2 from Question_Copy)
and UNIT_CODE not in (select UNIT_CODE from Question_Copy)
--and column_name3 not in (select column_name3 from Question_Copy)
order by newid() ;
// here i want to check if it returns zero rows affected then execute other query.
please make a reply, i am waiting for your reply..
Sep 23 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.