Microsoft Transact-SQL Interview Questions 


 

Microsoft Transact-SQL Interview Questions
I am trying to return a result set based off some passed parameters and a conditional statement. I have been programming in T-SQL for awhile, but not at all in Access and it seems the syntax is different. The code I currently am looking at is below:

parameters auditDate DateTime, [match] Text ( 255 );

IIf (FacilityAudit.[MonthYear] like [auditDate],

(SELECT FacilityAuditQuestions.AuditSection, FacilityAuditQuestions.Points, FacilityAudit.Points AS TotalPoints, FacilityAuditQuestions.Question, FacilityAudit.Auditor, FacilityAudit.OptYes, FacilityAudit.OptNo, FacilityAudit.Notes, FacilityAudit.MonthYear FROM FacilityAudit RIGHT JOIN FacilityAuditQuestions ON FacilityAudit.AuditSection=FacilityAudit...

select FacilityAuditQuestions.Questions from FacilityAuditQuestions where [Match] like FacilityAuditQuestions.AuditSection)

ORDER BY FacilityAuditQuestions.AuditSection;

What I am trying to do is if the Dates match, return certain questions based off of AuditSection codes. If it does not match then return all questions. Any help in the Access coding would be appreciated.
Dear All,

how can i use t-sql to count the number of char in a text field?

for example:
text: '123,Jimmy,Assigned a job, close the job'

I need to cout number of ',' in this text, so output for this example is 3

What is the code in T-SQL?

Many Thanks
I have just joined a Computer Course and have learned PLT,C#,VC#,T-SQL..this is a 3 years course and I will get to learn Java,JDBC,UML,XML,Data Structures,VB.NET,ASP.NET etc. and I just wanted to know out of curiosity Which Programming Language is the most Popular and Used amongst these 5 languages-C#,Python,VB.NET,Ruby and Ada and have a great potential to be used by maximum number of people in future as well.Please tell me which language amongst these 5 is the most popular and used and you get maximum career offers as well as rate these languages from 1 to 5 so that I know which language to learn later and which to pursue and master right now..
I'm trying to write a T-SQL script that involves cursors.
I'm getting errors. Is this code ok?
(all variables are varchar(20))

if @PhoneID=@PrevPhoneID and @PhoneType=@PrevPhoneType
Begin
Set @Phonetype=@Phonetype & "2")
End
I am looking to print out the row number of each row in a Sybase (T-SQL) stored procedure. For example:

CREATE PROCEDURE dbo.Info
AS
BEGIN
select ROW NUMBER, date, name, desc from ProblemTb
END
I know HTML, ASP, T-SQL and VB script. What's the easies way to make the transition to the .NET platform?. I am thinking I will need to learn Visual Sudio. Which technologies do I need to know, in order to become a professional ".NET" web developer/programmer? How do I get up to speed without spending thousands of $ on formal training?
client company has around 25 sql servers .
Each server has got 5 to 10 databases.
Some of the databases are old.
We don't know whether any applications using old databases or not.
Is there any way we can find the unused databases in past 3 months or past 1
year
using some Lastupdatedatetime or last action on sql server system tables
using T-SQL scripts.

If no application is accessing the database and no actions performed on
that database from past 1 year then we need to delete that databases.

How to identify unused databases?

Any kind of help is greatly appreciated.
my syllabus to study is

1. SQL server 2005 architecture.
2. Declaring variables and parameters.
3. Maintaining data (DML).
4. T-SQL stored Views, procedures , Functions and Triggers.
5. Programming procedural statements.
6. Error handling.
7. Handling server-side result sets.
8. Querying and storing XML.
9. Integration of .net CLR with SQL server.
a. Developing procedural code in .net.
b. Extending SQL server with .net.
Any body knows any good place to learn Sql erver admin and development, (T-SQL,Monitering,Performance).Any institue in Nj,NY will be great.I prefer go for classes instead of Online.
:)
If you are not a full-time DBA and have passed the 70-431 test can you please give me some pointers as to which resources helped you out the most? Im currently using 1.) Microsoft Press MCITP Self Paced Training kit (which includes a version of the Measure up practice Test) 2.) Practice Test 70-431 purchased from Measure Up 3.) Online Course 70-431 from Measure Up which are ok since I can afford (in time or money) an instructor led course. CBT Nuggets looks pretty good too. Any info. would be greatly appreciated.
My background is in T-SQL, Classic ASP and VBScript (Web Development)
I was under the impression that a DBA was managing data using SQL or T-SQL as programming tool. I keep reading on Dice.com that programming languages are required for a DBA position. Why?/DBA are not application programmers.??
I'm trying to create a SQL table on the fly from a csv file. How do I do this in T-SQL?
Name 5 Relational Database Management Systems that are the most popular and also tell me which Query Language is used the most...is it SQL?if it is....which derivative of SQL is used the most T-SQL or PL/SQL.and yes what percent of Relational Database Management Systems use SQL as their standard Query Language.If you can point to additional sources regarding this,it would be quite helpful as well.Waiting eagerly for your answers.
I have an entity named Country with fields: CountryID, CountryName where CountryID is a primary key. And i like to create a general stored procedure that does INSERT, UPDATE and DELETE operations. How can i do that?
Tables:
MUSICIAN(musicianName, income, address, labelLicenseNumber)
LABEL(labelName, labelLicenseNumber, city, revenue)
ALBUM(albumName, musicianName, albumNumber, labelLicenseNumber, price, year)
SONG(songName, albumName, length, genre)
CONCERT(musicianName, cdate, place, city, price, capacity)



List the artist(s) who's cheapest album(s) is more or equally expensive than the most expensive album of some other artist.
123456Showing 1 to 15 of 77