Groups | Blog | Home


Archived Months
March 2003
April 2003
May 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
all groups > sql server (microsoft) > september 2006

Filter by week: 1 2 3 4 5

Displaying Numbers as Letters
Posted by DJJ at 9/30/2006 4:06:10 PM
I am trying to create a query with a field called "CostCode". It is a field that disguises the cost of a product in a hidden formula based letters instead of numbers. The formula is as follows: 1 = P 2 = R 3 = E 4 = S 5 = T 6 = O 7 = M 8 = A 9 = C 0 = X 00 = XY...more >>


Shaping a query so results are on one row
Posted by Spondishy at 9/30/2006 2:15:29 AM
Hi, I have a query that does a series of groupings on a dataset that returns results based on an event status. The data is currently as follows: Columns are: areas, status, total Example data would be: north, open, 100 north, pending, 200 north, closed, 300 south, open, 120 so...more >>

DTS Help.
Posted by timber at 9/29/2006 11:59:57 PM
Hello Everyone, Im a bit stumped in doing DTS. I really have basic knowledge on it. anyway, here's my issue. Im trying to import data and my source is a text (.txt) file. The information in the text file was cut and pasted from Excel. This is what I a normally used of doing. Anyway, so I...more >>

why use CHAR.. _EVER_?
Posted by dbahooker NO[at]SPAM hotmail.com at 9/29/2006 4:03:00 PM
can someone list some good reasons for using CHAR? i mean seriously here. I've got this 3rd party database that's got EVERY SINGLE TEXT FIELD uses CHAR instead of VarChar. it's slow as a dog.. does anyone know why ANYONE EVER USERS CHAR? ...more >>

SQL script to show incorrect NI Numbers
Posted by Dia at 9/28/2006 8:02:12 AM
Hi there, I have a table containing NI Numbers and need to show any incorrect NI Numbers? Does anyone have a script or know how i can go about doing this? ...more >>

Strange variations of a UDF's performance (SQL Server 2000)
Posted by Yarik at 9/26/2006 10:20:15 PM
I am really perplexed... I have a UDF that takes two datetime parameters (specifying some time interval) and conducts some relatively complex calculations including correlated queries... Its signature looks like this: create function fCumulativeDemandMetrics ( @From datetim...more >>

address1 + ISNULL(address2, NULL) + citystatezip AS address
Posted by aaron.kempf NO[at]SPAM gmail.com at 9/26/2006 1:32:12 PM
can someone tell me what this is doing? it just kinda looks like junk to me.. if it's null then add a null? if this were VB and we were using the & symbol in addition to the plus then it might make more sense to me. It's just kinda escaping me -aron ...more >>

Create EXCEL file by DTS and import it into table of other Database
Posted by sushma.sondhi NO[at]SPAM gmail.com at 9/25/2006 1:25:45 PM
What are sql server's capabilities as far as creating files and transferring them to different locations? Hypothetically, we would like to create an excel file based on some data and automatically send it securely (via ftp or some other process) on a weekly/monthly basis. i know that we can sc...more >>



Convert to Date Format
Posted by shil at 9/25/2006 9:38:25 AM
Hi, I have a value like 'Mon, 25 Sep 2006 10:00:00' saved in a varchar field. How can I convert this to datetime format? I want the above value to be converted to '10/25/2006 10:00:00 AM' format. Thanks in advance. ...more >>

Building queries as strings
Posted by Spondishy at 9/25/2006 4:39:39 AM
Hi, In one of my stored procedures, the business layer is passing an "orderby" parameter, which is the name of the column to sort by (for example customer surname). This could be one of many different columns in the table. I am setting a @columntosort variable and then want to use it in the...more >>

Update with(rowlock) - still escalting to page and table lock
Posted by Jamie at 9/22/2006 2:28:04 PM
We have just rolled out a CS/CMS solution on SQL 2000 sp4 and we are having some blocking lock contention around the basketgroup table. This is a relatively small table that gets hit by many update and select statements - our select SP are all read uncommitted and we are using a ROWLOCK hint on ...more >>

Refering to a object owner using the USER value
Posted by billharrison9 NO[at]SPAM gmail.com at 9/21/2006 1:01:53 PM
I need to be able to drop a table after a user is done with it. I have tried something like, DROP TABLE USER.tblEducation_SAP1 but I get an error. Can someone suggest the way I should be using the USER value in this instance? Do I have to assign this to a variable and EXEC it, or can ...more >>

Importing Excel data with "/" chars
Posted by matsbe NO[at]SPAM gmail.com at 9/21/2006 9:34:39 AM
Hello, I'm trying to import data from an Excel datasheet, but I'm having trouble with one data column. When a cell has a value of, for example, E4/E20, the slash character seems to pose a problem. I have tried importing as both varchar, nvarchar, and several other data types, but I can't get it...more >>

How to get the password change date in SQL Server
Posted by SMAC at 9/21/2006 5:26:42 AM
I have searched this topic on google first, and I understood that "xdate2 column of sysxlogins" may store this info, but might not exclusively store this info... this value changes as extra permissions is granted. Is there a way to get the password change date? Either within a column of a ...more >>

Lost SQL 2000 Personal Edition
Posted by webmaster NO[at]SPAM aquinasandmore.com at 9/20/2006 5:31:06 PM
Does anyone have an extra disk of SQL Personal 2000? We have misplaced our original that came with our standard server version and MS won't send us another without the original receipt (from four years ago). ...more >>

Strip out Alpha Character
Posted by angela.y.austin NO[at]SPAM gmail.com at 9/20/2006 10:34:41 AM
I'm importing a 10 character zipcode field with a "-". I'd like a command that only imports only numberic characters. Can anyone help? I'm currently using LEFT(ZipCode, 5) + RIGHT(ZipCode, 4), but would prefer to use something more efficient. Thanks for your help! ...more >>

Need help counting...
Posted by William at 9/20/2006 7:43:09 AM
Need help creating a query to count the amount of records in a table who have a length greater than 255 characters. Something like... SELECT COUNT(*) AS [Records greater than 255] FROM tblProjects P WHERE (P.Description > 255) Any help would be appreciated. ...more >>

Search / Replace
Posted by luketongue NO[at]SPAM gmail.com at 9/19/2006 7:18:22 AM
Hi, I have a 'text datatype' field that contains 'aaaaa [nav] content [nav] content' What i want to do is remove the text that starts with '[nav]' and ends with '[nav]' Is that possible using a query ? TIA Luke ...more >>

PP:64 Bit vs 32 Bit Performance
Posted by prabhupr NO[at]SPAM hotmail.com at 9/18/2006 8:43:46 PM
Hi All May be somebody here can help me with this. Here is the situation Sorry in advance, if this is the incorrect group. Assumption =========== Say we have 3 servers (A,B,C) Server "A" --> 64 Bit machine with SQL 2005 Installed Server "B" --> 32 Bit machine ...more >>

Enable Identity Insert
Posted by fox at 9/18/2006 5:22:36 PM
Hi, Can someone tell me how to handle the following. I want to learn how to use Enterprise better to export/import queries to copy data from one table to another. One thing I always run up against is having an identity column in the destination table and I want to import data from a source ...more >>

Monthly subscription setup
Posted by bennyandlinds NO[at]SPAM gmail.com at 9/17/2006 2:00:14 AM
I was just wondering if anyone has had to deal with setting up a monthly subscription of any sort. I am using SQL Server 2005 Standard. Thanks in advance for any ideas! ...more >>

Advice on structuring some data
Posted by Spondishy at 9/15/2006 2:08:44 AM
Hi, I've inherited a sqlserver 2005 database from another team in my company and I'd like a little advice on the design of the database. It has the following tables. region area office A area is a child of an office, an office is a member of an area. We also have orders and users tab...more >>

Link table - better way of doing it?
Posted by mrshrinkray NO[at]SPAM googlemail.com at 9/15/2006 1:40:32 AM
I have the following tables Person --------------- Id Name Locations --------------- Id Name PersonLocation --------------- Id PersonId LocationId So each person can be in multiple locations. The problem with the 3rd table is with a lots of Locations, this table can g...more >>

where datetime between 2PM and 3PM
Posted by newscorrespondent NO[at]SPAM charter.net at 9/15/2006 12:00:00 AM
I need to select from a datetime column based on time of day. I don't see any functions to do this. Did I miss a section in BOL? Is the best way to do this a function That takes the datetime, from and through values and return a yes or no? where IsInTimeFrame(DateTimeColumn, FromTime, Thro...more >>

user login fails, no SSPI context
Posted by tlyczko at 9/14/2006 3:05:00 PM
Hello, I'm working on a test/dev SS2005 server, and I set up my own domain account as a sysadmin account, gave my account a lot of privileges, dbo, sysadmin, etc., it is a test/dev server running in a VM. I did this while logged in as the domain/Administrator account. I keep getting this er...more >>

set birth date column format??
Posted by tlyczko at 9/14/2006 9:07:38 AM
Hello, I'm new to SQL Server, working for a non-profit computerizing a lot of its data. I imported a table of people's names, birth dates, etc. into SS2005 from Access, and the birth_date was imported as an Access date/time field, giving it the datetime datatype in SQL. The column values lo...more >>

remote debug of stored procedure
Posted by Jeff Kish at 9/13/2006 4:50:35 PM
I'm on xp pro and using sql server 2000. I'm connecting using query analyzer to a windows 2003 server. I'm trying to debug an sp from my machine, but after I right click on the procedure and click debug, and fill in my parameters, it just runs, and does not give me a chance to start stepping t...more >>

JOIN function for taking subqueries
Posted by aaron.kempf NO[at]SPAM gmail.com at 9/13/2006 3:16:45 PM
ok.. so there's a SPLIT function that can take 123,234,23445 and it will turn it into 123 234 23445 what I'd like to do is do the opposite; in VB i would just use the 'JOIN' function to flatten an array back into a single string I'd like to find a similiar JOIN function as a SQL Serve...more >>

creating a primary key on people's names??
Posted by tlyczko at 9/13/2006 9:30:46 AM
Hi, I work for a non-profit agency that is belatedly computerizing a lot of its data etc. We need to have a table containing the names etc. of the people to whom we provide services, and the obvious "serial numbers" like SSN or Medicaid number etc. I don't want to use for a key field. What ...more >>

SQL 2005 slower than 2000?
Posted by RobbMichel NO[at]SPAM gmail.com at 9/12/2006 2:20:14 PM
We have an application that initially used SQL 2000. We have a client that insisted on SQL2005. Now when our application runs (for example) a stored procedure (and most other parts of the program) on the SQL2005 database it takes a lot longer than (3 or 5x longer) it does on the same database ...more >>

Input and Output parameters
Posted by Spondishy at 9/12/2006 2:43:23 AM
Simple question. Is it possible to mark a parameter for both input and output? Or do I just create two distinct parameters (one for input and one for output)? Thanks. ...more >>

SELECT INTO - Pros and Cons
Posted by John Smith at 9/8/2006 9:16:13 PM
We've been having a lively debate, at my office, about the pros and cons of using SELECT INTO versus CREATE TABLE/INSERT INTO in SQL Server 2000 stored procedures. Without stating my opinion, I'd like to hear what others think. Ideally, I'd like to see links to supporting documentation from re...more >>

Automate backups of DTS & Stored Procedures
Posted by Aubbies NO[at]SPAM gmail.com at 9/8/2006 10:27:24 AM
Does anyone have any suggestions on how to back up DTS packages and stored procedures through an automated process? Something I can run through a job weekly/monthly? Right now I have been scripting out all the sps but it takes too much time to go through all the databases every month on variou...more >>

Tools to move data from dbase to SQL server
Posted by bobyang03 NO[at]SPAM gmail.com at 9/7/2006 1:46:45 PM
we have a dbase database and we developed a new database with SQL server. the table strutures and fields are totally different now. is there any product/tools we can buy to do data migration from dbase to SQL. (the tool must be able to map the fields to the new database) thank you! ...more >>

SQL 2005 Express and VS .Net 2003 wizard error
Posted by surfrat_ NO[at]SPAM hotmail.com at 9/6/2006 2:21:07 PM
Hi, I have installed Visual Studio 2005 Professional and then Visual Studio ..Net 2003 on my machine. The reason for the older version is that my study examples are in 2003 format. I have SQL Server 2005 Express installed and added the Northwind DB to it via the Access 2003 upsizing wizard. ...more >>

Execution Plans
Posted by newscorrespondent NO[at]SPAM charter.net at 9/6/2006 1:29:50 PM
Is there any way to copy the text from a balloon in an execution plan? or get a text display? (SQL2005) Thanks...more >>

after database transfer dates in db are filled in incorrect.
Posted by Richardvernooij at 9/5/2006 4:49:05 PM
Hi. I transferred my sql 2000 database to an sql2005 server. After this, all dates that are send to the application are in wrong format. When i fill in a date from my webapplication to the database, for today, i get it wrong in the database: 2006-05-09 when i show this date on my website in...more >>

A few T-SQL questions...
Posted by Erik Funkenbusch at 9/4/2006 12:00:00 AM
I have a few T-SQL questions that i'm hoping someone can answer for me. 1) Is there an easy way to do an "insert if no record exists, otherwise update"? What I do now is query for the record and check recordcount, if it exists I execute an update, otherwise insert, but this requires 2 round t...more >>

Running SQL Server (2000) Dbase using MSDE 2000
Posted by dino.tartaglia NO[at]SPAM googlemail.com at 9/2/2006 11:23:10 AM
Hi Apols if this is a naive, 'newbie' approach, but whilst technically IT competent, I'm not at all savvy with SQL Server and need some guidance/help, as this is the only area of my new job I have no expertise in. We have a SQL Server (2000) dbase, c. 220MB and around 50k records, with a 4MB...more >>

concerning "IN" clause
Posted by michael NO[at]SPAM masonholt.com at 9/1/2006 8:33:17 AM
The simplified statement: select * from aTable WHERE anID IN (7,8,9,1,10,6) Currently, the query results are returned as sorted: 1,6,7,8,9,10 but I need the results to stay in the order they are presented in the IN clause: 7,8,9,1,10,6 What I am doing wrong? Thank you, Michae...more >>


DevelopmentNow Blog