Archived Months
January 2003
March 2003
April 2003
May 2003
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
April 2008
August 2008


all groups > sql server programming > february 2007 > threads for friday february 9

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

Case sensitive variables SQL Express
Posted by David DB at 2/9/2007 11:30:57 PM
Hi, I suddenly ran into a serious problem. We installed a new SQL Express 2005 SP1 on a different server and now it seems to be case sensitive with the variables in stored procedures: -------------------------------------------------- ALTER PROCEDURE [dbo].[GetUserID] (@UserName varchar(5...more >>

SELECTing Rows to Columns - How to Get Column Alias From Table?
Posted by Bob Johnson at 2/9/2007 9:56:15 PM
Considering the following query which transposes rows into columns as desired; please notice that the column name aliases are "hard coded" (e.g., AS ABO, AS RHFactor, AS A1, AS A2, etc). Each row in the table Lookup_TransplantParticipantFacts contains the desired "column name" for the corre...more >>

SELECT within CASE within WHERE?
Posted by ana9 at 2/9/2007 9:46:30 PM
I am trying to use the following statement in order to automatically get data from the last period of the previous year if the period entered is 1. I do this to get data for the current period and one period prior. WHERE CASE @period WHEN 1 THEN ((SELECT period FROM TE_Period WHERE (date_cl...more >>

Necessary help-Date by languagein SQL server 2005
Posted by Nassa at 2/9/2007 9:14:06 PM
Hi all, I have a problem in converting date from English to the Persian(Farsi- Iranian Language-). By that I mean I want to change the calendar in SQL server 2005 from English Calendar to Iranian calendar. What should I do? Please help me asap. Thanks all, Nassa ...more >>

Counting Averages
Posted by Chamark via SQLMonster.com at 2/9/2007 7:30:40 PM
I have many students taking many assessment tests during a course. I want to average their scores and then be able to count the number of students that have scores in a range, i.e. 75-100, 50-75, etc. I would think there must be a way to count averages. I'm new at this and I am drawing a blank...more >>

How to return this result set?
Posted by brett at 2/9/2007 7:29:37 PM
I have a parent child relationship and want to it display in an aspx page. TableA 1 Folder1 2 Folder2 TableB 1 first 1 second 2 firstTwo And display in a type of tree structure: Folder1 first second Folder2 firstTwo I'm not sure how to return the result set(s) for th...more >>

how to parse a row
Posted by yaser at 2/9/2007 7:07:56 PM
Hi All; i want to know how to parse a row for example i make query ,i get some rows ,i wanna parse the se rows .....like if i get I LOVE YOU then i need I to be in one column ,LOVE to be in a nother next column ,YOU to be in another next coulmn.....so can i get the street number from a long ...more >>

Objects missing from database after RESTORE - NEED HELP!
Posted by sydney.luu NO[at]SPAM gmail.com at 2/9/2007 6:42:37 PM
Hi, I backed up my database using the following t-sql command: USE pwsk EXEC sp_addumpdevice 'disk', 'Backup-PWSK', 'C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\PWSK-BKUP.data' BACKUP DATABASE pwsk TO [Backup-PWSK] and restored using the following command: Restore database PWSK...more >>



Need A Query
Posted by yaser at 2/9/2007 6:02:34 PM
hi all; alright i have customerID ,order,orderDate......how to write a query to show what is the latest order a particular customer has ordered.... remember the same customer may have several rows in the table ,but they might not be organized based on the date..i need aquery to select the late...more >>

Short codes from the WHERE clause
Posted by culam at 2/9/2007 4:34:00 PM
Is there a way to make this WHERE clause more attractive, (less codes)? For your infomation, I am trying to extract data from history table. Thanks, Culam SELECT da.id, da.open_dt, ag.extract_dt FROM Deposit da JOIN Deposit_aggr ag JOIN da.id = ag.id WHERE (da.OPEN_DT = GETDATE() - 12 AND...more >>

help writing a query averaging and summing
Posted by mctclover NO[at]SPAM gmail.com at 2/9/2007 4:21:03 PM
I need some help writing a query summing up line items (units) on unique invoices and then getting an average unit per invoice. Any help on constructing the query would be greatly appreciated. ...more >>

Insert/Update Query in SQL Server 2000
Posted by Sean at 2/9/2007 4:01:00 PM
TableA MyID Type Val1 Val2 Val3 ID1 A1 V1 V2 V3 ID2 A2 V3 V4 V5 ID3 A1 V11 V21 V31 TableB Type Desc Comment A1 My Desc1 Desc1 A2 My Desc2 Desc2 A3 My Desc3 Desc3 MyNewTable: MyID Type Desc Comment Val1 Val2 Val3 ID1 A1 MyDesc1 Desc1 V1 V2 V3 ID2 A2 MyDesc2 Desc2 V3 V4 V5 ID3 A1 My...more >>

IsNull performance issues
Posted by Andre at 2/9/2007 4:00:27 PM
SQL 2k sp4 I'm trying to optimize a stored proc and am seeing performance issues with ISNULL and would like to know if anyone else out there has experienced the same, and what options I might have. I have a sproc that accepts multiple optional variables. An example of what I'm d...more >>

dynamic where in stored procedure
Posted by Aaron at 2/9/2007 2:29:26 PM
I have a view that looks like : col1 col2 col3 and in my stored procedure i want to have a parameter: @col varchar(20) = 'col1' and do something like this: SELECT * FROM view WHRE @col = 4 the procedure compiles fine but when I run it I get an error: ...more >>

sample thesis in database data mining
Posted by CharLi Solutions at 2/9/2007 2:19:31 PM
Hi All, i wish to do a thesis in sqlserver database data mining.Can anybody help me where i will get a sample thesis in data mining? Thank You. Regards Psella ...more >>

INSERT INTO <table> SELECT * FROM <table>
Posted by lee NO[at]SPAM digital-interactive.com at 2/9/2007 1:30:34 PM
Hello This is a good question and I'm not sure of the best route to take. I have two tables (5 million records in total). I do my select (joining on both tables) to get my record set. For this example my select returned 1 million records. I now need to insert these 1 million records into ...more >>

one table or two
Posted by lee NO[at]SPAM digital-interactive.com at 2/9/2007 12:57:05 PM
Hi Just a quick question, I have a SQL DB with 5 million records. These 5 million records are formed in two tables so if I want to get the whole record out in one hit I have to join the tables. My question is, with tables this big would storing the data in one table be faster? These are rea...more >>

Hi gurus, i have a question about SQLServer
Posted by lala4life at 2/9/2007 10:31:40 AM
Hi everybody, i have a problem with SQLServer 2000 I have an application that allow that the user send a SQL statement, I'm currently validating the input string should be only SELECT , i do that with LTRIM and then a substring of 6 character must be equal to "SELECT". (the user that conn...more >>

Determining if a user is logged into the database
Posted by Gary Johnson at 2/9/2007 10:12:32 AM
Our application supplies a bit of a front end to the user maintenance on the database, using SQL Server authentication. We don't allow some operations on a user, for example drop user, if that user is logged in. The procedure, under 2000, created a temporary table #tmp containing the columns...more >>

Updating Bit field
Posted by echernenko NO[at]SPAM gmail.com at 2/9/2007 9:40:33 AM
Hi everyone, I recently Upsized my MS Access2003 DB to SQL Server 8.0, ever since I did I wasn't able to update a bit field using stored procedures. Bellow is my Stored Procedure that I'm trying to use to update the "Ordered" Field CREATE PROCEDURE update_master_table (@ID int, @part...more >>

Tempdb Contention
Posted by Nitin at 2/9/2007 9:13:01 AM
How do we check Tempdb contention via scripts. I would like to be notified when tempdb is on the peak by email or some other communicaiton method. Every now and then we get a message the default filegroup is full on tempdb. ...more >>

View ordering
Posted by ST at 2/9/2007 8:39:12 AM
Is there any way to list the user defined views in the order of dependency. view1 might call view2. So it should list first view2 and then view1. ...more >>

Query Optimization.
Posted by jack at 2/9/2007 7:46:38 AM
Hi all Im creating the sp's which i have never created before. The length of sp goes to something around 800 - 1300 lines.. Im able to achive this but there is only one problem.. optimization The exection of sp takes lot of time and need to optimize.. The sp contants all the scenario l...more >>

Using multiple SqlConnection objects = penalty for performance?
Posted by the friendly display name at 2/9/2007 6:49:00 AM
Hello, I am planning to use three databases on the local SQL Server. DB1 will be for App1, DB2 for App2, and DB3 will hold tables, that both, App1 and App2 need to access. With applications I mean ASP.NET applications. Obviously, I need in App1 and App2 at least two SqlConnection and Sq...more >>

Query Help ( Suming info on one table and adding to another tables contents )
Posted by Mangler at 2/9/2007 6:08:31 AM
Ii dont know if I am on the right or wrong track, maybe someone can help. I have 2 tables, bt and inventory. What I need to do is add all the quantites in the bt table with yesturdays date to the quanties in the inventory table with yesturdays date. I am doing something wrong because if there...more >>

Equivalent Code for PIVOT Operator in SQL Server 2000
Posted by Manish Bafna at 2/9/2007 3:31:01 AM
Hi, just two days ago i have posted about this.what i want is equivalent SQL code for pivot operator(SQL Server 2005) in sql server 2000.I dont want to go for third party tool.Also it should be dynamic.That is no. of transformations(that is no. of rows to turn into columns) is not known bef...more >>

server naming fails on local system
Posted by Michel Posseth [MCP] at 2/9/2007 1:22:01 AM
Scenario We are currently developing a production system using VS.Net 2005 and SQL server 2005 we have a test system and a production database system in our programs we refer to the database as DbClorius so in test modus we simply change the host file of a system so that our program...more >>


DevelopmentNow Blog