Archived Months
January 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
all groups > sql server (alternate) > february 2007

Filter by week: 1 2 3 4

SQL Server Upgrade Wizard
Posted by bob.ward NO[at]SPAM enron.com at 2/28/2007 5:38:21 PM
I attempted to upgrade to SQL Server 2000 from SQL Server 6.5 using the SQL Server Upgrade Wizard and I immediately received the following error message: An unknown error occurred while trying to restart your SQL Server 2000. Please check the server errorlog and try again. I've checked the...more >>


SQL Help with purging old data
Posted by The Man at 2/28/2007 8:55:42 AM
Does anyone know how to purge old data in a MS SQL server 2000 database? ...more >>

Need help with CONVERT function
Posted by Wes Peters at 2/28/2007 8:13:37 AM
I have a situation where I want to filter records for a given day. The field that stores the date/time uses the date() function as a default value, kind of a date/time stamp for the record. The problem is when I want to filter records for a given day instead of a date range. I use the CONVER...more >>

Stored procedure to create a new database with tables
Posted by Shiller at 2/28/2007 7:17:23 AM
I want my application to create a new database/tables when run for the first time. I have created a stored procedure to create the new database named "budget". When I run the stored procedure, it creates the budget database but the tables are created in the "master" database. Please help. ...more >>

Does anyone use SSIS for database schema maintenance?
Posted by Ben at 2/28/2007 6:54:49 AM
We currently use SSIS to build DTS packages in which we store changes to our database schema, as well as scripts that need to be run upon each release. This works well for small sets of changes that never need to be updated or for architectures with only one database. We store each of the cha...more >>

How to view all triggers
Posted by kwilla at 2/28/2007 4:37:13 AM
I need a way to view all existing triggers in our MS Server database especially since I don't know what tables are involved. Thanks, kwilla ...more >>

Accessing which data caused a trigger to fire
Posted by jcandersen at 2/28/2007 3:01:43 AM
Hi. I need to make a trigger which fires when after an UPDATE is done on table A in database X. The trigger must perform a statement which copies some of the data from the update to table B in database Y on the same server. My question is: Can I access the data which caused the trigger to fir...more >>

millions records archiving and delete
Posted by Massimo at 2/27/2007 7:20:37 PM
The iussue: Sql 2K I have to keep in the database the data from the last 3 months. Every day I have to load 2 millions records in the database. So every day I have to export (in an other database as historical data container) and delete the 2 millions records inserted 3 month + one day ago. ...more >>



Reading a directory
Posted by Utahduck NO[at]SPAM hotmail.com at 2/27/2007 4:40:03 PM
I do a lot of file processing and I usually run a little script I copy and paste to read directory information to see if a new file it there and then process the file if it is. So, I decided to wise up and make a stored procedure to automate a lot of that. The pivotal step in this is that i r...more >>

Help required!
Posted by madhumita.iyengar NO[at]SPAM gmail.com at 2/27/2007 2:40:23 PM
Hi all I am creating a web services application in Visual Studio Dot net which links to a MS SQL database. I need to create a form which lets the user pick his field of choice(doesnt matter what it is..) using drop down boxes,radio buttons etc and query the database according to what he ha...more >>

help with a query
Posted by Sam at 2/27/2007 9:04:34 AM
Hi, I have one table like : MyTable {field1, field2, startdate, enddate} I want to have the count of field1 between startdate and enddate, and the count of field2 where field2 = 1 between startdate and enddate, all in the same query. I know how to get the first part (see below), but i ...more >>

SQL mail work around
Posted by jlaustill NO[at]SPAM gmail.com at 2/27/2007 7:40:43 AM
Hey yall, I have a problem, I'm a DBA for about 250 databases. I currently have ZERO means of notification on them. I put together an entire plan for using SQL mail, got a pop3 account set up and all that jazz, but when I put the request into my company to get outlook installed on my sql se...more >>

return duplicate records
Posted by alex at 2/27/2007 5:42:19 AM
Hello experts, I'm trying the run the following query with specific intentions. I would like the query to return 5 results; i.e., 4 distinct and one duplicate. I am only getting, however, 4 distinct records. I would like the results from the '007' id to spit out twice. I'm not using 'di...more >>

export/import
Posted by othellomy NO[at]SPAM yahoo.com at 2/26/2007 10:50:59 PM
What are the ways to export/import data in/out of SQL Server 2005? I used to use DTS for 2000 to do such thing and now I can't even find the wizard in 2005! ...more >>

newbe question: need a way to read in large query with .net
Posted by troy NO[at]SPAM makaro.com at 2/26/2007 9:36:50 AM
Could someone please point me in the right direction on how to read in a large query with .net. I am trying to emulate a legacy database system so I don't know the upper bounds of the sql query. An example query would be something like: Select * from invoices where year > 1995 the query ...more >>

nvarchar & varchar
Posted by haidani NO[at]SPAM gmail.com at 2/26/2007 6:47:04 AM
Hi, I am new to MS SQL. When I create a column in a table, when shall I use nvarchar or varchar? Please help. Thanks, Mike ...more >>

maintaining a database?
Posted by oraustin NO[at]SPAM hotmail.com at 2/26/2007 6:05:45 AM
Our database(s) are all over the place - no documentation - lot's of rubbish and unused stuff. I'm managing a project focusing on data quality that covers code changes, alterations to DTS packages, schema changes etc etc. What I'd like to do is see where the bit I want to change is being used...more >>

faster count(*) or alternative
Posted by C10B at 2/26/2007 1:08:26 AM
hi, I have a table with several million rows. Each row is simply the date and time a certain page was viewed. eg page1 1-1-00 page2 2-1-00 page1 16-1-00 page1 17-1-00 page2 19-1-00 I now need to find the most popular pages so I do this... SELECT TOP 10 COUNT(*) AS mycount...more >>

file share
Posted by nick at 2/25/2007 3:17:14 PM
Can someone please tell me what is meant by a file share? I'm doing a little reading on MS Sql Server and they talk about how you can connect to the sql server through a named pipe. I'm guessing that a file share means a specific service running on a server. Is this correct? The book says the...more >>

faster count(*) or alternative
Posted by C10B at 2/25/2007 1:34:30 PM
hi, I have a table with several million rows. Each row is simply the date and time a certain page was viewed. eg page1 1-1-00 page2 2-1-00 page1 16-1-00 page1 17-1-00 page2 19-1-00 I now need to find the most popular pages so I do this... SELECT TOP 10 COUNT(*) AS mycount...more >>

SQL Challenge - how to return a record set starting at a particular record?
Posted by michealp NO[at]SPAM gmail.com at 2/24/2007 6:08:52 PM
I have a directory of user information. What I would like to do is allow someone to search for person X and then return not only the information for person X, but also the information for the next 15 people following person X sorted alphabetically by lastname. So if someone searched for the l...more >>

unable to specify UNC path for restore through GUI??
Posted by KR at 2/23/2007 4:30:26 PM
Hi, After just installing sql 2005 on our test machine, I am trying to restore a database using a backup file on the network. However, the specify backup diagol box allows only for browsing to a file on the local machine - I find no way to type a UNC path to choose the backup file fro...more >>

Help, did SP1 install work?? SQL Server 2005
Posted by kataoki NO[at]SPAM gmail.com at 2/23/2007 3:38:17 PM
Hi, This is the log file for my SP1 on 2005 install. Can anyone please look at this and tell me if this looks normal? I'm concerned about the following in the log: "Failed to read registry key: Debug" AND all the entries that show "- Not Applied" What does this mean? According to SE...more >>

constraints across normalized tables
Posted by Emin at 2/23/2007 11:30:40 AM
Dear Experts, When I use a single table I can easily use constraints to enforce my business logic, but what do I do when I normalize a single table into multiple tables. For example, imagine that my initial table has the columns ID, Name, Salary with the constraint that Salary is not NULL....more >>

SQL Help
Posted by The Man at 2/23/2007 9:58:31 AM
Hello All: I am in desparate need of assistance. We are using an application called PaperVision Enterprise which takes scanned invoices and puts them into a database for the purpose of easy reference to any scanned invoice in the db. 2 weeks ago while trying to perform a 'match and merge' of th...more >>

SQL 2005 compatability mode
Posted by jsmall NO[at]SPAM visinet.com.au at 2/22/2007 8:34:13 PM
Hi, We currently have a fairly old product, which was originally only compatible with SQL 2000. When we upgraded our server to SQL 2005, the client product gave us a "This product is not compatible with this version of SQL server" error. We put the server into SQL 2000 compatability mode, ...more >>

test
Posted by Filips Benoit at 2/22/2007 7:17:24 PM
test ...more >>

SQL statement - INSERT INTO and SELECT
Posted by dhek at 2/22/2007 4:57:02 PM
Hi, I have a very simple issue: for simplicity lets say I have 2 tables, A and B. - Table A contains 5 fields. Amongst these there is a 'id'-field which is but a reference to table B. - Table B contains 2 fields: 'id' and 'text' In order to post data to table A I thus (from a kno...more >>

ASP cannot run stored proc until the web user has run the proc in Query Analyzer
Posted by central_scrutinizer at 2/22/2007 3:10:33 PM
I have an ASP that has been working fine for several months, but it suddenly broke. I wonder if windows update has installed some security patch that is causing it. The problem is that I am calling a stored procedure via an ASP (classic, not .NET) , but nothing happens. The procedure doesn't w...more >>

SQL error
Posted by Duffey at 2/22/2007 2:11:30 PM
I am trying to copy the data from one table to another table linked in SQL. I keep getting an error message saying "the data types nvarchar(max) and ntext are incompatible in the equal to operator" I went into the SQL Management Server and tried to modify the codes and am still having no luck....more >>

Query for the first and latest wish
Posted by Eugene at 2/22/2007 2:09:20 PM
Hi all, I have the following table Name Date Wish Valid Name is person's name, date defaults to getdate() and is never assigned directly (datetime field), Wish is some message, and Valid is bit, 1 indicates if the wish is the latest, and therefore valid. All previous wishes are kep...more >>

How to run replace on all columns
Posted by JackpipE at 2/22/2007 1:01:00 PM
Here is my replace query and I need to run this on every column in my table. Right now I manually enter the column name (_LANGUAGES_SPOKEN) but this is time consuming and would like to automate this process as much as possible. Update PROFILE SET LANGUAGES_SPOKEN = replace(cast(_LANGUAGES_SPO...more >>

Format money value as padded string
Posted by paulmac106 NO[at]SPAM gmail.com at 2/22/2007 10:15:08 AM
Ok my last formatting question. How can I insert a money value as a padded string in another table? example $1.25 gets inserted to another table as 00000125 I want 8 total characters and no decimal another example would be 4,225.99 becomes 00422599 can this be done? thank you!! ...more >>

error for sending(saving) data to database
Posted by projectid2007 NO[at]SPAM yahoo.com at 2/22/2007 7:19:44 AM
Hi, I'm using VS2005 and I'm trying to link the C# windows form to MSSQL. I used BindingNavigator Control to read the data. After that I add sqlcommand and sqldataadapter to send the data to the database. My code is this sqlDataAdapter1. InsertCommand. CommandText = "INSERT INTO SUDENT (" + ...more >>

Insert Date as Formatted String
Posted by paulmac106 NO[at]SPAM gmail.com at 2/22/2007 6:22:25 AM
Hello, I thought this would be easy, and I've read a lot of posts, but I can't seem to find exactly what I'm trying to do. >From within a stored procedure I would like to insert a date value into another table to a Char(8) field....but I want the value to be formatted as YYYYMMDD (specific...more >>

T-SQL for the following?
Posted by Mark Probert at 2/22/2007 12:21:48 AM
Hi .. I am geeting myself into many knots around how to do thsi extraction. There is a table that contains the following: aID bID cID dID -------------------------- 6 9 28 1 6 2 28 2 6 11 28 3 6 1 27 5 6 9 27 5 6 11 27 5 I am trying to get a result of: aID bID ...more >>

Unicode characters (Japanese)
Posted by DL at 2/21/2007 1:07:56 AM
Hi, Our school has an application in which : - Teachers enter comments through a web interface built in asp (not asp.net). - Comments are stored in a SQL server 2000 (in a nText field) - Comments are printed through a MS-Access 2002 front-end... Most comments are in English, Spanish or Fre...more >>

Use RTRIM function on TEXTBLOB (text) field
Posted by Mintyman at 2/21/2007 12:00:00 AM
Hi, I have erronous white space at the end of my 'description' field within my 'product' table. I tried using the RTRIM function but it won't let me because it is a TEXTBLOB (text) field. Can anyone show me how to write a query that will update all my rows automatically? I'm using SQL...more >>

How to run profiler from cmd
Posted by Thyagu at 2/20/2007 10:25:55 PM
Hi, We have a requirement to run profiler continuously to find out the misbehaving applications/SQL in the dataserver. And we are not interested in running it from an individuals local machine. Also we want the profiler to start automatically whenever there are SQL Server/ Machine restarts. ...more >>

What is the best availability and backup solution?
Posted by Daniel.Peaper NO[at]SPAM gmail.com at 2/20/2007 10:05:30 PM
Hi Everyone, I'm working on a site that is running MS SQL 2000. They perform regular backups of databases and log files and in the event of a disaster they have a second backup server. At present they regularly copy the backup up files from the production server to the standby server. The p...more >>

Storing variable values whilst using cursors
Posted by archanapatelwhite NO[at]SPAM googlemail.com at 2/20/2007 5:41:25 PM
Hi below is the code I am using. ------------------------------------ SET NOCOUNT ON DECLARE @emailid varchar(50), @rastype varchar(50), @message varchar(80) declare @allrastypes varchar(200) DECLARE email_cursor CURSOR FOR SELECT distinct Email FROM dbo.tblMaintCustomer ORDER BY Emai...more >>

Subquery and display help
Posted by archanapatelwhite NO[at]SPAM googlemail.com at 2/20/2007 4:27:55 PM
Hi I need to produce an excel output from SQL that shows email - company name - producttype1, producttype2 (where the - denotes a change in column) basically i have a table the first line is the fields and the second and third are the entries email - companyname - producttype xx@xx.com - xx...more >>

Is there a Query Analyzer
Posted by click37 NO[at]SPAM gmail.com at 2/20/2007 2:04:44 PM
in the market place that will run a query on multiple DBs across multiple servers? Without having to manually connect to each server? If so, can anyone provide a link for it. Thanks ...more >>

Partition Scheme using a function
Posted by eavery NO[at]SPAM cdc.gov at 2/20/2007 11:09:40 AM
I can't seem to find a way to do the following: create table part_table ( col1 int, col2 datetime ) on psX (datename(week,col2)) I want to partition based on the week number of a date field. So if I enter in data like the following in my part_table: (1, 1/1/2007) should go into parti...more >>

Stored Procedure, error when executing (
Posted by Goog79 at 2/20/2007 10:14:40 AM
Hi everyone, first time here, so I'm sorry if this has been covered already ages ago. :( I am trying to learn T-SQL and Stored Procedures and bought the book on these topics by Djan Sunderic, Publisher McGraw Hill/Osborne. I'm already stuck on my first Stored Procedure and getting error m...more >>

Restore SQL DB with correct logical file names
Posted by blueboy at 2/20/2007 7:54:37 AM
Hi, I am planning to automate a nighty restore of a DB on another server can someone point me in the right direction with the SQL script to modify the logical file names to the correct path and not the ones carried over with the DB?? i.e the database is to be renamed on the new server an...more >>

simple SQL question to insert records in an existing table - Newbie
Posted by pamela fluente at 2/20/2007 7:31:03 AM
Hi, I would like to know how to modify the following selects so that - assuming that NewTable already exists - the result of the SELECT is appended to the existing table. If possible I need the appropriate changes for both the 2 syntax below. -1- SELECT * INTO NewTable FROM ( SELECT ...more >>

SELECT *
Posted by Wes Groleau at 2/20/2007 2:44:58 AM
Never say never..... One of my applications loads a huge amount of data from a text file, sifts through and discards much of it, and rearranges what's left. Finally, it is added to similar data from many other files. For that last step, SELECT * is the sensible way to go. If you really do w...more >>

Simple function for returning a character based on search criteria..
Posted by Jorgen [DK/2600] at 2/20/2007 12:00:00 AM
Hi, how do I do a simple formula, which will search a field for special characters and return a value. If it finds "%" - it returns 1 else If it finds "?" it returns 2 end If this is the incorrect newsgroups, please direct me to the correct one regards Jorgen ...more >>

Function to return "remaining" of field after it finds a character in the field.
Posted by Jorgen [DK/2600] at 2/20/2007 12:00:00 AM
Hi, another problem I have is that have compounded fields in my sql table. Example product@customer I need a simple function to return "customer", so it should return the value after "@", unfortunate "@" will sometimes be character number 6, sometimes character number 7 etc. regards...more >>


DevelopmentNow Blog