[Solved] How to select data from the following table?

select category_name,parent_category_name from tbl_product p left join ( select cp.category_code, case when cp.parent_code = 0 then ” when cp.parent_code != 0 then cp.category_name end as category_name, cp.parent_code, isnull(ch.category_name, cp.category_name) as parent_category_name from tbl_category cp left join ( select cl.category_name, cl.category_code, cl.parent_code from tbl_category cl ) ch on cp.parent_code = ch.category_code ) as cat on cat.category_code … Read more

[Solved] sql qry trickl puzzle

SELECT * FROM @tblA WHERE @ColA = ColA AND (@ColB = ColB) AND (@ColC = ColC) Union –Handles direct or wrong input values SELECT * FROM @tblA CPT WHERE @ColA = ColA and (EXISTS(SELECT 1 FROM @tblA WHERE @ColB=ColB) and @ColB is Not NULL and @ColB = ColB) Union –Handles direct or wrong input values … Read more

[Solved] convert sql server file into mysql [closed]

The constraint lines in you output may define the constraints, eg: ALTER TABLE [dbo].[Message] WITH CHECK ADD CONSTRAINT [FK_Message_Message] FOREIGN KEY([OpratorID]) REFERENCES [dbo].[Oprator] ([ID]) says there is a relationship between Message and Operator ( Message.OperatorID = Operator.ID ) 0 solved convert sql server file into mysql [closed]

[Solved] I want to insert a record in DB and then need to return a row

One way to do what you want is to modify @voucherNo to be an OUTPUT parameter, and add a new OUTPUT parameter to your query to return the value of SCOPE_IDENTITY(). @voucherNo varchar(max) @ScopeIdentity numeric(38,0) And modify that last SELECT statement to set the value of @ScopeIdentity parameter. SELECT @ScopeIdentity = SCOPE_IDENTITY() Then use SqlCommand.ExecuteNonQuery … Read more

[Solved] . It’s working fine when I pass 10-15 input but taking more than 5 minutes for 30 input. I need to make it work for 100 inputs

. It’s working fine when I pass 10-15 input but taking more than 5 minutes for 30 input. I need to make it work for 100 inputs solved . It’s working fine when I pass 10-15 input but taking more than 5 minutes for 30 input. I need to make it work for 100 inputs

[Solved] Taking lot of time to read from SQL Server using c#

Something like this might work. I’m not sure on the efficiency yet – it may depend on the amount of hits that you’re looking for: create type HitBlocks as table ( HitIndex int not null ) go create procedure FindMaxCover @Hits HitBlocks readonly as ;With DecomposedBlocks as ( select (HitIndex/8)+1 as ByteIndex,POWER(2,(HitIndex%8)) as BitMask from … Read more