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


all groups > sql server programming > november 2004 > threads for thursday november 25

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 29 30

How tough a project is this?
Posted by fwells11 NO[at]SPAM hotmail.com at 11/25/2004 11:28:00 PM
Hi there. First let me apologize for attempting to post this message a minute ago and somehow posting it before I had finished writing it. I want to create a web based software rating database. I have a number of objectives that I would need to achieve to make this a useable tool and some ar...more >>

How tough a project is this?
Posted by fwells11 NO[at]SPAM hotmail.com at 11/25/2004 11:07:19 PM
Hi there. Looking for some feedback before undertaking this project. My db knowledge and asp skills are beginner at best but with the assitance of an asp code generating tool I believe I could take a pretty good crack at this as long as I can get some help from time to time from the kind of ta...more >>

How to use a value from one recordset in another..?
Posted by Bane at 11/25/2004 10:43:38 PM
Im doing a select that should retrieve a name from one table and display the number of correct bets done in the betDB (using the gameDB that has info on how a game ended) I want the "MyVAR" value to be used in the inner select statement without too much hassle. As you can see im trying to get ...more >>

Column Order in Table
Posted by Leila at 11/25/2004 8:51:38 PM
Hi, I know that physical order of a column is not important in tables but I like to know if it is possible to force column order when I alter a table to add column or change the order later. It seems that the orders are stored in syscolumns table but I think there should be a system sp/func to ...more >>

How can I execute sp_helptext
Posted by George Meng at 11/25/2004 7:44:18 PM
Hi, 1) I just wonder why I can execute sp_helptext stored procedure when I am in NorthWind database. sp_helptext is in Master database. 2) Information_Schema.tables is a view, but why I could not use sp_helptext to look at it is schema. Thank very much! George Meng ...more >>

question on subqueries returning scalar value
Posted by Kevin NO[at]SPAM test.com at 11/25/2004 7:40:56 PM
I have a situation where I have a job master table (construction jobs), and two detail tables for job hours and job materials. So the data might look something like so... JobMast JobNumber 1 2 3 JobHours JobNumber Employee Hours Date 1 1 8 1/1/04 1 1 8 1/2/04 2 2 1...more >>

NULL values in foreign keys
Posted by Kevin NO[at]SPAM test.com at 11/25/2004 7:24:36 PM
I have a situation where an application is being built where NULL values appear in foreign keys. (It's not my idea, I'm trying to convince them otherwise). The situation is a history file that has both a customer and a sales rep column. In some instances, both are populated. However, in ...more >>

SP Parameter
Posted by Candy at 11/25/2004 7:23:32 PM
How can I pass and declare a string into the stored procedure that its where clause like below: select ... from ... where xx in (@input parameter)...more >>



Get List of Table names in database
Posted by msnews NO[at]SPAM microsoft.com at 11/25/2004 7:08:28 PM
Hi, Please let me know the query to list all the table names in a given database in sql server 2005. Best Regards Raghu ...more >>

Set parallelism OFF for a spesific prosedure
Posted by Geir Holme at 11/25/2004 6:36:51 PM
Hi. Is there any way I can turn off parallelism for one (or more) prosedures. I do have some prosedures I want to test without using prallelism. thanx all -gh ...more >>

Why is X<>X_1 not working
Posted by Jonas Larsen at 11/25/2004 5:39:05 PM
I have a join like this select len(t.area,3), len(t_1.area,3) from Table1 t join table1 t_1 on t.id=id where len(t.area,3)<>len(t_1.area,3) The problem is that I get lots of records where len(t,area,3)=len(t_1.area,3) which contredict the where clause. area is a varchar(10). Does any...more >>

A Question
Posted by Luis Felipe at 11/25/2004 5:12:42 PM
Hi, I need your help. There are a Function in Oracle and Fox that is PADL or PadR, this add a quantity of characters to the left or rigth, all depend which one you like, the parameters in this function is a string, the character that user likes to add (the normal are zeros and spaces), and...more >>

Trigger Problem
Posted by James Goodman at 11/25/2004 4:55:17 PM
I have the following trigger on a table: ALTER TRIGGER INS_UPD_TRG1 ON dbo.tblInspection FOR UPDATE, INSERT NOT FOR REPLICATION AS DECLARE @OldVal char(1), @NewVal char(1) IF UPDATE (priority) -- We only want to capture updates to the priority column BEGIN SELECT @OldVal = (SELECT ...more >>

Alter a Primary Key Column
Posted by Pierluigi Terzoli at 11/25/2004 4:36:51 PM
Hi everybody, I've a empty table with the column 'Id' as Primary Key. Can I modify it, setting Id as NO Primary Key ?? I need to do it because I decided to handle DB sync between peripherical DB and Server. After the first Sync, the server gives to the client its Location_Id and the Indentity ...more >>

Copying an running database
Posted by zarkas NO[at]SPAM hotmail.com at 11/25/2004 4:01:12 PM
Hi' Does someone have a script or stored proc that can copy a running database? i need to make a copy of it without shutting it down, so I guess sp_detach and sp_attach arn't an option....more >>

better way to do a comparison that can change?
Posted by Beverley at 11/25/2004 3:46:48 PM
I'm in the middle of creating a stored procedure and I have a lump of code that is repeated twice but with a very minor difference... if the bit variable @UseCalc is 1 I want to include another field in the query's WHERE clause. (Full current code at bottom of email) I'm sure it's silly (not ...more >>

Planning Dinamic Crosstab Quries
Posted by Oded Kovach at 11/25/2004 3:10:50 PM
Hello there I have 2 dimentional query: 1. TreatmentPerson 2. TreatmentType 3. Treatments amount I need to show this query as crosstab: Person as Columns Type as Row and the amout as the value. The amout of treatmentPersons is not constant. How can i create dinamic crosstab query for...more >>

Convert to Date.
Posted by msnews.microsoft.com at 11/25/2004 2:51:10 PM
Can some please tell me what SQL doesn't think is right with my syntax: create function fConvInt2Date ( @input int) returns datetime as begin declare @return_value datetime set @return_value = cast(substring(cast(@input as varchar(10)),1,4) + '/' + substring(cast(@input as varchar(10)...more >>

first day of quarter - function
Posted by Gene Vangampelaere at 11/25/2004 1:13:56 PM
Hello, I need a function that gets the first day of the current quarter. example : GetFirstDayOfQuarter(@date) must return the first day of the quarter Does such a function exists in sql server ? Can anyone give me some help how to create such a function ? thx!! Gene ...more >>

Copy a database using BACKUP and RESTORE
Posted by Heather Crow at 11/25/2004 1:05:22 PM
I am using the following in a stored procedure, the basis of which I copied from an SQL sample. RESTORE FILELISTONLY FROM DISK ='C:\SludgeXX.bak' RESTORE DATABASE SludgeTest FROM DISK = 'C:\SludgeXX.bak' WITH MOVE 'Sludge' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\data\Slud...more >>

Beginner question!
Posted by Jensen Bredal at 11/25/2004 12:53:46 PM
Hello Gurus, I have a situation where i think only triggers can solve my problem. The other problem i have is that i have nere written any such thing and my deadlines where passed. I need to to update a table when a new row is insrted in an other table. How can this be done? The other ...more >>

while loop
Posted by Munch at 11/25/2004 12:47:04 PM
I am trying to write a scrit that uses a while loop. Is there some special command I need to use in order to have it run error free? Here is my code: drop table #employee_dim go --first load before loop select distinct regimental as HRMIS_ID, ' ' as Given_Nm, Initials as Initial, ...more >>

Backup job for schema only
Posted by mttc at 11/25/2004 12:46:49 PM
sql 2000 I have DB that contain Stored Procedure and function, and some tables. How create a schedule job that scripting or backup schema only Without Data? ...more >>

one trigger for all tables - possible?
Posted by SÁRINGER Zoltán at 11/25/2004 11:21:49 AM
hi, is it way to create ONE trigger for insert,update,delete which can apply for all tables? is it a trick with stored procedures? There is two field in every table: "last modified" and "created" datetime fields. I want a trigger what set the values automatically... ...more >>

Add Value and null?
Posted by Anders Hansen at 11/25/2004 9:49:56 AM
How do i add two columns and always get a result - even if one of the columns is NULL. Is there some function I can use to this purpose? /Anders ...more >>

(query) Group and distributes data evenly based on duration of tasks to be completed
Posted by Dan D at 11/25/2004 9:45:54 AM
Here is an example of a table that keeps a list of tasks and the time it takes to complete them (in minutes) TaskID TaskName Duration_Minutes ------- ----------- ------------------ 1 Task A 100 2 Task A1 20 3 Task A2 ...more >>

Query output is always in UNICODE... need ANSI ... Help?
Posted by junque NO[at]SPAM oqs.com at 11/25/2004 9:27:16 AM
I'm using XP_Sendmail stored procedure to run a query and mail the results as an attachment in the resulting email. The process works fine except that the attachment (whatever.xyz) is apparently in UNICODE and the application that subsequently consumes the attachment (when double-clicked in the...more >>

Trigger**
Posted by maryam rezvani at 11/25/2004 9:26:05 AM
Hi I've a following trigger which is fired in update status and make all changes to a new table successfully,I've a question: I just want by changing the emp_name column in first table the emp_name in second table changes(this happen by login L1 which has permission to the destination table...more >>

Query Help
Posted by Paul Ilacqua at 11/25/2004 7:38:24 AM
This is a result set from a query that I need to find the LINE that corresponds to the MAX(BUILT) entry. IE for PART 48899 I need to return 8630. For PART 21908 I need to return 8650 ETC. Is there a way to do this without a cursor? The end reult set should be.... 48899 8630 21908 8650 ...more >>

Result of select statement into a variable
Posted by louise raisbeck at 11/25/2004 7:37:03 AM
Hi, I wish to obtain an incremented value while I am in a stored procedure. So I am trying to do this (sql somewhat simplified just to get message across). declare int @nextnumber set @nextnumber = select max((revisionnumber) + 1) insert into tblrevisions (revisionnumber) values (@nextnumb...more >>

Manage TRIGGER on BLOBs Field
Posted by PaoloRi at 11/25/2004 6:53:05 AM
Hi, Does somebody know how to make AUDIT with TRIGGER on BLOBs FIELD? Thank you for your help PaoloRi...more >>

Informations on sysprocesses
Posted by Solli Moreira Honorio at 11/25/2004 3:59:05 AM
Hi, I'm trying to create a baseline information of SQL Server consume using sysprocesses table. My ideia is to get one snap-shot of sysprocesses, after a few seconds (10 seconds) get a second snap-shot of sysprocesses, and get the diference of CPU, Physical IO and Memory Usage. But wh...more >>

query help needed!
Posted by Iffe at 11/25/2004 3:49:29 AM
Hello, i have very simple problem to ask.(I think). I have a table where I have next kind of data number end_date end_time 3734628 2004-11-23 10:03:50 3734628 3734628 2004-11-24 10:10:22 3738611 2004-11-25 13:06:50 3738611 3738611...more >>

Error 80040e14
Posted by M.L. at 11/25/2004 3:43:03 AM
Hi NG, I hope very much someone can help me or at least point me in the right direction here. I have a simple Stored Procedure and all it does is it adds 4 different indexes to a rather large table which is built daily. It has been running for 6 months now without problems, but today I foun...more >>

Finding the last month's results
Posted by ste.goddard NO[at]SPAM gmail.com at 11/25/2004 2:59:13 AM
Hi, How do I find records for the previous month, taking the year into consideration. So when its 01-01-2005 my query will be looking for 01-12-2004. (British date format) Cheers...more >>

Error 2758
Posted by Kevin Buchanan at 11/25/2004 1:25:04 AM
When I add a SQL Authenticated User, I get an "Error 2758" message - without any description. Any ideas? I am running SQL 2000 SP3a on my XP sp2 laptop. I am d/l the SP3a to try to re-apply the SP. -- -Kevin...more >>

problem with almost 2-3 GB records in a table
Posted by Hong at 11/25/2004 12:55:02 AM
I have a problem on doing searching in this huge table. I tried this statement - > select * from table_A where month(sales_date)='5' It took me quite long to retrieve the record, any help to increase the speed of the record retrieving? Cheers...more >>

Use link table to manage foreign key relationships?
Posted by Brett at 11/25/2004 12:09:55 AM
I am building a system that has 10 tables. Each table may relate to each other in varying ways. For example, lets say I have the following tables: Users Companies Employees Documents The relationships I want are as follows: Users > Companies (1 or many to many) Users > Employees (1 or...more >>


DevelopmentNow Blog