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 > december 2005 > threads for friday december 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 29 30 31

Customer specific price matrix design (Long)
Posted by Annon at 12/9/2005 11:52:55 PM
Hi All, Not sure if this is the right group so feel free to point me in a better direction. Most of our customers have a personal price for every product but Im having a nightmare trying to produce a price matrix on the fly. I currently have a solution in MS Access 2K which uses a series o...more >>


Finding out if a table has changed?
Posted by Simon Harris at 12/9/2005 9:53:05 PM
Hi All, Is there any way to check if a tables data has changed, without checking the number of records and there values? I'm thinking perhaps some sort of server assigned serial number that changes when the data changes, or perhaps simpler a 'last updated' date for the table over all? ...more >>

2 variables 2 sql server connections?
Posted by Test Test at 12/9/2005 9:51:27 PM
Hello! DTS pacakge (2 connecttions): Source: Sql server name (abcd) Target: Sql server name (abcd) I have a DTS package that has two sql server connections (source and target). The server is same (abcd) for both source and target sql servers. I need to use global variable for the server n...more >>

trigger and INSERTED
Posted by shank at 12/9/2005 7:44:58 PM
I'm trying to setup a trigger. When a customer buys a package deal of goods, I want the trigger to populate OrderDetails with all the extra product. I realize that I have to use the INSERTED table to analyze one specific order, but when I drop the below code into place I get an error that INSE...more >>

COUNT (DISTINCT (myfield)) PROBLEM
Posted by Savas Ates at 12/9/2005 7:08:24 PM
it works well SELECT DISTINCT ([cinsiyet]) FROM URUNLER WHERE cinsiyet<>'Bileklik' AND cinsiyet<>'Yuzuk' AND cinsiyet<>'Set' AND cinsiyet<> 'Kupe' AND cinsiyet<>'Bilezik' AND cinsiyet<> 'Kolye'; but i need to get recordcount of this query whis oledb.datareader doesnt say it to me......more >>

Windows Authentication vs SA Password
Posted by BCS at 12/9/2005 7:08:24 PM
I'm using SQL Server 2005 Express Edition for the first time for a Timeclock application I've written in VB6. SQL and the application itself will be installed on a standalone at a remote retail location for use by about a half dozen employees. While none of them are PC gurus, once and awhile you ...more >>

Restore database error
Posted by ninel g via SQLMonster.com at 12/9/2005 4:48:08 PM
I'm trying to restore a database and am getting the following error: "MODIFY FILE encountered operating system error 112(There is not enough space on the disk.) while attempting to expand the physical file. Could not adjust the space allocation for file 'MyFile_Log'. RESTORE database is termina...more >>

smalldatetime,varchar and CASE
Posted by James Carters at 12/9/2005 3:43:35 PM
Have a table with an end_date column (smalldatetime) where a NULL shows that the row is still active. I need to be able to show the status (when it closed, or present) so tried this and variations end_date = CASE WHEN CAST(jv.[end_date] AS varchar)IS NULL THEN ' present ' ELSE CAST(jv.[end_d...more >>



Comparing Queries via Graphical Query Execution Plan
Posted by Jeff at 12/9/2005 3:37:37 PM
Using SQL Server 2000 / QA: Using BOL and a couple of other sources I have been learning about the graphical query execution plans available in QA. I understand in general what the graphical plans show, what some of the common icons represetn, and how to read the plans in general. What I...more >>

is recordset open?
Posted by Les Stockton at 12/9/2005 3:37:02 PM
Someone told me how to do this before, but I can't seem to find it. I've got an ADO recordset. What attribute do I check to see if the recordset is open or not? ...more >>

Using SubString With a Select Statement
Posted by RitaG at 12/9/2005 3:26:02 PM
Hello, I've been battling with an issue for some time now and can't come up with a solution. I have a table (FSStacks) with just 1 column (FSStack VarChar(25)). The values of FSStack could be e.g. "ABCD", "EFGH:IJKL" I'm updating another table (PPOFSIDS) with the contents of FSStack but nee...more >>

select from mulitple databases and join
Posted by Paola at 12/9/2005 2:47:02 PM
Hello, Im a beginner and need assistance to select from two databases with a join. db 1 is docs db 2 is cd the below query works if i drop the 2nd select value but i want this 2nd value and join the databases by docname. Any ideas or is this not enough info? SELECT (docs.docsadm.profile.d...more >>

Verfy file path from SQL 2k
Posted by Ben at 12/9/2005 2:37:19 PM
Hi We have a number of documents references in our SQL Database and i would like to occasionally run a script directly from Query Analyser to identify missing documents. The database holds the UNC Path \\servername\sharename\document.doc Is this possible? Thanks B ...more >>

The command(s) completed successfully. - Can i turn this output off?
Posted by Immy at 12/9/2005 1:51:57 PM
Hi all, can i turn off the "The command(s) completed successfully." message that is returned after a proc is executed that returns no data? Thanks mmy ...more >>

Removing "special characters" from VarChar
Posted by Mike Austin at 12/9/2005 1:51:02 PM
My tables are being sent data from SPSS via SAS. It appears that one of these products is adding character(s) to my varchar columns. The character looks like a square. If I query the table in DB Artisan, the column looks like line feeds. IOW, the cell containing the data has one or more blank ...more >>

Limiting the amount of data used between two tables
Posted by seamlyne NO[at]SPAM hotmail.com at 12/9/2005 1:18:23 PM
Two tables: People and TestValues People ------------------------------ Name varchar(50) TestValues ------------------------------ TestString varchar(10) Insert into People (Name) values ('William') Insert into People (Name) values ('Blake') Insert into People (Name) values ('...more >>

How to configure the server notification in SQL 2005.
Posted by === Steve L === at 12/9/2005 1:17:28 PM
I couldn't find anything in the book online or tutorial addressing this question. Does anyone know how and what version of Outlook should be used? Thank you! ...more >>

"Simple" query help
Posted by Magnus Blomberg at 12/9/2005 12:16:41 PM
Hello! I would like some help to figure out how to write a specific update query. What I'm trying to do: I have one table with these columns: no (primary key or clustered?) object (primary key or clustered?) cid usergroup1 usergroup2 Lets say the table I would like to upgrade is calle...more >>

Converting table date
Posted by Jim Abel at 12/9/2005 11:52:02 AM
I am trying to to take data from a table where the Row data contains 24 columns representing hors 12 midnight to 11 PM see (sample below) into a table that puts 1 hour per row? Initial table Name Date 12Min 1Min 2Min 3Min … 11Min Mickey 12/2/05 625.4 153.2 84635â...more >>

IF Statement Syntax
Posted by Sherwood at 12/9/2005 11:41:03 AM
Greetings, I am having problems with the IF statement below and was wondering what I am doing wrong? Can you not assign the results of an IF statement to a variable? I am getting a syntax error when I try and run this code. MyVar = if (b.Branch_No = 'MCORP') Begin ...more >>

Query Analyzer usage
Posted by === Steve L === at 12/9/2005 10:58:17 AM
In SQL 2000, one can quickly generate the code for a table or stored procedure script by high lighting a table or a stored procedure (ctrl + c), then switch to a blank page in Query Analyzer (or any text editor) and paste it (ctrl + v). How this can be accomplished in SQL 2005? Yes, right cl...more >>

Error number table?
Posted by mikeb at 12/9/2005 10:56:49 AM
Where can I find a list of the error numbers, and their descriptions, that might be received through @@Error? ...more >>

Pass a "Begin...End" Block from ASP
Posted by creed1 at 12/9/2005 10:48:03 AM
Is it okay to pass a Begin...End block to Sql Server from an ASP web page? I have a situation where one of my tables contains the column names that I need to select from another table. I have always used two separate select statements (with two separate trips to the db) to get the values I n...more >>

Multi-language support question
Posted by Eric Margheim at 12/9/2005 10:19:58 AM
We have an MFC application that uses ADO, ATL components to communicate with a SQL Server 2000 database. Our application is currently English only and we are making the conversion to support multiple languages. The text in the application is read in from a table so translating the text it...more >>

Decimal data type
Posted by fniles at 12/9/2005 9:58:57 AM
If I create a column with data type Decimal(10,4), when a data is being stored in that column, will it format the data to be Decimal(10,4) ? For example: if I enter 1.5, will it be 1.5000, or it will stay as 1.5 ? When I tried it, it stays at 1.5. Thanks. ...more >>

Database Naming
Posted by Nancy Lytle at 12/9/2005 9:56:21 AM
am doing some testing on a database created by the programming dept of the company, they named the database '123v10'. When I run some queries (mostly admin stuff, checking the fragmentation, space used by the data and log files, etc) in the Query Analyzer, I often get the error message: Line 1...more >>

appending a temporary table to another temporary table
Posted by Mitch at 12/9/2005 9:31:04 AM
I need to append one table to another. The fields/columns headings are identical in both tables. How do I append one to the other using SQL (in Query Analyzer)?...more >>

Naming a database
Posted by Nancy Lytle at 12/9/2005 8:55:06 AM
I am doing some testing on a database created by the programming dept of the company, they named the database '123v10'. When I run some queries (mostly admin stuff, checking the fragmentation, space used by the data and log files, etc) in the Query Analyzer, I often get the error message: Li...more >>

Replace List
Posted by Eric D. at 12/9/2005 8:48:02 AM
Hi, I was wondering if SQL Server had a function similar to the ReplaceList() function in ColdFusion. If you don't know anything about ColdFusion, I'll explain what I need. I have a field that I need to verify for "bad" characters from a list and replace them with the "good" versions. ...more >>

SQL Server & MySQL from VB6
Posted by Les Stockton at 12/9/2005 8:39:02 AM
Are there any VB6 code out there that show how to access SQLServer and MySQL? I'm told to use SQL commands rather than SQLDMO so that it'll be generic and not tied to one database. Does anyone have code for this? I'm told that using SQLDMO can be slow on certain machines, and so I'm told to u...more >>

Realtive query cost in the execution plan
Posted by mEmENT0m0RI at 12/9/2005 8:21:35 AM
Hello everyone! I have a general question about measuring query cost while tuning queries. If I put both queries (the old one and the modified one) into the same batch, can I then use the query cost (relative to the batch) percentage number as a reliable way of measuring whether the performanc...more >>

Parsing spaces
Posted by Ryan D at 12/9/2005 6:50:02 AM
How do I parse out words from a field? Specifically I have a field which contains the full name of someone: first, middle, and initial. These words are all separated by spaces like so: John Abraham Adams How do I get just the first name "John" in a separate field and then get "Adams" in ...more >>

Finding and updating all rows with the same value in a column
Posted by Olav at 12/9/2005 6:35:02 AM
This integer column should be unique, så prior to altering it to unique i need to traverse all rows and update the rows with the same value. This table has another colun which is the primary key and when 2 rows has the same value the row with the highest value of the primary key will be updat...more >>

Another Way to Write this Query
Posted by Mike Collins at 12/9/2005 6:06:02 AM
In the following query, I will be making 6 joins for each ID in the Problems table to get a person's full name from our personnel table. Is there another way to do this than with the query I have below? Select TPRTitle, p1.FirstName + ' ' + p1.LastName As Originator, p2.FirstName + ' ' + p2...more >>

preparing monthly report
Posted by Renjith Chembakarayil at 12/9/2005 4:08:02 AM
hi ... i need a bit of help here .... ive the foll.. tables FIN_Transactions - TransactGID - TransactTime - PayModeFID - Amt FIN_PayMode - PayModeGID - PayMode - CC [bit] - Voucher [bit] - Cash [bit] FID's refer to fo...more >>

Delete duplicate entry
Posted by Manish Sukhija at 12/9/2005 1:39:02 AM
Hi guys, How can we delete duplicate entries in a table. please send me a query which delete duplicate entry from table....more >>

How to increase no of level of Direct Recursive Triggers?
Posted by Direct Recursive Trigger at 12/9/2005 1:26:01 AM
Table "ParentChild" saves data in following way ItemId ItemName ParentId RelationId ------- ------------- ---------- -------------- 1 Universe Null 2 Galaxies 1 1 .1 3 Planets 2 1.1...more >>

Multilingual database design
Posted by carolus at 12/9/2005 12:53:08 AM
Does someone know anything about best practices designing multilingual databases? Please comment on each of the following design practices for multilingual database design. Which solution do you recommend? 1=2E One column per string in a certain language in each table. "Create table title (id...more >>

Force a round() when it's below a 5?
Posted by __Stephen at 12/9/2005 12:00:00 AM
I have a sales tax function in my antiquated system. Someone decided to play it safe and over collect on sales tax. If your bill = 9.53 @ 9.25% your total would be 10.4115. My Tax in the system shows 10.42 How do I force the round up for reporting to Auditors when they want to query...more >>

SELECT (left join)
Posted by Petar Popara at 12/9/2005 12:00:00 AM
Is there any difference between this: SELECT a.Something FROM table1 a LEFT JOIN table2 b ON a.ID_Account = b.ID_Account AND a.ID_Contract = b.ID_Contract WHERE a.ID_Contract = b.ID_Contract and SELECT a.Something FROM table1 a LEFT JOIN table2 b ON a.ID_Account = b.ID_Account WHERE...more >>

Reposted - Troubles setting variables
Posted by Daren Hawes at 12/9/2005 12:00:00 AM
Yes. I need to set some variables from other queries in my SP that will be used in the final Select statement. This is the only one I need returned. I have modified the script as per other posts, but it still brings back 3 recordsets. Here is the current version.. ------ CREATE PROCEDURE...more >>

need help - SP to move data
Posted by MackS at 12/9/2005 12:00:00 AM
Hello I am trying to create a stored procedure to move a ROW from Table1 to Table based on a coditon. Eg. I want to transfer an item with ITEMNO = '001202' FROM currentstock TO old_stock table. I want to be able to pass the value for ITEMNO from my code which calls the SP. Please hel...more >>


DevelopmentNow Blog