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 > june 2007 > threads for thursday june 28

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

Does my character field have a number?
Posted by Jay at 6/28/2007 11:46:06 PM
I have field Field1 varchar(50) which may have both numeric or text values. If it is a number, i want to use its value else 0. Something like: SET x = 2.0 * IS_NOT_NUMBER(Field1, 0.00) --- WHERE IS_NOT_NUMBER() will work similar to ISNULL() ...more >>

What do you do when queries are running?
Posted by Pat at 6/28/2007 9:23:33 PM
Hi Friends, I am it's happening to most of you that while a query is running, let's say for 4-5 min, you don't have anything else to do just waiting till it is finished. most of the times it's becoming very boarding and frustrating to wait, specially if the data size is big enough to cause th...more >>

SQL problem...
Posted by Bauhaus at 6/28/2007 8:42:29 PM
Hello, I'm an Access/SQL novice and I have an sql problem: I have the following table Price: FuelID PriceDate Price LPG 1/05/2007 0,2 LPG 13/05/2007 0,21 SPS 2/05/2007 1,1 SPS 15/05/2007 1,08 And I have to make the following query: FuelID PriceDate_from PriceDa...more >>

Query Syntax assistance
Posted by at 6/28/2007 7:28:00 PM
I have an equipment table. The table contains both positions and assets. Each asset should have a position attached to it. I can easily query the table for assets not attached to a position, but I cannot figure of the syntax to query a position that does not have assets attached. A position c...more >>

Date conversion problem...
Posted by GB at 6/28/2007 6:19:21 PM
Hello, I loaded Date column data, which is in YYMMDD format, from flat file to a SQL database table as DT_WSTR. Now I want to convert this column to datetime format YYYY-MM-DD. How can I do that? Thanks, GB ...more >>

Creating INSTEAD OF UPDATE trigger to replace NULL values on update
Posted by jtertin at 6/28/2007 5:55:46 PM
I have a SQL2005 database with an Access database with linked tables as an interface. I have a form which is bound to a database table with editable fields. When a field is backspaced out completely, a NULL is stored in the SQL database for that record - as expected. However, I cannot use NU...more >>

deleted record
Posted by rodchar at 6/28/2007 5:50:02 PM
hey all, i just deleted a record out of my sql 2005 database and was wondering if i can get i back somehow. thanks, rodchar...more >>

Filtering on values of correlated subquery
Posted by David W at 6/28/2007 5:15:10 PM
I'm looking for a way to write the following query. It doesn't work as is because of the where clause, but it shows what I am trying to do: SELECT c.last_name, (SELECT Count(*) FROM Planner WHERE client_id = c.client_id) AS planner_count FROM Clients c WHERE planner_count > 1 AND c....more >>



Remove Identity Script
Posted by Kevin Humphreys at 6/28/2007 3:15:25 PM
Hi, Does anyone know of a script I can use to remove the identity of a field instead of manually going in and removing it? Thanks, Kevin. ...more >>

split ntext field entries into a table with n records
Posted by Xavier at 6/28/2007 2:32:04 PM
Hello, I have to split from a table with an ntext field to entries in a new table Example: Table1 has 2 field:id-field,ntextfield example content id=1 ntextfield (in this field are about 20 lines ) 1;44;54 2;61;21 3;45;38 ....... 20;235;55 The values from this ntextfiel have to be c...more >>

Unnecessary Audit Trail obfuscation
Posted by Randy Hersom at 6/28/2007 2:28:04 PM
I turned on Audit Events for Event type 40 SQL:StmtStarting. I had my program issue a command through ADO to SQL Server 2005: INSERT TERMCODE (CODE, TITLE, TC_KEY) VALUES('DC', 'Discharge', 34) I expected to now find that I could query fn_trace_getinfo(0) and see the SQL that I had submitte...more >>

1 to many relationships
Posted by Aidy at 6/28/2007 2:02:08 PM
If I have TableA and TableB I can have a one to many in these ways; A joining table that has TableA_ID, TableB_ID Or I can add TableA_ID to the TableB table. Could someone give me a brief run-down on the pros/cons and why you would use one solution over another. Mainly performance, ma...more >>

Using the opendatasource function with Windows NT Authentication
Posted by Dinho at 6/28/2007 1:52:40 PM
I am trying to use the opendatasource function to transfer data from one SQL Server to Another SQL Server. I use windows authentication and get the following error message. Server: Msg 7416, Level 16, State 2, Line 2 Access to the remote server is denied because no login-mapping exists. Here ...more >>

Silly question - updating primary key
Posted by Homer J. Simpson at 6/28/2007 1:27:35 PM
I just ran into a "problem", and while I understand that what I'm doing may be silly, I think SQL Server 2005 is giving me a semi-bogus reason for the error encountered. I have the following statement: UPDATE sometable SET somecolumn="somenewvalue" WHERE (somecolumn="someoldvalue") In...more >>

datetime, sql server 2005, c#
Posted by paul at 6/28/2007 1:18:02 PM
An application inserts some data using something like: insert into mytable ( dateCol ) values ( '1/20/2007 3:02:14 PM' ) the datetime string was created using DateTime.Now.ToString() Next, the user of the machine goes to the control panel/region settings and changes the short date for...more >>

running an update view in job schedule
Posted by Nash at 6/28/2007 12:45:28 PM
I'm trying to run an view which updates the database on sql server 2000. How can i execute this view using a job scheduler. I wish to create a T-SQL job which runs once a day and run the view. I do not want to show the script in the commans area therefore created a view hoping to execute this ...more >>

query help
Posted by cris at 6/28/2007 11:20:03 AM
hello everyone, here is another one i'd like to do without a cursor. i only have one parameter which is the date. i can only have one transaction per date. table1 date transaction grade 2007/01/01 AA123 80 2007/01/15 AA123 ...more >>

SQL SERVER 2000
Posted by Robert at 6/28/2007 11:18:01 AM
It's been 5 years that we’re using sql server 2000. And for us there's no need to upgrade to 2005 and I don't understand why people are upgrading? What's the big deal with sql server 2005 that 2000 canno't do? Just a questions! -- Un utilisateur curieux...more >>

SET NOCOUNT ON / OFF with multiple queries
Posted by Smokey Grindle at 6/28/2007 9:54:00 AM
I want to just keep track of the number of rows modified duing inserts... so I change the nocount status... but if I do it like below will I get what I want? just the inserted count? or will changing it multiple times mess it up SET NOCOUNT ON SELECT ..... SET NOCOUNT OFF INSERT ....... ...more >>

Truncate table
Posted by vovan at 6/28/2007 9:51:24 AM
I'm trying to use a table type variable in my stored procedure: DECLARE @Temp3 table ( RecordID int IDENTITY (1, 1) Primary key NOT NULL , FAccountID int, [Name] varchar(100), FParentAccountID int, Sublevel int, FAccountNumber varchar(100), FAccountType varchar(100), TotalBalance money ) ...more >>

Including a "Rate table" in a join?
Posted by Thomas Malia at 6/28/2007 9:39:05 AM
I've got a table that contains rates by day and another table that contains dated transactions. I need to create a query that will return the transactions with a calculated column that shows the transaction amount with the appropriate rate applied. As an example, let's say my tables are so...more >>

Please help with a Tricky ORDER BY.
Posted by Lam Nguyen at 6/28/2007 9:06:04 AM
Hi all, I need to sort by certain criteria according to the business rules. I show the desire results below and the queries that I am working on but need a little help from sequel guru. Any help would greatly appreciate. DROP TABLE TestTable GO CREATE TABLE TestTable ( [District...more >>

@@Trancount Error!!!
Posted by Mobydk at 6/28/2007 8:52:03 AM
I ran this simple script below, and got unexpected respult below. You see I was expecting the @@trancount in the 2nd print statment to have a value of 2, but it didin't. Please help. SET ANSI_DEFAULTS ON GO PRINT @@TRANCOUNT GO BEGIN TRANSACTION PRINT @@TRANCOUNT GO G...more >>

VARCHAR(MAX) PRINT problem on long string
Posted by Sam Bendayan at 6/28/2007 8:01:36 AM
Greetings, I'm seeing a problem with printing very long strings using the PRINT command on a VARCHAR(MAX) variable. After a certain amount of characters the string is truncated....it looks like the limit is at around 8,000 characters. Does anyone know of a solution or a workaround for this...more >>

DTS package guidance
Posted by Nash at 6/28/2007 6:33:53 AM
I was wondering if anyone has links to website or material information on DTS packages in sql server 2000 - 2005. I'm hoping for some guidance notes on this Thanks Nash ...more >>

joining to table where you only want the max record
Posted by Mike P at 6/28/2007 6:26:05 AM
I am trying to return a recordset with a list of users details, and also the last time they logged in. There can be many login records, and I just want the last one. I have tried using the code below, but when I add the bit that is commented out, it will only return 1 record. Can anybody help...more >>

Some Sql 2005 limits and recommendations
Posted by Rob at 6/28/2007 6:24:19 AM
What is the best way to store "long string data" ? What is the largest number (X) you can declare for a varchar(X) ? If I wanted to store an xml file in a SQL column, what column type would be best ? Also, I remember using the Text column type in 2000, but I believe you had to "process"...more >>

Serialization of code execution in stored procedures
Posted by Norbert Meiss at 6/28/2007 6:06:00 AM
I am responsible for a multi-user application written in Access 2005 as frontend and using SQL Server 2005 as database. To insert new records in a specific table we use stored procedures which calculate an ID by "max(ID) + 1" before inserting the new record with this ID. We now had one case w...more >>

query help
Posted by Dan D. at 6/28/2007 5:34:02 AM
Using SS2000 SP4. I'm trying to update using two tables. The large table has 3.5M rows. When I run the query it says it updated all 3.5M rows but it should only update a few hundred. What am I doing wrong? CREATE TABLE [tbldropdate_dan] ( [branch] [nvarchar] (4) COLLATE SQL_Latin1_General_C...more >>

Auditing
Posted by S Chapman at 6/28/2007 4:18:59 AM
We are quickly running out of space on our server so we want to archive databases that are not in use. How can I find out if a database has been accessed or not. When I say access - I mean - querying, inserting, deleting and updating. Thank you. ...more >>

Recovery Mode
Posted by S Chapman at 6/28/2007 4:16:18 AM
I am doing a number of inserts (in he range of millions) and deletions to some tables in my database. These operations are taking too much time and also the log becomes too big. I am using Recovery Mode Full. I am not able to quite grasp what the Recovery Mode is all about. Any practical example...more >>

Move Image from one table to another
Posted by Jörgen Ahrens at 6/28/2007 12:00:00 AM
Hi all I have problem with the trigger below...i can't copy an image into a local variable...how do i do it to get the trigger right? found something about textptr() but don't now how to use it. The problem column is [Document]. thanks for your help J. Ahrens Trigger: ALTER TRIGGER ...more >>


DevelopmentNow Blog