Wednesday, July 24, 2013

[T-SQL] Simple Interview Question

[T-SQL] Simple Interview Question


Simple Interview Question

Posted: 24 Jul 2013 12:29 AM PDT

select 5 & 17 What is the Output? Ans is :1 1)how it will return 1 ? 2)what is the use of this query? any one explain it pls..Thank & RegardsSaravanan.D

how to return email id if it contains dell.com otherwise any one email in the group

Posted: 23 Jul 2013 01:48 AM PDT

if an email contains %dell.com% then return it otherwise max(email) / min(email) just one please help me,[b]DDL[/b]create table #onner (acctno int, email_id varchar(30)) insert into #onner values(1,'king@dell.com') insert into #onner values (1,'siller@dell.com') insert into #onner values (1,'villa@billo.com') insert into #onner values (2,'aillow@dell.com') insert into #onner values (2,'king@tcs.com') insert into #onner values (3,'laxmg@dell.com') insert into #onner values (4,'abc@bb.com') insert into #onner values (4,'zyx@dd.com') insert into #onner values (4,'WWW@xx.com') insert into #onner values (4,'ZAS@vonage.com') expected resultsacctno Email 1 siller@dell.com (any dell.com if exist more than once) 2 aillow@dell.com 3 laxmg@dell.com 4 zyx@dd.com (any one doesn't matter since there is no email contains dell.com)Thank you very much in advanceasitti

Insert into Table by whom ??

Posted: 23 Jul 2013 05:38 AM PDT

I have one SQL Server table (one of many) that night will be filled. Nobody knows which program, service or whatever fills this Table every Night.Is there a quick way to find out when and where insert/update into this table? (many jobs, many tables, stored procedures and many many linked servers).. of course search-routine, profiler, watch interfaces ???I am new in this Company, and nobody can give me Feedback about this. :w00t:kind RegardsNicole

Get values from 2nd Table

Posted: 23 Jul 2013 10:58 AM PDT

Can someone show me how to combine these two tables and get one result set CREATE TABLE_1 (Field1 VARCHAR(4) NULL, Field2 VARCHAR(4) NULL, Field3 VARCHAR(4) NULL)INSERT INTO TABLE_1VALUES(Field1, Field2, Field3)(A, B, NULL),(NULL, A, NULL),(A, B, C),(NULL, NULL, NULL),CREATE TABLE_2(FieldName VARCHAR(4) NOT NULL, Title VARCHAR(20) NOT NULL)INSERT INTO TABLE_2(FieldName, Title)Values (A, xyz),(D, yyy)(B, zzz)Fieldname column data in TABLE_2 are matching in random column(Field1, Field2, and Field3) in TABLE_1RESULT should shows Title of A or B etc... like[b]Field1, Field2, Field3[/b]Title, Title, Title

How to make code for below requirement?

Posted: 23 Jul 2013 09:13 PM PDT

Hai Friends,I m currently making one web application in that i wanna display details from data base into asp page on grid view.create table onward_journey(onwrd_id int identity,request_id int foreign key refernces request(reqst_id),from_place varchar(10),to_place varchar(10),trvael_mode varchar(10),no_of_days varchar(10))insert into onward_journey ('11','chennai','chenai','car','2')i wanna display display my page on gridviewselectfrom_place,to_place,travel_mode, no_of_days from travel_request where request_id=IDENT_CURRENT ('request')when i made new request also its showing old once? how to that and how to show current request_id value?

can I use transactions to rollback only the current batch

Posted: 23 Jul 2013 04:17 PM PDT

I have a package with design as below1.I have DFT to load a Total_table with 90k records 2.it is connected to a for loop container-- to process the 90k reocrds in a batch of 10k3. In FLC 1st I load Batch_table with 10k from Total_table 4. inside FLC container , sequence container is added , which is connected by the batch load task 5. within sequence container {six (DFT1,DFT2,DFT3,DFT4,DFT5,DFT6) DFTs connected in sequence , which populate individual table using the Batch_table 10k records.} If sequnce container sucessfull then update the Total_table as processed (0 to 1) for the current 10k batch if the container fails i have a DFT to delete the current batch records from all the table using lookup.then for loop restarts after sucessfull batch load and repeats until FLC evaluates 'recordsprocessed>=90k' then a successmail.** can I use transactions to rollback only the current batch?** how can i set the FLC to continue with next , even after a failed batch** Here I want get the records count in all six DFTs to a custom_log table/Send mail task. As the package is running in a batch process I rowcount sould be sum of [rowcount from each batch]. After the batch process is complete i should get notified about the rocords processed in each table.please suggestThanks in advance.

No comments:

Post a Comment

Search This Blog