SQL Server Query Questions and Answers

Recent IT Questions

1 - 20 of 21
<<PREVIOUS 1|2 NEXT>>

SQL Server 2005 question self join query

I have one table that name is TblCategory on that 2 columns are CategoryName another column name is UpperCategoryID my table is like this CategoryName UpperCatID ------------ ----------- Book Commerce Commerce Accounting Science Math Commerce B.O....

Answer Question   |  Aug 5 2009  10:36 AM GMT
SQL Server 2005, SQL Server Query, SQL Server tables
asked by Kotnimahesh

  5 pts.

How do I get the value of a lookup field stored in nvarchar field

I have a list with a lookup field which is being stored in an nvarchar column. I'm trying to access the value in a Sql Server query, but what comes back is this: ↓ ъ䅃㒳ꅉ I've tried converting this column to every data type there is, and no success. Please help!! Thanks...

View Answer   |  Jun 30 2009  3:56 PM GMT
SQL Server, SharePoint, SQL Server Query
asked by 3300Metairie

  35 pts.

query for join

i have 2 tables unittypes,rules unittypes has unitid and description unitid description A1 description1 A2 description2 A3 description3 rules has id unitid 1 A1,A2 2 A1,A3 i am trying to get it to get a resultset like 1 ...

View Answer   |  Jun 1 2009  12:50 AM GMT
SQL Server Query, SQL Server tables, JOIN statement
asked by Rampradeep

  5 pts.

Optimize the query in sql server

CREATE VIEW [dbo].[vwResults] AS SELECT r.ResultsPK, b.PersonID, dbo.ltcPerson.FirstName, dbo.ltcPerson.LastName, dbo.ltcPerson.PersonFriendlyID, b.DateCreated, b.FormName, r.FieldName, r.ValueString, r.ValueNumber, r.ValueDate, r.ValueTextInt, r.ValueBit, b.UserID,...

asked by Rajupatil

  5 pts.

Querying database tables with their descriptions

I want to query an SQL server database for specific tables and their descriptions. How do I do that? Is there a special tool needed to do this?

View Answer   |  May 11 2009  10:01 AM GMT
SQL Server Query, SQL, SQL queries
asked by Sheni

  5 pts.

Substract two fields SmallDateTime at SQL Server

Hii.. IT Professional Helper, may i asked 1 question and hope IT Professional Helper can help me to answer my question? The Question is : Cm.CommandText = "Update Reminder Set IsDatang = 0, IsValid = 1 Where TglReminder - TglDatangKembali > 7" Cm.Execute If i get the error : Arithmetic...

asked by Suryanto

  5 pts.

Execute a view/query is slower in SQL Server 2005 than 2000

Hi, I have migrated a database from 2000 to 2005, updated the statistic and rebuild the index. When I run the following query "select top 500 * from myview order by name", it is extremely slower in 2005 than 2000. The myview simply does an inner join with 2 table. The name is varchar(50)....

asked by Db23

  230 pts.

Link microsoft SQL server to Active Directory

I am getting an error while running a qurey for excuting against OLE DB provide'ADSDSOobject' Please advice Thanks Rajaa

Answer Question   |  Apr 23 2009  3:34 PM GMT
SQL Server 2000, Active Directory, SQL Server Query
asked by IT4

  5 pts.

Improving performance on a large SQL Server database

We have a very huge SQL Server database, with approximately 700GB of data. Due to this, queries are running very slow. Could you please suggest few tips to improve performance?

View Answer   |  Apr 20 2009  2:46 PM GMT
SQL Server, SQL Server databases, SQL Server Query
asked by SQL Server Ask the Experts

  2445 pts.

Viewing distinct records in a SQL query result

I have a set of records in a SQL query result. I only want to see one record, per the data field "ID". I am getting 2 records for some ID's, as there is one field that is different in the 2 records. This happens even if I start the query out with SELECT, DISTINCT, and then all of the fields I...

View Answer   |  Apr 3 2009  5:48 PM GMT
SQL Server Query, SELECT statement, SQL Query
asked by SQL Server Ask the Experts

  2445 pts.

Searching for a T-SQL query to find data from multiple SQL 2005 servers

I need a T-SQL query to find a list of all database names and sizes from multiple SQL 2005 servers that are connected in a local network. Does one exist?

View Answer   |  Mar 18 2009  3:28 PM GMT
SQL Server 2005, T-SQL, SQL Server Query
asked by SQL Server Ask the Experts

  2445 pts.

SQL to insert comma-delimited string value to table column

I have string like '1,2,3,45,6,7,8' I want to insert each comma separated value in a table column...my output look like this: COLUMN 1 2 3 45 6 7 8

View Answer   |  Mar 18 2009  6:38 AM GMT
SQL Server Query, Comma-delimited, SQL queries
asked by 23121983

  5 pts.

Running a query on both SQL Server and Oracle databases

How do I run a query that queries a SQL Server database and an Oracle server database, on two different servers, and uses all the data?

View Answer   |  Mar 3 2009  7:47 PM GMT
SQL Server Query, Oracle, SQL Server databases
asked by SQL Server Ask the Experts

  2445 pts.

SQL Server 2005 Text Function

Hello I have used text-function of SQL server 2005. I have ran my codes on a table with 800,000 records to serach for some specific words ( a list of 3milion words) in that. it took about 4 hours to be executed. Now I have some part of that table ( 1/8 of that including 100,000 records). I am...

asked by Monadba

  5 pts.

SQL Server Query Help Needed

I have a table with Inventory transacation records. The table contains both Shipment (outgoing) and Receiving (incoming) transactions. I'm trying to write a report that lists both Sales Orders that result in Shipment records and Purchase Orders that result in Receiving records. If I link the...

View Answer   |  Feb 5 2009  10:39 PM GMT
SQL Server Query, SQL queries, SQL Query
asked by Arlin

  70 pts.

To retrieve records from SQL Server database

Hello All, I have a requirement with sql server. Please find below the same. In database say we have a column named "Name" in a table. The records that are available in the table are say like Column_Name = Names Lean Metric Sequence Lean Operation Metric Lean Cleaning and so on.... Now,...

View Answer   |  Feb 5 2009  3:35 AM GMT
SQL Server Query, Query optimization, SQL
asked by Pichha

  5 pts.

Explaining a SQL query

I have a query for finding the fith lowest salary in a SQL database, and I am not able to understand how this query will be processed internally. It is: select * from emp a where 5= (select count(distinct sal) from emp where a.sal>=b.sal) Can you explain this to me?

View Answer   |  Dec 29 2008  7:54 PM GMT
SQL Server, SQL Server Query
asked by SQL Server Ask the Experts

  2445 pts.

Joining Tables in SQL Server

What is the difference between Outerjoin and Left outerjoin.

View Answer   |  Dec 19 2008  10:23 AM GMT
SQL Server development, JOIN statement, SQL statements
asked by Bijaybehera29

  15 pts.

Writing a query to store an image file in a SQL Server 2005 table

How would I write a query to store an image file in a SQL Server 2005 table?

View Answer   |  Nov 11 2008  7:02 PM GMT
SQL Server 2005, SQL Server tables, SQL Server Query
asked by SQL Server Ask the Experts

  2445 pts.

Outputting results of SQL SELECT statements into a spreadsheet

I am using OPENROWSET to output the result of a number of SQL SELECT statements into a spreadsheet. It works for most of the SELECT statements, but there are 4 random queries out of 82 that take more than an hour to execute. This is the code: insert into...

View Answer   |  Nov 7 2008  8:54 PM GMT
SQL Server, SELECT statement, SQL Server Query
asked by SQL Server Ask the Experts

  2445 pts.

1 - 20 of 21
<<PREVIOUS 1|2 NEXT>>