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 > january 2006 > threads for tuesday january 24

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

pass a value other than a recordset from a stored proc
Posted by Marcel at 1/24/2006 10:41:02 PM
Ok I need to pass a value bask the my program that isnt the result of a query "but is the outcome of a query" for instance: if exists (SELECT email, phone FROM users WHERE (email = N'jim@jones.com') or (phone= N'1234567')) return the vale true else return the value...more >>


using a result of one query to select the next query in a stored p
Posted by Marcel at 1/24/2006 9:29:01 PM
What I want to do is call a stored procedure that checks is acondition is true of false and if true do a different query if true do and update etc something like select field1, feild2 where field1=1 or field2=2 if the_result=true update field1,feild2 (3,4) if result=false do som...more >>

Full Text Search
Posted by tshad at 1/24/2006 5:38:39 PM
I am using Sql Server 2000 and am using Full Text Search. There have been some questions on how it works as far as latency of the data. We need to be pretty up to date and the records change quite often. Is this a problem with Full Text? My boss doesn't want it to be an hour behind, wh...more >>

Is VS2003 usable with SQL2005 or not?
Posted by David Norman at 1/24/2006 5:30:09 PM
VS2003 in theory only works with .Net Framework 1.1, and SQL2005 is bundled with .NET 2.0. This is supposed to be the reason why I can't create a VS2003 asp.net project that references a SQL2005 dll. However I've successfully created SQL2005 integration services and analysis services projec...more >>

SELECT COL_NAME(@TableId, @ColumnId) FROM Departments DOES NOT WO
Posted by Juan Dent at 1/24/2006 5:24:03 PM
Hi, I need to access a certain column, whose name varies - suppose it is a parameter of a stored procedure. I thought obtaining its name as in COL_NAME would give me the value of that column, as in: SELECT COL_NAME(@TableId, @ColumnId) FROM Departments Yet, all I get is the NAME ...more >>

Delete SQL Query - Brain Hurty
Posted by superfreaker NO[at]SPAM gmail.com at 1/24/2006 5:14:20 PM
It's been a long day and I can't get this one right! Ugh!!! Should be an EASY one... Two tables: Sales (IdProduct) StoreListings (IdProduct) I am trying to remove all items from our StoreListings database table that have not had more than 15 sales, that is, they do not have more than 15...more >>

SQL Server vs. Access
Posted by Alex C. Barberi at 1/24/2006 4:37:30 PM
What is the main difference between SQL Server and an Access database? I've used Access before lots of times, but I know nothing about SQL Server. What is SQL Server? Can I install SQL Server on my Windows Server? -- Alex C. Barberi Chief Executive Officer VisionForce http://www.visionfo...more >>

SQL count problem
Posted by casey NO[at]SPAM mtpinternet.com at 1/24/2006 3:29:10 PM
The problem that I'm having is that when I try and add the count(*) into my SQL statement it will no longer find my record. Set rsAllJobs = Server.CreateObject("ADODB.Recordset") ' set up recordset strAllJobs = "SELECT COUNT(*) AS theCount FROM tbl_jobBank" rsAllJobs.open strAllJobs, cn <%...more >>



Cascade delete relationship slower?
Posted by Dan at 1/24/2006 3:18:18 PM
I have several related tables that have the cascade delete option selected in their relationships. There is one parent table that all the child tables relate to (sometimes many layers deep). In order to allow deleting of a parent record I have created a stored procedure that goes through the ...more >>

Generate row number in query
Posted by Tales Mein at 1/24/2006 2:55:24 PM
How can I Generate row number in query Thank you ...more >>

insert into longvar
Posted by Gonzosez at 1/24/2006 2:23:55 PM
I have the following table..... PART_ID VARCHAR TYPE CHAR BITS LONGVAR BITS_LENGTH INTEGER Part id is a string type is what type in my case t for text bits insert text bits_leng...more >>

Get column name and value
Posted by Tales Mein at 1/24/2006 2:21:53 PM
Hi i need a query that returns a column name and its value Like if the column name were "Book Description" And the Column Value were "Long History of Short People" The results would be "Book Description: Long History of Short People" Thanks ...more >>

JOINS and WHERE clause
Posted by dreamer NO[at]SPAM gmail.com at 1/24/2006 1:00:04 PM
hello, I was curious and wanted to know if there was a difference between the following statements. SELECT FirstName, LastName FROM Person INNER JOIN Address on Person.PersonID = Address.PersonID AND Address.AddressType = 'Home' and: SELECT FirstName, LastName FROM Person INNER JO...more >>

Ignore Some Errors
Posted by ford_desperado NO[at]SPAM yahoo.com at 1/24/2006 12:43:48 PM
I apologize for multi-posting, I realized that I originally posted to an almost inactive group In my stored procedure I'm calling a buggy and flaky stored procedure that comes from a third party. When I run my stored procedure from QA, I'm getting a whole buch of errors raised inside the third...more >>

Query help
Posted by Rick at 1/24/2006 12:40:04 PM
I have a table with the following structure CREATE TABLE [dbo].[TS] ( [Datetime] smalldatetime NOT NULL , TSFBR1 real null, TSFBR1On tinyint ) Data set is: Insert into TS values('2005-01-01 00:00:00', 23.4, 12) Insert into TS values('2005-01-02 00:00:00', 25.4, 23) Insert into TS...more >>

possible to select top 5 * of 2 or more individual criteria?
Posted by Rich at 1/24/2006 12:16:03 PM
Hello, I want to select the top 5 * from tbl1 where substring(fldx, 1, 1) = 'T' but in the same output I also want to include select top 5 * from tbl1 where substring(fldx, 1, 1) = 'S' I have thousands of rows where fldx starts with 'T' and 'S'. Is it possible to select the desired ro...more >>

Returning values from a stored procedure - Help needed!
Posted by ROBinBRAMPTON at 1/24/2006 12:03:01 PM
Hello everyone, I'm using the following procedure to return the result of a zip code radius search at my website. As it is, the proc is working fine except I'm having a problem returning a value for the distance between 2 points. The procedure calculates the distance between the 2 points and ...more >>

Change how command runs
Posted by MKruer NO[at]SPAM gmail.com at 1/24/2006 11:40:47 AM
This should be an easy one. I want to change the command to use the DBID number instead of the database name to run the process. The current loop does not keep the order if you add or remove databases beecuse i am using the min() function. DECLARE @sql varchar(4000) DECLARE @db varchar(64) S...more >>

need help to write query
Posted by yoshitha at 1/24/2006 11:19:27 AM
Hi all i want the query ,so first look at the tables classes table classid (Primary key) class name cld01 first classe cld02 2nd class cld03 3rd class staffdetails staffid (PK) name sta01 ra...more >>

Complex SQL Query
Posted by JP SIngh at 1/24/2006 11:05:11 AM
Hi All We have search page and want to query the database with search terms entered. The table details are like this TapeRecords ID (Primary Key) ItemTitle Location Country Keywords TapeLogDetails ID (primary key) TapeNumber (Related to TapeRecords.ID) Description What ...more >>

Computing a Grand Total
Posted by Paul at 1/24/2006 11:04:59 AM
I have inherited a table that has entries such as: AccountName, [Invoice No], [Sales Price] Qty, etc... I would like to have a SubTotal and GrandTotal. So, I have a select statement something like this: Select AccountName, Qty, [Invoice No], [Sales Price], [Sales Price] * Qty as SubTotal ...more >>

Control jobs using SQL code?
Posted by Test Test at 1/24/2006 10:40:50 AM
Is there a way (system stored proc) to schedule/reschedule jobs through SQL code (stored procedure) instead of GUI? We have a job set up on SQL server and we are trying to control scheduling piece of it through stored proc. Any help would be appreciated. Thanx! *** Sent via Developersdex htt...more >>

Failover and detecting cluster switch
Posted by Arjan de Haan at 1/24/2006 10:34:06 AM
Hi. Not sure if this is the proper newsgroup to ask, but I could not find any other resources on this. I've been asked to examine how the software package my company sells (industrial automation) could be used on SQL Server running on a cluster. Currently we use SQL Server as backend, bu...more >>

purge process from large table
Posted by Pedja at 1/24/2006 10:27:31 AM
Hi, We have specific request here: there is a large table, around 5,000,000 rows (3GB). It has unique clustered index, created on 6 of it's 10 columns. We have to delete around 15% of rows every day, but in a way that table keeps being available all the time. Deletion criteria is date (where ...more >>

deadlock
Posted by javad ebrahimnezhad at 1/24/2006 9:49:53 AM
hello im inserting some records from access file to sql server table with for loop but oafter inseting some records i get this error please help me thank you [Microsoft][ODBC SQL Server Driver][SQL Server]Transaction (Process ID 87) was deadlocked on lock | communication buffer resource...more >>

Complex Query to Create View
Posted by Tomislav at 1/24/2006 9:44:49 AM
Hello Everyone... How in the world does this query work? It is used to create a view, but I've never seen so many mismatched JOIN pairs, and trying to decipher them is difficult. I've looked at the design view, and also the query execution plan and the showplan_text/all also, but I am no ...more >>

simple select
Posted by Jayyde at 1/24/2006 9:33:03 AM
This is the SELECT getting passed to my SQL server. For some reason it's not liking it: SELECT DISTINCT iCheckNumber, dtCheckDate, decCheckAmount, sCheckStatus, FROM tblAccountRIPCheckHeader WHERE sCheckStatus = 'C' This is the error I'm getting in my event log: Messag...more >>

Query In-between Dates
Posted by Ken at 1/24/2006 9:05:02 AM
I have a [StartDateTime], and a [EndDateTime] I need to query a date in between this the start date and end date For example, Start date was Monday, and End Date is Friday. But I just want to query just for anything Tuesday. I’m doing % Uptime for Tuesday it ran 100%. If anyone can help. Tha...more >>

Calling VB dll method: sp_OAMethod Error
Posted by Eric at 1/24/2006 8:40:03 AM
I have VB dll with a few methods that I need to access from my database. Here's the code w/in sql server: DECLARE @retVal INT DECLARE @comHandle INT DECLARE @errorSource VARCHAR(8000) DECLARE @errorDescription VARCHAR(8000) DECLARE @retString VARCHAR(180) ---------------------------- --INS...more >>

Left Outer Join Question When One "ON" Value Empty
Posted by RitaG at 1/24/2006 7:51:04 AM
Hello. I'm inserting rows into a table (OutTable), picking up data from 2 tables. InTable1 is the main table and InTable2 contains 2 columns, one column (column1)equates to a value in Intable1 (Provider_Type1) and the second column (column2) is the value I insert into OutTable. I'm using ...more >>

Creating Summary Table - from multiple tables
Posted by AS400 Guru at 1/24/2006 7:35:20 AM
I have a report database server which is accessed by thousands of customers. I am wanting to make a summary table of some of our most accessed information. I was wanting to create a indexed view but it has so many limitations that I am unable to use it (no unions, subqueries, outer joins....) ...more >>

How do I do this query
Posted by niv at 1/24/2006 5:34:02 AM
I have 3 tables Users Customerid - guid userid - varchar customertoworker customerid - FK workerid - FK extract customerid - guid data layout extract EACFF367-8E73-4C4C-A9A7-036A0D7E57AB customertoworker EACFF367-8E73-4C4C-A9A7-036A0D7E57AB, 90ED4230-2711-4019-A2AD-071D52...more >>

[SQL2005] Binding defaults without using sp_bindefault
Posted by PaulSand at 1/24/2006 3:51:04 AM
The SQL2005 documentation states the sp_bindefault will be gone in the next version and the DEFAULT keyword should be used with CREATE TABLE or ALTER TABLE statements. But I seem to have run into a situation where that only the stored procedure approach works. script 1: CREATE DEFAULT abc ...more >>

Dynamic Data
Posted by John Smith at 1/24/2006 2:33:02 AM
Thanks for reading this post. We have an application that can import data from various sources containined in various formats. This data is to be stored in one table! How do we handle this scenario? The only way I could think of is to have a generic table with columns called columnName, string...more >>

Could not execute query against OLE DB provider 'MSIDXS' Error
Posted by savvy at 1/24/2006 2:04:01 AM
I have created a stored procedure for searching particular keywords in a MS Word or PDF docs using Index Server and processes the results through the SQL Server. So, it links both Index Server and SQL Server When I execute this stored proc from my ASP.NET page i'm getting this error. Could no...more >>

How to treat Database Snapshots as if they were one database?
Posted by Rich B at 1/24/2006 1:06:13 AM
Hi, I am considering various methods of creating a reporting database from our production ERP system, in SQL Server 2005, and one of the solutions suggested by the technical documentation is to create a database mirror and a sequence of database snapshots. These snapshots, of course, have dif...more >>

XML Data Type
Posted by Phil at 1/24/2006 12:53:02 AM
Hi. I am using SQL Server 2005 and I have found in many posts that there is an XML data type, I have created a table and tried to assisgn the data type xml to a column but it does not appear in the drop down, is there a reason for this? Thanks PD...more >>

sa password rules
Posted by Igor Solodovnikov at 1/24/2006 12:00:00 AM
SQL Server 2005 rejects empty or very short sa passwords. Where can i read formal definition of sa password rules. I writing setup application which will install SQL Server Express in command line unattended mode. So i need to check sa password for its stronginess prior to passing it to SQL...more >>

Developing for 2000 (SQL8) on 2005 (SQL9)
Posted by CJM at 1/24/2006 12:00:00 AM
We've started upgrading some of our servers to 2005 from 2000, and that includes my development machine. I slightly concerned that I will inadvertantly throw in some 2005 code in my 2000 databases which will screw up the destination database on deployment. Is there a way of specifying that ...more >>

Is Agent installed?
Posted by Igor Solodovnikov at 1/24/2006 12:00:00 AM
I use sqldmo library to manage both SQL2000 and SQL2005 instances. Is there any way to check if SQL Server Agent is available for selected instance?...more >>

optimistic locking
Posted by Stephan Zaubzer at 1/24/2006 12:00:00 AM
I am writing an Application which is connected to a database on MSSQl Server. For performing updates on a table I chose the way of optimistic locking using timestamps. I use a stored procedure for updating the values which returns either 0 or 1 to indicate if there was a conflict or not. If ...more >>

Encryption by Password
Posted by Leila at 1/24/2006 12:00:00 AM
Hi, 1) What kind of encryption algorithm is used when we use EncryptByPassPhrase function? 2) What's the difference between using "EncryptByPassPhrase" and "Symmetric Key" (when used with password) except that you can use other algorythms in Symmetric Keys? Thanks in advance, Leila ...more >>

help me with Paging problem sql server 2000
Posted by NS at 1/24/2006 12:00:00 AM
hello, I need paging of records using stored procedure, so that i dont need to fetch all the records in a dataset just to display a few (say 50 or 100) in a datagrid web control (asp.net 1.1). I am new to writing sql scripts but i 'ld come up with a solution using ROWCOUNT. ( thanks to l...more >>

Hierarchical data with any DataReader
Posted by Christopher at 1/24/2006 12:00:00 AM
Hello, I have two problems to resolve with .NET 1.1: 1. I search the good way to read hierarchical data with a SqlDataReader. I don't know if it's possible. Must I use inevitably an OleDbDataReader with SHAPE ... APPEND ... 2. How read hierarchical data on the same table w...more >>

How to change server name in SQL2K ?
Posted by msnews.microsoft.com at 1/24/2006 12:00:00 AM
For some reason I had to change server name. I also created new registration in Enterprise Manager. When I try to retreive data, it still looking for my old server name. Where else should I change the server name . ? Thanks ...more >>


DevelopmentNow Blog