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 > may 2006 > threads for tuesday may 30

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 31

sql question
Posted by x taol at 5/30/2006 9:49:02 PM
i want to a query. SELECT MAX(fNum) FROM tTable WHERE fDate IN (SELECT MAX(fDate) FROM tTable WHERE fDate IN (SELECT fDate FROM tTable WHERE fDate IN (SELECT fDate FROM tTable WHERE (fRegion="Califo") AND (fProduct="G274") AND (fColor="Brown") AND (fDate<=#5/13/2006#)))) unfortuna...more >>


Accessing stored proc multiple return values
Posted by evs at 5/30/2006 9:38:45 PM
Hi, I have a problem. I have two stored procs. One I am building currently (sp_load) and another that is already in the data warehouse and which I have no control over (sp_log_event). sp_log_event is for control logging. It accepts a process name parameter. It outputs 3 return parameters by...more >>

Random error - Insert Into Table1 Select * From Table2
Posted by ausgoodman NO[at]SPAM hotmail.com at 5/30/2006 9:37:37 PM
Hi All SQL Server 2k gurus, I got random error when I try to run the following sp (seems always has problem when Insert into table when run this procedure in a loop to join several tables into one big table): ---------------------------------------------------------------------------------...more >>

word suggest
Posted by Howard at 5/30/2006 9:10:14 PM
In goold if you type in ditionary It will ask you if you mean to type the word dictionary. Is this something that can be done easily with a sql query? If not can someone point me to the right direction as to how to write something like this? Thanks, Howard ...more >>

Replicating Table
Posted by wrytat at 5/30/2006 8:02:01 PM
How do I write a SQL statement that can replicate table without specifying the data columns? For example, I have Table A with 12 columns, and I want to create Table B with exactly the same fields and data type. Is there an easy way out?...more >>

Queries with Dates
Posted by Tony K at 5/30/2006 7:49:05 PM
New to SQL. I'm trying to include 2 dates in a query. They query works, but not logically. I'm sure I'm missing something small. When the query runs, it doesn't include dates that have times later than 12:00:00AM. How do I get rid of that? SELECT dbo.Orders.OrderID, dbo.Orders.Cust...more >>

Question for changing results in sql
Posted by Lydia Moia at 5/30/2006 7:40:50 PM
I have to change the result for Mats(who has the apparatus id of 3) to a score of 8 for the student with the id of 6415(this student has the school_id of 5) *** Sent via Developersdex http://www.developersdex.com ***...more >>

Checking for duplicates
Posted by toedipper at 5/30/2006 6:55:56 PM
Hi, I have to run through a list of tables and check for duplicates. The tables have no primary key setup but we expect that there should be only 1 record for a combination of fields. So for example if I keep it simple and imagine there is a table called customers with loads of fields a...more >>



UDFs, Determinism and Constraints in SQL Server 2000
Posted by aspnyc NO[at]SPAM gmail.com at 5/30/2006 5:54:27 PM
I'm having problems with creating a UNIQUE constraint that references one normal column and one virtual/calculated column. The calculated column uses a user-defined function (UDF) to get its value, and the same UDF is used to create a CHECK constraint. Here's the code /* BEGIN CODE */ CRE...more >>

editor + VS 2005 ?
Posted by Jarod at 5/30/2006 4:51:57 PM
Hey What tool for T-SQL with Intellisense and other nice stuff will you recommend ? Preferably to use as add-on for VS 2005 but not as a must. Jarod ...more >>

Changing all Int to Bigint
Posted by YC at 5/30/2006 4:05:30 PM
Hi, We need to change all Int data types to Bigint. Considering the number of tables and View tables, changing manually one by one is not a option. Is there a nicer way of changing all (hundreds of them) in more automatic way? YC ...more >>

Need to select random records from a given query
Posted by Richard West at 5/30/2006 2:57:02 PM
I'm looking for a query that can return a random sampling of records meeting the where clause criteria. For example I might have a total of 5,000 rows that match my where clause, however I need to retrieve only 250 of these records - but they must be randonly selected. I need to be able to ...more >>

Copying a table form one database to another
Posted by dave m at 5/30/2006 2:42:46 PM
To be brief, I need to copy a table (schema and data) from one SQL Server (2K) database and to another SQL Server database on the same PC. With MS Access, I was able to use a SELECT INTO statement to move data between databases by the use of the IN clause to a newly created table in an extern...more >>

PIVOT ISSUE
Posted by Troutbum at 5/30/2006 2:02:31 PM
I have the following table structure and would like to pivot the data below. The table was comprised of raw data grouped to find the count. count question choice question2 choice2 ----------- ---------- --------- ------------ ----------...more >>

Update multiple records - SQL
Posted by Keith Kubicek at 5/30/2006 1:18:08 PM
Hello all, I have 95 records in room 1233 Code: -------------------- SELECT * FROM Inventory WHERE (Inventory.Room_No LIKE 1233) -- 95 rows- -------------------- I want to change them to room 132C: Code: -------------------- UPDATE Inventory SET Room_No ...more >>

Conversion of Char to SmallDateTime
Posted by Curious Joe at 5/30/2006 12:03:39 PM
I have a column that has date information in it in the following format: yyyymmdd I want to convert this information into and actual SmallDateTime column so I can use it for comparison etc. Some of the dates that are stored in this data are either blank or invalid dates because of bad user inp...more >>

Fast Query
Posted by Chris at 5/30/2006 12:01:03 PM
Hi, What's the fastest way of checking if a value exists in a table? How is this done in a production enviornment? Is it better ot return the result or a 1 or 0 as yes or no via an output parameter. I am currently using Create Proc test( @searchVal nvarchar(10)) as select id from tab...more >>

quarter date
Posted by jmann at 5/30/2006 11:54:01 AM
How can I calculate the first day of the quarter based on the current date? Ex. Today's date is 5/30/06. I'm trying to get 4/1/06. Thanks!...more >>

architecture question: not representing inheritance in the data model
Posted by PJ6 at 5/30/2006 11:35:16 AM
First up, I know I'll get some good answers here, but in general, are there any newsgroups devoted to overall application architecture? Second, sorry for cross-posting but in this case I think it's appropriate, I want to hear answers from both sides. Instead of representing inheritance in ...more >>

SQL help please
Posted by SteveInBeloit at 5/30/2006 11:35:02 AM
I am writing a stored proc where I need to net the quantities of transactions is a table. Each transaction is identified with a column telling me if the transaction was an "in" or an "out" of inventory. So for a particular item, I could have many in and out transactions. If it is an "in", I...more >>

Does a cursor re-execute the select statement everytime it loops?
Posted by Randy at 5/30/2006 11:01:01 AM
Does anyone know if a cursor re-executes the select statement averytime it loops to the next record? The behavior I have seen indicates that this is happening... here is my code... (trying to update a work order bit field at the end of that work orders records - the recordset contains seve...more >>

Help with Auto Notifications
Posted by Mike at 5/30/2006 10:47:26 AM
We currently have SMS dumping data into sql, and what we are trying do is when sms does an inventory it captures the amount of RAM and puts it in a sql table, it also keeps a history in another table. We have an issue were RAM is starting to be remove, so we are wanted to have a scheduled tas...more >>

linked server 2005 problems
Posted by Panos Stavroulis. at 5/30/2006 10:26:03 AM
Hi, I've got problem with configuring a linked server within SQL server 2005. I am trying to connect to SQL 2000. The link from 2000 to my 2005 server has worked fine. But not the other way. Also, the 2000 is linkable from other 2000 servers so seems to be specific to 2005 not a problem wit...more >>

Extra Trailing Whitespace Doesn't Violate Foreign Key Constraint???
Posted by Josh T at 5/30/2006 10:25:27 AM
Hello, The code below executes without errors on MSSQL 2000 - I would expect it to throw a foreign key violation error when the category with the trailing space is inserted into ProductTable. Can someone explain why this does work? This is an extremely simplified version of my actual db, and...more >>

Alter Table in Stored Procedure
Posted by JMM B at 5/30/2006 9:18:18 AM
Hi, The script in the stored procedure below works. But, when creating the stored procedure, I only see the first 'if'. There is nothing in there. I tried through Enterprise Manager as well. Anybody knows what could be causing this? Thanks, CREATE PROCEDURE sp_ImportKEYBANKAccountsFeed AS...more >>

Problems with ER in msde.
Posted by MariaGuzman at 5/30/2006 8:51:48 AM
Hi, I have a database that was created on sql 2000 standard edition. The system requiered to use remote servers so we decided to use msde. Checking the information that is in the database we discover that there is some information that is incorrectly. For example, we have two tables: table1 a...more >>

SSIS task
Posted by Shiva at 5/30/2006 8:33:18 AM
I hope I can do a good job in explaining the requirements this time. 1. I have about 100+ records in a batch that I download every 15 minutes. 2. I have over 200+ columns in these recordset. 3. I want to process one record at a time like a transaction. If all the business rules for that p...more >>

Can SQL search for a .txt document
Posted by Robert at 5/30/2006 7:00:21 AM
Good Morning, I am very new to SQL and I'm haveing a hard time codeing some automation. I'd like to look for c:\ftp\prod.txt every 5 minutes and when found, delete it and run a DT package that will import other .txt documents. Thanks Robert ...more >>

How do I returned most recently stored record with multiple records?
Posted by johannblake NO[at]SPAM yahoo.com at 5/30/2006 6:58:17 AM
I have a database that is part of a system where something in production gets tested. The operator can create a new test or retest something that has already been tested. If a new test is created, a new TestID gets stored. If something is retested, new test results are stored in the table but as...more >>

Can we update the table in user defined function
Posted by Veeru at 5/30/2006 5:26:02 AM
Hi, I want to update the columns of the table in user defined function in SQL Server 2005. Is it possible? Can you please suggest me the solution. Thanks in Advance. Regards Veeru...more >>

Update statement for linked server
Posted by SQLFriend at 5/30/2006 3:20:02 AM
How can I run an update statement to update a table in linked server from another sql server, I have table A on sql server and table B on linked server and I want to run an update statement that join the 2 tables and update a field in table B on the linked server. Thanks in advance,...more >>

Help with error 3274
Posted by William at 5/30/2006 2:52:37 AM
Could someone help me with this problem? when i try to import an paradox 3.x file with VBA. i get the error 3274 external tabel does not have the expected format. I can open the file in access. the code is this: DoCmd.TransferDatabase acImport, "Paradox 3.X", strPath, acTable, "00DevErr.db",...more >>

about store proc
Posted by amjad at 5/30/2006 2:28:01 AM
Hi i have store proc where i am excuting a query look like Select A.* From A where a.Col1=0 Or A.Col2='ABC' in this query the only problem is if A.Col1 result is null then it give me error message that timeout expired. the timeout period elapsed prior to completion of the operation or ...more >>

Parameter transfer over View on linked servers
Posted by Rainer at 5/30/2006 2:19:48 AM
Hello everyone, we have our own meta data listing, into which we store further information to tables and Views. By this construction, we are to be illustrated however forced all other data accesses over Views. Now my problem: If I liked to access a table of a Linked of server, I must provid...more >>

Obtain MCSE,MCSD,MCSA,MCDBA,CCNA,CCNP without exams(Pay after check results)100% passing gaurantee
Posted by All Certs At Ur DoorStep at 5/30/2006 12:03:10 AM
FRIENDS Here i m going to tell you the fastest way to get MICROSOFT,CISCO,COMPTIA,ORACLE,SOLAIS certified without efforts...... friends i have five vue and prometric testing sites here in INDIA.......so, i will do the exams on the behalf of the candidates, make them pass and charge some extra...more >>

Count results in colums instead of rows
Posted by Bart Steur at 5/30/2006 12:00:00 AM
Is it possible to show results of a COUNT in columns rather than in rows Example: Query: SELECT Code, Status, Count(Status) FROM MyTable GROUP By Code, Status returns: Code Status Count X33 0 312 X33 1 45 X77 ...more >>

Global Function in 2005
Posted by Carlos Sacristán at 5/30/2006 12:00:00 AM
Hi, I'm trying to create a global function in SQL Server 2005. I mean, a function similar to GETDATE(), that is public for all databases. This is possible in SQL Server 2000, but I don't find any similar in 2005 Thanks in advance -- -- -- -- Un saludo -- ...more >>

Return Last 10 records
Posted by Agnes at 5/30/2006 12:00:00 AM
For SQL statment, i got a seqno in the table (which is increment) , There are 1934 records in the database, How Can I selet the last 10 records ? thanks ...more >>

Help Me
Posted by Shailesh at 5/30/2006 12:00:00 AM
Dear Friends, I need to get the dates with the parameter passed. so i write the following procedure but it always give only one value. ...more >>

Sending simple email from SQL server
Posted by Justin at 5/30/2006 12:00:00 AM
Hello. What I am trying to do is to send a simple text email from SQL server. I need to run a sql script on a daily basis and after the script gets executed, I want SQL server to send me a simple text email whether it was done or not. Can this be done WITHOUT installing programs like Ou...more >>


DevelopmentNow Blog