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 > september 2003 > threads for monday september 22

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

Query Help Required
Posted by Satish at 9/22/2003 10:27:28 PM
Hi All, I need help to build up a query. The situation is like this: CREATE TABLE tblTest(ID INT NOT NULL IDENTITY(1,1), Qtr INT, Year INT, Amount FLOAT) SELECT Qtr, year, Amount FROM tblTest Qtr Year Amount 1 2002 100.0 2 2002 200.0 3 2002 300.0 4 2002 400.0 1 2002 100...more >>

Update Query Help
Posted by Lontae Jones at 9/22/2003 9:59:25 PM
Hello, I have a table called Agent which has 2 columns (AgentID and Phone). My second table is Phone_Numb (AgentID and Phone) I AgentID's are the same in both tables. I need to update the Agent table with the Phone numbers in the Phone_Numb table. Thanks for all your help!!!!...more >>

How to update a DTS package?
Posted by GB at 9/22/2003 9:05:49 PM
Hello, I created a DTS package to export data to flat file. This DTS package based on a view. Could you please give me a hint how to update this package dinamically every time when I update the view? Is it possible from C# code? Thanks, GB ...more >>

Get first row in each group
Posted by Locus Adam at 9/22/2003 5:41:22 PM
Hi, I have data like: Student Score John 83 Eric 76 John 93 John 85 Eric 72 I want to retrieve each one's highest score like Eric 76 John 93 I say : select Student, Score from Test group by Student, Score Order ...more >>

Thanks Parkar, But I want to control it with program, How to do it?
Posted by MSNewsGroup at 9/22/2003 5:30:29 PM

remote query performance with GIUD/no-GUID
Posted by Kevin at 9/22/2003 4:49:49 PM
I have two queries: 1) select * from machine1.db1.dbo.table1 where [varcharfield]='sometextvalue' 2) select * from machine1.db1.dbo.table1 where [guidfield] ='a-guid' Query #2 performs a magnitude worse than query #1. It looks like SQL is pulling all of the data from the remote table t...more >>

Delete the referance records
Posted by Roy Goldhammer at 9/22/2003 4:27:44 PM
Hello there It seems to be wise that when i delete record with primary key all the records related to the table as foreign key will also be deleted. I can do this relation (as far as I know) when data in the foreign key and the data on the primary key are the same. But i can't do this whe...more >>

Proper Date Variable Syntax ??
Posted by AJACODE at 9/22/2003 4:25:10 PM
Using SQL2K I have an inbound Date Param @FiscalYear and it is a char(4) I want to use it in a Variable called Date Range Previously the code was written for use in Dynamic SQL so the whole things was written in a String context. What I am having trouble getting the correct syntax fo...more >>



Help!
Posted by Joe at 9/22/2003 4:23:18 PM
I have a query, < select means, type from estimates > means type ----------------------------------------- ---------- 9.4033847799714302E-3 1 1.1766968108291099E-2 ...more >>

Reporting/Denomalizing?
Posted by Kevin at 9/22/2003 3:34:30 PM
Folks, We're managing various types of transactions in our application, some of which have pretty complicated schemas. We've found, as the data in the tables increases, that some of our more complex reports are running too slowly. So we're starting to explore the idea of a separate table or d...more >>

get quarters Procedure
Posted by Mike at 9/22/2003 3:26:03 PM
Hi all, I'm stuck with it, I used 3 parameters: @fiscal_year, @last_quarter and @period Possible Values for @period : [1-4] possible values for @last_quarter : [1-12] so this procedure need to return two columns: quarter_year and quarter_mon let's assume that @fiscal_year = 20...more >>

Passing Parameters into Triggers
Posted by Ken Sturgeon at 9/22/2003 3:19:02 PM
I will be creating some "audit" tables that will essentially mirror some critical tables that will provide a snapshot of data before it's changed by a user. It's simple enough to get the db's user id if the table is updated directly from Query Analyzer or Enterprise Manager but I'm struggling wit...more >>

query analyzer : account connected with
Posted by John A Grandy at 9/22/2003 2:53:24 PM
sql-svr 2000 in query analyzer ... connected to an external sql-svr ... how to tell the account username used to make the connection? (assuming sql-svr authentication or mixed-mode authentication) ...more >>

XP_SENDMAIL
Posted by solex at 9/22/2003 2:18:37 PM
Hello, I have a job that runs a stored procedure that executes XP_SENDMAIL. It has in the past worked. I have tried to execute XP_SENDMAIL from SQA but it does not send any messages and states that the "command(s) completed successfully". As an operator I can send a test email from the pro...more >>

getting stored procedure resuts as text or executing SP to get data in cursor...
Posted by hiten at 9/22/2003 2:04:18 PM
Hi, I have created two SPs returning recordset. Now I want to get the resultset as text (column data as text using some delimiter). Do we have anything which I can use to get text output ? OR how can I check result set is having result?? script sample would be appreciated. Thanks i...more >>

Multiple Execute Statements
Posted by Alexander Dumas at 9/22/2003 1:51:19 PM
I can't seem to figure out how to execute an inner query (i.e., select @LastDate...), get the results, and use it in my final insert statement. What am I doing wrong.... Please help. ************************** here is all the code ******* drop table FetchLog go Create Table FetchLog (...more >>

generate sql script fails 2nd time
Posted by John A Grandy at 9/22/2003 1:50:05 PM
sql-svr 2000 i use enterprise manager to "generate sql script" ... i include all stored-procedures & all user-defined-functions ... i leave the "generate the DROP ..." and "generate the CREATE ..." checkboxes checked (as is the default) ... i connect query analyzer to the target databas...more >>

Yet another GETDATE issue
Posted by paulmur NO[at]SPAM bellatlantic.net at 9/22/2003 1:49:27 PM
I have a proc that looks like this: InsertEventRecord(@sEvent varchar, @sResult varchar,@dtData datetime, @sInitiator varchar) When I call it in Query Analyzer like this: exec dbo.InsertEventRecord 'FileImport','Success',GETDATE(),'System' I get the following message Line 1: Incorrect ...more >>

how to select rownumber?
Posted by M-R at 9/22/2003 12:52:03 PM
Hi I defined following table in SQL Server 2000, table1(f1 char(2)) and now I want to show following output(add record number): rownumber f1 --------- ---- 1 aa 2 ab 3 bb 4 bc how can I do it? I'd be thankful for any help. -- Using ...more >>

conditions within WHERE clause
Posted by Wayne Hui at 9/22/2003 12:27:55 PM
I tried to use CASE statement within the WHERE clause to set up different types of query but it does not seem to work. Am I doing anything wrong? Ex: ....WHERE indicator='Y' and case @type when 0 then 'num!=@type' else 'num=@type' end Sincerely, Wayne ...more >>

Alphabetical Order For Full Name Field
Posted by Jean Wang at 9/22/2003 12:21:16 PM
Hello, My name field in user table combines last name, first name and middle name. How do I return full name in alphabetical order like the following after typing search criteria "Smith". Smith, Aaron Smith, Aaron A. Smith, Aaron Brian ...more >>

Need help with multiple JOINS
Posted by BCS at 9/22/2003 12:16:41 PM
I am using the following code to import month to date transactions. Within the BOLDetail table I need some additional information about the Supplier, Product, and Carrier, which resides in the SupplierInfo, ProductInfo and CarrierInfo tables. I'm using the JOIN statement to access that informatio...more >>

how to "flatten" resultset
Posted by LJ at 9/22/2003 12:10:19 PM
I have a select statement which returns this: order_id prod 1 'Prod 1' 1 'Prod 2' 2 'Prod 2' 2 'Prod 5' But I really want the data "flattened", i.e.: order_id prod 1 'Prod 1,Prod 2' 2 'Prod 2,Prod 5' Does anyone have a good ...more >>

field length anomaly
Posted by Richard Gosling at 9/22/2003 12:07:05 PM
I am putting HTML as a string into a cell of a table which is set to Varchar (8000) for data type. This is read back by a stored procedure and used as the body of an html email. My problem seems to be that the database thinks that there are more characters in the string that there really are. ...more >>

Search in DataBase
Posted by vitalie at 9/22/2003 12:03:07 PM
Hi ! Is there a simple way to Search in all tables from MSSQL DataBase ? Thanks ...more >>

DateTime
Posted by André Almeida Maldonado at 9/22/2003 12:02:56 PM
When I create a datetime column, de field contains date and time, example: 10/10/2003 - 11:59:59 How can I create a column just date and a column just time???? ] How can I insert a datetime value??? INSERT INTO table VALUES (????????) Thank's And, please, see the "Inserted & Deleted" po...more >>

My First Stored Procedure
Posted by Jim Heavey at 9/22/2003 11:35:32 AM
Hello, I am trying to learn how to create a stored procedure (school project - not required to create a stored procedure, but thought I would give it a good try). I want to create a procedure which has a select statement which returns a number of rows. I am going to call this procedure from ins...more >>

sql server cannot start
Posted by welyngj at 9/22/2003 9:18:27 AM
&#25253;&#38169;1058&#65306;&#26080;&#27861;&#21551;&#21160;&#26381;&#211= 53;&#65292;&#21407;&#22240;&#26159;&#21487;&#33021;&#38506;&#31105;&#2999= 2;&#25110;&#23427;&#30456;&#20851;&#32852;&#30340;&#35774;&#22791;&#27809= ;&#26377;&#21551;&#21160; &#25105;&#27809;&#26377;&#25913;os&#30340;&...more >>

About JOBS
Posted by Leandro Loureiro dos Santos at 9/22/2003 9:05:51 AM
Hello everybody, How can i set the job result to ERROR? Thanks Leandro L S Vitoria - ES BRAZIL ...more >>

Need Help on Simple Query
Posted by alanraby NO[at]SPAM hotmail.com at 9/22/2003 8:38:24 AM
Hello, I have a table that has the following structure:- Ref, Product, Goods Value 1,Prod1, 50 1,Prod2, 60 1,Prod3, 20 2,Prod1, 25 2,Prod3, 5 2,Prod3, 19 3,Prod1, 5 etc. -------------- I need to produce a view that shows the highest product value in the reference e.g Ref, Prod...more >>

Best Practice
Posted by Julie at 9/22/2003 8:06:05 AM
Hello, We have copies of SQL Standanrd and VB 6. We would like to produce automatic report from our server on a nightly basis and was wondering about best practise. Thanks Julie...more >>

Application Log Clearing
Posted by Ginja at 9/22/2003 7:58:03 AM
Hi All, Does anybody know of a way to clear a systems application log from either TSQL or VBScript? Any help much appreciated. Thanks, Steve ...more >>

Pad Records with 0's
Posted by Greg at 9/22/2003 5:03:57 AM
Hi All I am trying to return all records with a length less than 8 with leading zeros. Below is an example of what I am trying to achieve: create table pad ( col1 VARCHAR(10) ) insert into pad values ('1') insert into pad values ('12') insert into pad values ('123') inser...more >>

Altering a computed column
Posted by Martin Kraus at 9/22/2003 3:11:55 AM
Hi, I have a table (30 columns, 100,000,000 rows, 10GB) with some computed columns. If I change the formula of a computed column (by the Enterprise Manager) it takes very long time (2 hours). Is it normal? Why? The column is not indexed and is without statistics. Thanks for answer Marti...more >>

C programming
Posted by Kay at 9/22/2003 3:00:02 AM
How do you compile c program to access the sql server data? Can it support embedded sql?...more >>


DevelopmentNow Blog