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 > february 2006 > threads for wednesday february 22

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

Cast varchar to decimal
Posted by Greg at 2/22/2006 11:57:26 PM
I am losing my hair....and my mind.... Is there any reason why I wouldn't be able to cast a varchar value of say 7.8 to decimal? I have a whole bunch of lab results that come with a bunch of garbage in the result column. I have stripped it away so that it is only a format [1-x].[0-9]. I...more >>


Query Question
Posted by marty.weel NO[at]SPAM gmail.com at 2/22/2006 11:31:05 PM
I have the following State with many transitions to other States Tables include State StateId Name StateTransitions StateId DestStateId How could I get a list of all the possible states for a given state id? Thanks in advance, Mardo ...more >>

previous value in trigger
Posted by Adarsh at 2/22/2006 11:28:47 PM
Hi, Can I get previous and current values of row in trigger for update operation. Regards, Shah Adarsh. ...more >>

Using an alias in WHERE clause?
Posted by Terry at 2/22/2006 11:11:57 PM
Is there a special way to be able to reference an Aliased column name in the WHERE clause? For example, the following works fine (Northwind): SELECT CompanyName, (SELECT COUNT(OrderID) FROM Orders WHERE Customers.CustomerID = Orders.CustomerID AND ...more >>

Q: SQL Server 2005 and Schemas
Posted by Martin Arvidsson at 2/22/2006 8:32:41 PM
Hi! I am just learning SQL 2005 and also programing C# (Studio 2005). Why is it a good idea to use namspacing on the tables in a database? such as if those schemas exist Purchase, Sales. Purchase.PruchaseHead Purchase.PurchaseDetail Sales.SalesHead Sales.SalesDetail Why just not ...more >>

Restoring database from SQL-2000 to SQL-7
Posted by Hardik Shah at 2/22/2006 7:44:45 PM
Hi, I have a database on SQL-2000 , I take backup of it and trying to restore in SQL-7 but I am fail, Is it possible to restoring SQL-2000 to SQL-7 or not. Thanks in advance. Hardik Shah ...more >>

Import / export question
Posted by Chubbly Geezer at 2/22/2006 4:52:29 PM
When importing / exporting tables between databases in SQL 2005, the fields lose any properties that have been set, i.e. primary key. Any idea if there is a solution to this. Thanks ...more >>

UPDATE statement optimization?
Posted by David Mackenzie at 2/22/2006 4:45:22 PM
Does anyone know what optimizations SQL Server 2000/2005 carries out if an UPDATE statement sets a column to its existing value? For example, the MySQL documentation explicitly states that if an UPDATE statement sets a column to its existing value, MySQL will not attempt modify the column at...more >>



Help with float data type
Posted by News at 2/22/2006 4:18:58 PM
Hi, I am developing a web based application that deals with financial info (coldfusion and sql server 2000 on shared server). All the numbers that carry this info are of float data type. I ran into a situation when this gives all kind of problems. For example, I calculate cost after very...more >>

Help with most efficient column sorting technique
Posted by MJB at 2/22/2006 4:12:32 PM
I have a SQL 2005 database with 4 million+ rows. One table in particular has about 35 columns. I have implemented a paged data grid results view for them. They want to be able to sort on the majority of the columns. When they sort they want all the results sorted not just the visible r...more >>

Need a help on a SQL Query
Posted by wubin_98 NO[at]SPAM yahoo.com at 2/22/2006 4:03:25 PM
Could somebody please help me on following SQL Query. Single table data likes this: SerialNumber PassedTestType 20001 1 20001 2 20001 3 20001 4 20001 ...more >>

List() Function
Posted by mason at 2/22/2006 3:49:18 PM
Sybase has implemented a useful aggregate function called list() which takes a column and returns all values in a comma delimited string. In Oracle10g, there is a Java solution to duplicate this aggregation function. Now I have to do the same in SQLServer2005. I found the UDA (User Defined Agg...more >>

Printing the results of a dynamic query
Posted by RSH at 2/22/2006 3:41:24 PM
I have a situation where I need to run several Queries from different NON RELATED tables and I would like to print the results on a single formatted line. Code: PRINT 'FUTA--------------' --FUTA SET @QUERY = 'SELECT sum(CompanyAmount) as CompanyAmountTotal, sum(CompanyAdjWage) as Com...more >>

SqlServer 2005 Express Question
Posted by Richard Thayne at 2/22/2006 3:37:45 PM
I have created a database in 2005 Express and now I need to move it onto a SQLServer 2005 box (regular edition). Can it be done and how? I have web surfed and found nothing. Thanks. ...more >>

When to use Distinct vs Group By
Posted by Rich at 2/22/2006 2:56:28 PM
Hello, I want to retrieve a distinct list of elements from a column not including any aggregate functions. I can do this by Select col1 from tbl1 Group By col1 or Select Distinct col1 from tbl1 Is there any criteria for using Distinct vs group by or group by vs distinct when not...more >>

Math in a column
Posted by wnfisba at 2/22/2006 1:37:30 PM
Can't I perform Math functions in deriving a column??? Check out the following SQL which DOES NOT work... SELECT GEN.loan_num, MKT.yield_prem, MKT.yield_fee, GEN.ysp_to_wire, GEN.loan_amt, (MKT.yield_fee = (GEN.loan_amt * (MKT.yield_prem/100))) FROM DataTrac.dbo.GEN, DataTra...more >>

VAlidate
Posted by alejandro at 2/22/2006 1:30:49 PM
HI, i have table with with a column named expire_date , i want to make a rule for block enter a date < today date , how i can make this?? only dates > today must be enter in this column. Thanks in advance alejandro carnero ...more >>

Strange rollbacks happening
Posted by Carl Henthorn at 2/22/2006 12:49:28 PM
I have 6 sql servers running sql2k sp3 that process data. One part of my process consists of updating two varchar(8) feilds with the latest date. This code has been working for 3 years now. While I do not use any tran statements, yesterday the updates started rolling back one of the columns ...more >>

Active Directory / Groups + MS SQL (yikes???)
Posted by jebuskrust NO[at]SPAM gmail.com at 2/22/2006 12:48:28 PM
When configuring ms sql to permit authentication from users over a domain. Is it possible to poll from system tables like sysusers / sysmembers / sysgroups / sysprocesses / etc what active directory group's a specific user is a member of once they are authenticated into a ms sql server? I've bee...more >>

Insert running slow
Posted by Larry Charlton at 2/22/2006 12:46:27 PM
Are inserts really slow in 2005 or am I doing something stupid? Here's the table: CREATE TABLE [dbo].[Tickets]( [ticket] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [data] [varchar](1000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [added] [datetime] NOT NULL CONSTRAINT...more >>

Calling a user function
Posted by mason at 2/22/2006 12:27:08 PM
I created a user function fn and MSSQL did not let me call it without a schema prefix. Do I need to create a synonym to get around this behavior? Thanks. select fn() error: 'fn' is not recognized built-in function name select dbo.fn() works fine. ...more >>

Date and time stamp
Posted by blueboy at 2/22/2006 11:22:38 AM
Hi im having a few problems saving a file with the data and time i am using the below t-sql but can only get the date and not the time. CONVERT(NVARCHAR(16),GETDATE(),112) Any guidance would very much be appreciated. thanks in advance ...more >>

email using
Posted by Kalyan at 2/22/2006 11:07:29 AM
hi can any one guide me, how to send email using stored procedure in sql server 2000 in windows 2003 o/s without using mail client installed on server. Thanks Kalyan ...more >>

Help with exception list from another table
Posted by Matthew at 2/22/2006 10:49:17 AM
I hate to do this, but I need to now. The program below sends an e-mail alert for each server/drive that is below the critical threshold. Well it turns out that I need an exception list for some servers. So I created that list in a new table with the following fields Computer VARCHAR (128), ...more >>

Optimizing daylight savings query by not using UNION
Posted by br at 2/22/2006 9:46:28 AM
I was interested in optimizing a query I created in SQL Server 2000 for adjusting time zones for daylight savings time (only USA DST for simplicity). In essence I have one table "tblDaylightSavingsTime" where the PK is Year, with fields Spring_Forward (ex: 4/3/2005 2:00:00 AM), and Fall_back ...more >>

how to retrieve full text of procedure definition from syscomment
Posted by Rich at 2/22/2006 9:09:40 AM
Hello, I am trying to locate where/when data is being inserted into a table from a DB I recently inherited. So I write this in QA select * from syscomments where text like '%Insert Into CompareSubscribers%' This will retrieve the procedure(s) that contains the text "...Insert Into.....more >>

temp table dilemna
Posted by CharlesA at 2/22/2006 9:09:28 AM
We have to import huge quantities of data into our database on a SQL server 2000 box (running under NT 2003 server). Our requirement is to create temp tables that house anything from 5 Million to 7 Millions rows This will happen once a week as run by whatever account runs a DTS package is it...more >>

Datagrid/Stored Procedure Issue
Posted by MJKulangara at 2/22/2006 8:58:12 AM
I have a developer that has databound datagrids as follows: Datagrid.datasource= DataSet (yes, the compiler allows this) The dataset is returned from stored procedures. Each of the sps return a single recordset, but periodically we are seeing some nondeterministic behavior where the code for...more >>

Opinios: SQL DB Dev MCP Exam 70-229
Posted by Joel at 2/22/2006 8:05:26 AM
I'm terrified, and could use some opinions from the user community... I'm about to take my first ever Microsoft MCP exam on SQL Server 2000 Development (70-229). To prepare, I've been reading the SQL Server 2000 Design Exam Study Guide from Sybex Books. One of the problems I have is with a...more >>

CLR Stored procedure to access OleDb datasource, how?
Posted by Va1era at 2/22/2006 7:17:34 AM
I tried to write a CLR stored procedure using C# in SQL 2005 to access an Access database. When I use the OleDbConnection class in System.Data, the procedure throws SecurityException at runtime. Output as following: System.Security.SecurityException: Request for the permission of typ...more >>

updating rows using cursor
Posted by Koert at 2/22/2006 6:57:29 AM
Hi there, i have a problem with updating rows using a cursor, my code is below: -- Fill column DataId for each row in the Data table DECLARE @index1 int, @index2 int DECLARE DataID_Cursor CURSOR FOR SELECT index1, index2 FROM data OPEN DataID_Cursor FETCH NEXT FROM DataID_Cursor INT...more >>

first day of week by Week Number
Posted by tomek at 2/22/2006 4:30:05 AM
I was looking for a solution for this problem - but none of what I found in Internet helped - so finally I made something myself ( based a little bit on someone's idea). I hope it will be useful to someone - or maybe u'll see some bugs in it? please report. there 2 assumptions 1. before execu...more >>

2005 using CLR for UDF accessing DirectoryServices
Posted by HowardB at 2/22/2006 2:21:48 AM
Not sure if this is correct group, but I cannot access DirectoryServices namespace (directoryservices.dll) when creating (or running) a C# UDF. It seems that this is a 'feature', but why - and is there a way round it - I need to access Active Directory from the UDF. Thanks Howard. ...more >>

Output to serial port
Posted by Michael at 2/22/2006 2:14:16 AM
Is it possible for an event coming into the database (I have an access control system that uses SQL server, and it has an event type column for alarms, troubles, etc. Is it possible to set up a command to output a specific ASCII command based on incoming data? Any help would be appreciated...more >>

Internet Access
Posted by Oddie at 2/22/2006 12:38:28 AM
Hi. Does anyone have any advice to how to connect to the SQL Server2000 via the Internet? Background: 1. SQL Server2000 setup as NT Authen only 2. Internet access from the public (that is no work NT accounts) 3. I do not want to code any SQL Server password into the web application (e.g...more >>

question about process order
Posted by Robert Bravery at 2/22/2006 12:00:00 AM
Hi all, I have a trigger for update on a table. It does a whole bunch of things, then calls a SP. I want to then check something afet the SP is completed. To check this out I put a print statement after the line that called the SP exec calcdeductables @claimid, 1 print 'Check SIP' The SP, ...more >>

Audit Add Windows Login?
Posted by Pushkar at 2/22/2006 12:00:00 AM
Hi, I want to audit add/drop of windows login to my sql server. Through SQL Profiler Add/Drop login I can only Audit Add/Drop login of SQL Security Login and not the windows login. Is there any way to audit Adding of windows login? Thanks Pushkar ...more >>

Help with Best practie and design
Posted by Robert Bravery at 2/22/2006 12:00:00 AM
HI all, I covert your input. I am designing a claims database. I am looking at have a common claims header table, that will keep all common thing to every claim, and then seperate tables depending on the type/class of claim. So I could have a motor, marine, asset for example. Reason being that ...more >>

performance difference between query analyzer and .NET code.
Posted by Guoqi Zheng at 2/22/2006 12:00:00 AM
Dear Sir, I used dynamic SQL on stored procedure to do the paging in my site. I often hit a connection time out problem with that dynamic SQl when I call it from .NET code. However if it run it under query analyzer, everything works fine. Who can explain this to me and what should I do i...more >>


DevelopmentNow Blog