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
August 2008
all groups > sql server programming > march 2005 > threads for friday march 11

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

Subquery as part of the search condition
Posted by a8ap NO[at]SPAM yahoo.com at 3/11/2005 11:56:38 PM
Hello All, I just started in developing a web based report application with SQL 2000 reporting services. While most data filtering requirements can be handled by simple parameters, there are some occasional special requirements. For simplicity, i have the idea of creating a table with "Filter...more >>


Need SQL that will return all records which include a particular value in a field
Posted by Larry Woods at 3/11/2005 8:12:56 PM
I have a situation where I have multiple records, let's say ORDERS, and I have a record for each line item included in an order. Now, I want to find all ORDERS that includes item A and item G, for example. An ORDER could include many additional items but the ORDER #'s that I want returns must ...more >>

Memory Usage
Posted by Emre Guldogan at 3/11/2005 5:26:18 PM
One of my friend's question: "When I get a big result by a query (such as 1M of rows), the memory usage of my system decreasing critically. What is the phenomenon that causes this behaviour?" Ok it is usual, because I can still observe the rows in the result pane below. But, Although I clos...more >>

db trigger to avoid duplication of row ?? how please
Posted by ~Maheshkumar.r at 3/11/2005 5:21:53 PM
I'm Maintaining an existing website. Many times user clicked the button twice, which results in duplication of row. now i cant do any modifications. but i can write an trigger to check any row with same data,time stamp etc. if so, then delete existing and insert new row with same data. but i do k...more >>

how to prevent float data type from rounding
Posted by Ted at 3/11/2005 5:09:28 PM
I'm querying SQL server from a vb.net application. This issue I'm having is that one of the fields in my query is of float data type, the thing is, when I retrieve the value it's rounded up. How can I prevent this from happening, I would like to get the float value as is in SQL. Any advice and...more >>

CASE in a VIEW
Posted by Craig H. at 3/11/2005 4:57:23 PM
Hello, I've have a query that I want to convert into a view... but it contains a CASE statement. Views will not accept CASE and I really need to use a case statement here because of the way the tables are structured. Am I doomed to creating a new (very messy) query that will suffice in a ...more >>

download files in DTS package
Posted by Joao Mossmann at 3/11/2005 4:48:54 PM
Hi! I need a help!! How to download files in DTS package? Tanks ...more >>

how to find out if a column has a default (sp_bindefault)
Posted by Jacobus Terhorst at 3/11/2005 4:46:28 PM
How do I find out if a column has a default bound to it (created with sp_bindefault)? ...more >>



help with division
Posted by Chris at 3/11/2005 4:13:03 PM
Hi, When I try this I get 0 select 580578/2401132 and ideas?...more >>

Backup
Posted by Joaquim Meireles at 3/11/2005 3:57:59 PM
I want to backup a database every day, but i want that at some point (ex. when there are 5 bakupsets) it replaces the previous backups, one at a time. Can you help me?? ...more >>

query help!
Posted by Owen at 3/11/2005 3:41:27 PM
Hello: I have one table that burn form a many-to-many relationship, and have the mahine_id and all it's states, like this: machine_id (int) state (int) -------------------------- 1 95 1 195 2 95 2 ...more >>

query help!
Posted by Owen at 3/11/2005 3:41:27 PM
Hello: I have one table that burn form a many-to-many relationship, and have the mahine_id and all it's states, like this: machine_id (int) state (int) -------------------------- 1 95 1 195 2 95 2 ...more >>

Time Query help
Posted by Peter Newman at 3/11/2005 3:33:03 PM
I May have not made my query clear earlier in the post 'Query Between Times' so i will try again beacuse most of the replys were date orinated. I am trying to establish if a given time is between two times ( open and closed ) , and return ) for open and 1 for cloded. The only way i know to ...more >>

Complicated join query - how is this done?
Posted by DWalker at 3/11/2005 3:20:34 PM
At least this is complicated for me. I hope it's not trivial for you experts! Accounts table has Acct_Number (unique), Client_ID, and Rep_Num. The rep num is the number that identifies the registered representative(s) on the account. (The client ID, of course, points to the client's name...more >>

Summing Problem
Posted by Emre Guldogan at 3/11/2005 3:03:40 PM
Hi, I've a summing operation which may face with an element set as all null operands. The problem is that when I try to sum such a set, sum() returns the value of null instead the zero which how I want the result when such a situation occurs. I've tried that... case sum(THE_FIELD) when ...more >>

Newbie: Creating a New table theough SQL/VB.Net
Posted by Steve at 3/11/2005 2:59:14 PM
Hi, I have the following question and I apologize if I am on the wrong group and/or the question is very simple and stupid. I have created two related (1-to-Many) tables: tblCodes tblMeasurements --------- ------------------ Code Date Unit ...more >>

Converting text to bit issues
Posted by Usarian Skiff at 3/11/2005 2:55:58 PM
I need to convert a text column to a bit in a select query. Backing up, in case there's a better way to do this: I have a varchar column that contains one of six letters. There are two that interest me (Q and A). I want my vb.net application to update changes back to this column. For my...more >>

Select statement help
Posted by Mike Leber at 3/11/2005 2:55:03 PM
I have a table that is structured as follows: Id Date --- --------- 01 20040105 01 19990101 02 20020303 02 19980101 03 20030101 03 19990101 03 19960101 I would like to create a table or view that will give me the record in each Id group...more >>

Generate linked series
Posted by PeterM at 3/11/2005 2:47:01 PM
Hi, I would like to generate the following: suppose we have the following table: Table1: Col1 Col2 a b a c d e f c d b Then the result should give the following series: b, a, c a, b, d a, c, f e, d, b b, a, c, f Anyone an idea what would be the ...more >>

File or assembly name Interop.DTS, or one of its dependencies, was not found.
Posted by Ollie Riches at 3/11/2005 2:31:55 PM
I am trying to execute a DTS via COM according to the KB article http://support.microsoft.com/?kbid=321525 but I am getting the exception "File or assembly name Interop.DTS, or one of its dependencies, was not found." which is obviously a file not found exception. I have sql server 2000 inst...more >>

External SQL functions exported by DLLs
Posted by Peter Sullvan at 3/11/2005 2:24:05 PM
We have a few rather advanced calculation routines developed in C++. Currently we are using a Sybase ASA database for our app. and these routines are accessible by so called external functions exported by a DLL (dynamic link library) that we wrote in C++. Sybase supports this quite nicely. T...more >>

Sheduled SQL jobs
Posted by ManuTop at 3/11/2005 2:09:01 PM
Hi, What I should review to ensure multiple scheduleed SQL jobs do not "collide" with each other? And if I'm running a stored procedure definition script how would I guarantee the definition could be "rolled back" in the event of problems? Thanks...more >>

Problem with Dynamic Where Clause
Posted by Mike at 3/11/2005 1:46:34 PM
I have a stored proc that accepts a varchar as a parameter. What is being passed in is one or more IDs in a comma separated list. (ie '123,567,789') In the where clause I want to pull are records where a value is IN the list being passed in. (ie. WHERE column IN (@Var)) When I run this sto...more >>

Configure SQL XML Support...
Posted by Thomas.LeBlanc NO[at]SPAM NoSpam.Com at 3/11/2005 1:45:01 PM
We have a Windows 2003 Server with SQL Server and IIS. I tried to use the SQL Server Configure SQL XML Support on IIS and can not get it to work. On my local machine, Windows 2000 Profression, SQL Server 200 and IIS, I have no problem.. Are there any articles that can help me with setting ...more >>

Easy query problem
Posted by Coffee guy at 3/11/2005 1:31:02 PM
Hello Experts- I would like a sproc to return a 1 row select with results based on the results of what it has found. For example say the following table were created by the sp: ID Name Dept 23 A 4 38 B 4 117 C 4 if the sproc could te...more >>

advanced query help needed
Posted by Denis at 3/11/2005 1:18:53 PM
I have 2 tables mvm_campi id_camp dsc_cam 1 desc1 2 desc2 3 desc3 mvm_prova id_prova id_camp desc 1 2 x 2 2 y 3 2 z 3 1 k Is there a way to...more >>

Dependencies within a transaction
Posted by Chakra at 3/11/2005 1:06:23 PM
If i were to have a dynamic SQL transaction, where i want to insert a record, and use the ID generated for this record, in a subsequent query in the same transaction , how do i do it ? Regards, Chak. ...more >>

slow local linked server query w/cursor
Posted by Ben at 3/11/2005 12:30:32 PM
I have 2 sql servers behind the same router, I made one a linked server from the other using the 192.168.2.x IP. I select from the linked server into a fast_forward cursor and fetch through it doing inserts on a local table. the inserts happen at 1 insert every 5 seconds...way too slow. w...more >>

Query between Times
Posted by Peter Newman at 3/11/2005 11:49:09 AM
i have two DateTime fields One called 'Open' and one 'Closed' . I need to know if a given time is inbetween the Open and Closed times ? ...more >>

How to handle this via looping?
Posted by Jack at 3/11/2005 11:29:03 AM
Hi, I got two tables, the first one is tblGeneral and the second one tblPersonal. Both are related via Id field. The data and structure for the tblGeneral is: ID Age Sex Race Name SS Salary 1 35 M Asian 2 40 M Black 3 42 F White while the data and structure for tblPersonal is: ...more >>

Table-Valued UDF
Posted by David at 3/11/2005 11:29:01 AM
A co-worker suggested that I read up on the UDF and that it might solve my current situation. And it will, COOL!!! HOWEVER, my UI-frontend is Access with linked SQL backend tables (except for the one table that i need). So, my question is... How can i call a Table-Valued UDF from within an A...more >>

Outer Join Help!
Posted by Arul at 3/11/2005 11:27:01 AM
The first query below returns 46 rows (correct result set) while the second one returns all of the records from app_type table. The second query is similar (atleast thats what I'm trying to accomplish) to the first one, difference being non-ansii statement. Can someone help me figure o...more >>

How to search stored procedure?
Posted by Sasidhar Parvatham at 3/11/2005 11:20:39 AM
Hi All, I would like to know whether there is a way to search a stored procedure either by name or by content? Any suggestion would be appeciated. Thank you, Sasidhar ...more >>

Error 22022
Posted by Munch at 3/11/2005 11:19:02 AM
I am trying to run a job, but SQL Server keeps popping error 22022 and saying that SQLAgent is not running. I have restarted the service serval times, but seem to be having the same issue. Anyone know why? Thanks ...more >>

Efficiency of BLOBs compared to file system?
Posted by Mike at 3/11/2005 11:06:07 AM
What is the efficiency (creat time, read/xfer time, long-term (fragmentation issues, etc.)) of SQL Server (out-row, I'm assuming) BLOB (type image) access compared to remote filesystem access? (NTFS using \\shares, probably.) Enviroment will be .Net 1.1. I'm planning at peak potentially creat...more >>

chng default loca where new DBs created?
Posted by Ron at 3/11/2005 10:52:50 AM
Hello, My workplace is upgrading Microsoft Access from 97 to 2002 which has the Access Data Project file that can create an addhoc Sql Server DB on the Sql Server computer on the fly from remote workstations. The wizard in the Access 2002 .adp file does not offer a location option where ...more >>

User Function in master database: why not?
Posted by doublebarrelledscissors at 3/11/2005 10:43:03 AM
According to Best Practices, it is not recommended to put user objects in the master database. I have a group of scalar functions that perform that simply format strings. They are shared by several databases. Because they don't belong to any particular database, it makes sense to me to put ...more >>

log file issues
Posted by HP at 3/11/2005 10:19:02 AM
I am having a problem with the size of my primary filegroup. I have the 'automatically grow' option turned on. I have 7GB free disk space.But still the log file complains that it does not have enough space to grow.Can anyone please help me out? Thanks in advance....more >>

xp_cmdshell / Proxy account problem
Posted by MAQ at 3/11/2005 9:33:55 AM
Hi, I have a script which uses xp_cmdshell to create certain log files on the harddisk. I can run this script easily through "sa" account. But when i try to run the script through another "sql user" i get the following error: Msg 50001, Level 1, State 50001 xpsql.cpp: Error 1326 from Logo...more >>

linefeeds in text fields extracted with substring
Posted by Thomas Holme at 3/11/2005 9:33:28 AM
Im running a query like select * from MyTable where SUBSTRING(MyColumn,1,300)='searchtext' MyColumn is th the text type. The text in MyColumn contains a lot of tabulator characters (TAB), carrige return (CR) and linefeed (LF) characters. Sometimes (but not often) when I run the query, ...more >>

unique creation of the SN
Posted by Filippo Bettinaglio at 3/11/2005 8:49:14 AM
Hya, I have a counter in a table, in a production line I have three stations that could generate a unique serial number base on the counter. To generate the SN I get the actual counter (SELECT), I increase the counter and I UPDATE the counter in the table. Simple! My problem is ...more >>

how to bind the datetime field to sql server 2000 in vc++ .net 200
Posted by JoseTA at 3/11/2005 8:31:17 AM
Please help me. I want to know how to bind the datetime field to sql server 2000 in vc++ .net 2003. my program like this: String* strArgs[] = new String*[10]; strArgs[0]= .. .. .. strArgs[9]= ??? datetime field problem here initialize. String* strSQL = String::Format(S"INSERT Transfe...more >>

Reached nvarchar(4000) limit in building SQL statement.
Posted by Steve'o at 3/11/2005 8:13:01 AM
SQL Server 2000 SP3a Im using a sproc to make a sql statement. The statement is built up and assigned to @SQL1 nvarchar(4000), then at the end of the sproc its runs: exec sp_executesql @SQL1 The problem is that I've reached the 4000 limit!! How do other people get round this, bearing in...more >>

Dates in a DTS
Posted by Billy at 3/11/2005 7:45:02 AM
I am running a DTS package and the dates are hard coded...which means I have to change the date each time I go to run it. I would like to change it so that it does it automaticaly...so when it runs, it takes one off the system date and transfers the data....so it only transfers the previous...more >>

Complex join?
Posted by PeterM at 3/11/2005 7:41:08 AM
Is there another way to resolve the following problem (instead of using a cursor for Tab1, especially if the table is "big"): Suppose you have the following table: Tab1: col1 a b Tab2: Col1 Col2 a c b d Or Tab2: Col1 Col2 a b c d Or Tab2: Col...more >>

Stored
Posted by Joe K. at 3/11/2005 7:17:02 AM
I would like to create the stored procedure listed below. If the CounterValue <> 0 then abort the stored procedure raise the error message "System Down". Please help me with this task. Thanks, Create Test_Counters AS IF NOT EXISTS (select CounterValue from counterdata Where C...more >>

Query Help
Posted by Peter Newman at 3/11/2005 6:11:07 AM
Declare @ACC varchar(3) DECLARE @COMMS Bit DECLARE @ORIG as Bit SET @ACC = '001' SELECT CASE WHEN EXISTS ( SELECT * FROM Table1 r WHERE r.Licence = h.Licence) THEN cast(1 as Bit) ELSE cast(0 as bit) END AS Communications, CASE WHEN EXISTS ( ...more >>

Looping in a stored proceedure
Posted by Kent Prokopy at 3/11/2005 5:33:01 AM
What I would like to be able to do but am not sure if I can is the following. I need to set a variable = to the results of a single field recordset: @X = select EmployeeID from Employees where DepartmentID = 1 Then I need to build a dynamic sql statement based on the above results. If the ...more >>

SQL AVG for Table with 10 Fields
Posted by Joe K. at 3/11/2005 5:01:03 AM
I would like to find a single Average daily value for fields a1-a10 in Table A for the hours between "09:00:00" AND "21:00:00'' Also would like to find a single Average daily value for field b in Table A for the hours between "09:00:00" AND "21:00:00''. Table A is sampled every minute (sam...more >>

problem storing Polish characters in my MSSQL
Posted by anonymous NO[at]SPAM discussions.microsoft.com at 3/11/2005 4:08:37 AM
Hi I have problems storing Polish characters in my MSSQL DB. Words like:=20 &#347;wie&#380;ych kwiat=F3w=20 do not get stored correctly The fieldtype is ntext. Hope you can help Ciao Edward...more >>

Question about Grouping rows in Select statements with joins
Posted by j055 at 3/11/2005 3:53:38 AM
Hi I am trying to use the select statement to return rows which have a MAX date and then associate the date with a Title field in the #c table. At the moment when I add the Title field to the Select list I am getting the latest date for each Title. How do I exclude the Title field form the ...more >>

Return two dates
Posted by NH at 3/11/2005 3:51:08 AM
Hi, How can I return the date for the Monday of the previous week and also the Friday of the previous week. This can be two seperate queries. For example, executing the query today (Friday 11th) will return 2005-02-28 and 2005-03-05. Does this make sense? Thanks Niall...more >>

INSERT INTO with DECIMAL
Posted by DEC at 3/11/2005 3:43:37 AM
Simple problem: CREATE TABLE Test (dec_col DECIMAL(5,5) NOT NULL); INSERT INTO Test VALUES (1.1); Error: Arithmetic overflow error converting numeric to data type numeric. How do I cast/convert my value to get it into the column? Thank you....more >>

Yukon Question
Posted by x-rays at 3/11/2005 2:25:03 AM
Can this be done in Yukon using T-SQL? declare @DB as nvarchar(100) declare @owner as nvarhcar(100) Select * from @DB.@owner.TableName Thanks in advance...more >>

Stored Procedures
Posted by Peter Newman at 3/11/2005 2:19:02 AM
Im currently trying to write a SP to do limit checking and other test for client banking files. one of the things i need advice on is that after the 'testing' is completed im returning a Varchar as an output parameter. Is it possible to fire off a DTS from the SP without the SP then waiting fo...more >>

Oracle vs SQL server ?
Posted by Arsalan at 3/11/2005 1:30:14 AM
In what way is SQL server better than Oracle Database server? ...more >>

Oracle's Merge equivalent of SQL server?
Posted by Arsalan at 3/11/2005 1:29:39 AM
What is the equivalent of Oracle's Merge statement in SQL server ? ...more >>

searching for a pattern
Posted by Anuradha at 3/11/2005 1:07:03 AM
Hi, I want to make a check against a column. The column should carry only alphabets, numbers and a hyphen. any help? thnks anu...more >>


DevelopmentNow Blog