Archived Months
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
all groups > sql server new users > may 2007

Filter by week: 1 2 3 4 5

query "last" comment per user
Posted by HX at 5/31/2007 9:12:45 AM
I'm stuck here - if I use grouping on my userID and select MaxDistinct on the date/time stamp, how do I pull in the "last comment" from the record, since it obviously can't be grouped (else ALL the records will show since all comment fields are different). Help? This is one thing I tried -...more >>


Import from SQL 6.5 to 2005
Posted by Steve Gr at 5/30/2007 12:00:00 AM
Hi, I have some tables that I'd like to copy from a SQL6.5 database into a SQL 2005 database. The table structure and data needs to come across, ideally automatically so I don't have to create the tables first in 2005. What is the best way to do this? Thanks, SW ...more >>

Modify Store Procedure
Posted by ascll at 5/29/2007 10:09:45 PM
Greetings, How do I modify a defined stored procedure? Thanks ascll ...more >>

Bulk Insert Help
Posted by Hulicat at 5/29/2007 6:37:40 PM
I am trying to do a bulk insert here is the error: Server: Msg 4860, Level 16, State 1, Line 1 Could not bulk insert. File 'c:\what.fmt' does not exist. Here is what I am executing: BULK INSERT callinsecuritycodeprovider FROM 'C:\sample.txt' WITH ( FIRSTROW = 2 , FIELDTERMINATOR = ',...more >>

subquery BEFORE the left outer join??
Posted by HX at 5/29/2007 1:27:51 PM
OK, I thought I had it, but I don't. The following query is intended to bring in a complete list of ModuleIDs for the selected user. Problem is, when I filter, if another user has a ModuleID "2" record, then the "2" record won't come in for the current user - I guess because the filter is ...more >>

help with left outer join
Posted by HX at 5/29/2007 8:13:30 AM
I don't understand why my left outer join isn't giving me "null" records on the side where there is no matching record.... Is this enough info to trouble shoot? SELECT TOP 100 PERCENT dbo.cert_m.ModuleID, dbo.cert_m.SortOrder, dbo.cert_m.Regimen, dbo.cert_m.Title...more >>

Access SQL Server from System DSN in ASP Classic
Posted by Jim Rodgers at 5/28/2007 6:00:00 PM
How the heck do I get permission to use SQL Server from a System DSN on a webpage? I am using VBScript and ASP Classic and ADO (Classic), thus: myConnection.Open "DSN=MySystemDSN" This works if I use my MS Access database, but when I use my new SQL Server database, I get the...more >>

Sum as extra field
Posted by Vayse at 5/28/2007 3:40:17 PM
I have a view, ClientSales. SQL is SELECT ClientID, SaleValue,.............. FROM dbo.ClientSales I'd like to add another column, which would be Sum(SaleValue) for the client. So my output would look like ABC 10 250 ABC 20 250 ABC 220 250 DEF 40 40 ...more >>



Why is connecting to SQLExpress 2005 so difficult?
Posted by dan at 5/27/2007 9:50:45 PM
Hi, I've been using db2 and mysql for many years and had no major problems with connections. They just worked. I just switched to SQLExpress and what a mistake! I have 4 machines: 3 clients and 1 server. I can connect to the server from one of the client machines but can't from the other...more >>

login doesn't work
Posted by Middletree at 5/25/2007 9:26:05 AM
Using SQL Express 2005 I created a new login under the security tab. For these purposes, let's say the login is called "asp". I then created a user on the specific database that I want to use, and called it "asp." I tied it to the login called asp. I made sure that SQL Server is running un...more >>

Change Windows authentication to Mixed mode
Posted by Middletree at 5/24/2007 3:32:57 PM
How do I Change Windows Authentication to Mixed Mode on SQL Server 2005 (Express)? ...more >>

convert NULL to 0 on import?
Posted by HX at 5/24/2007 1:55:32 PM
Is there a way to automatically convert any NULLS in a table to 0 (zero) when importing the table? A setting or something? ...more >>

dropdown in DetailsView
Posted by ascll at 5/24/2007 12:00:00 AM
Greetings, How do I insert a dropdown box (predefined values=A,B,C,D) in DetailsView (prefer codeless)? Thanks ascll ...more >>

Script the data
Posted by ascll at 5/22/2007 11:47:09 PM
Greetings, How do I use SQL Management Studio to generate the data from all tables (in same database) to a .sql file? I might need to execute the generated sql file to import the data to different databases. Kindly advise. Thanks ascll ...more >>

insert leading zero in zip
Posted by HX at 5/22/2007 3:27:51 PM
I have some zip codes in my table that are only 4 digits because the leading zero fell off at some point (during import, or in the xls they arrived in). How do I now get the zero back in there? My plan is something like IF len([zip])=4 THEN "0" & [zip] but I'm not sure of the proper syntax....more >>

Simple update query
Posted by Nirmal Singh at 5/22/2007 12:00:00 AM
I have a table as follows: Empno VarChar(10) NOT NULL StartDate DateTime NOT NULL EndDate DateTime NULL Letter VArChar(10) NULL For each Empno there will be several StartDates. I want to update the table to delete all Letter Codes except for the la...more >>

How to properly size a new Server to run SQL
Posted by BLKATFAN at 5/21/2007 12:51:01 PM
We have inherited an enterprise that has 8 different SQL based applications running on 5 different servers with close to 50 different databases. Thes machines currently all run Standard edition of both Windows Server 2003 and SQL (versions vary). Of all of these servers/apps probably 5 databas...more >>

automatically replace data in table
Posted by HX at 5/17/2007 7:19:56 PM
How can I automate the process of importing a new text file into an SQL 2000 table nightly? The data will be posted on one server, and the SQL database is on another. I can't even fathom the first step. Is there a tutorial or reference someone can point me to? ...more >>

Creating a flat table
Posted by Ernie at 5/17/2007 3:11:53 PM
I have a MSSQLSERVER2000 table 'FRUIT' with the following data ITEM CODE QTY Apple 101 2 Banana 102 1 Orange 103 3 What I need is to create a MSSQLSERVER2000 table 'FRUITFLAT' that looks like this: ITEM CODE QTY ...more >>

Newbie in need of SQL help.
Posted by Jim Moberg at 5/17/2007 7:48:00 AM
Hi, I wrote a small chunk of sql code that is supposed to read data from table A and select those records that are not already in tableB. Table A and Table B both have the same exact structure. Then the code is to write those unmatched records from table A into table B. But I'm getting...more >>

Concurrency in TempDB
Posted by Chakravarthy at 5/17/2007 12:11:35 AM
We have a set of 20 SP's in SQL 2005 which call one another in a series of loops and perform a complex 'what-if' operation. All of these SP's use a lot of temporary tables.The production team is reporting a high rate of TempDB concurrency, on initial deployment. Would it be a good choice ...more >>

Formatting Social Security and Phone numbers in SQL Server 2005 Express
Posted by Nancy at 5/16/2007 2:16:58 PM
I need to format the subject field as my client is entering the dashes like 111-22-3333 in a social and 122-3333 in a phone number .. but Sql Server is calculating even though it's a varchar(50) field. I thought that was plain text.. Why is it calculating and ending with a value like -4431 w...more >>

SQL Statement Question
Posted by rnv at 5/16/2007 5:13:02 AM
Hi, I hope this is the correct newsgroup to ask the question I have regarding the SQL statement. i have two tables, Customer and Address: Customer: ID, FirstName, ..... Address: CustomerID, (related to Customer.ID) Street ... i would like to create sql st...more >>

How to type in license key after demo period expires
Posted by Retsyl at 5/16/2007 1:25:00 AM
Hi all I know this may be a stupid question, but I have installed the free fully functional 120-days SQL2000. Now time is almost up, and I need to type the license key, that I have purchased. But where do I do that? Do I need to install SQL2000 again - and if that is the answer, what will h...more >>

2005 Express Edition
Posted by Ted at 5/15/2007 9:57:24 PM
I installed Express Edition and downloaded the sample databases from Microsoft. I ran the install for the samples and now can not open the databases. I click on open database and scroll to the folder. I have 4 subfolders, 80, 90, MSSQL, and MSSQL1. No matter what file I select, I am not abl...more >>

Error 3197 - ms jet engine stopped the process
Posted by SAC at 5/15/2007 10:40:33 AM
I'm getting ms access error 3197 - ms jet engine stopped the process... I'm using an MS Access frontend with sql server 2000 backend. ODBC Configuration is fine...all other processes work fne. I have two linked tables which are on the sql server. (When I move the data to an ms access db ...more >>

how recognize what service pack was installed on sql 2005 server?
Posted by SeVilho at 5/15/2007 12:00:00 AM
Hi, all! There was SQL QUERY ANALYSER in SQL2000 and SELECT @@VERSION directive. Now there is no this useful tool in SQL2005. -- Best regards Sergey D. Vilkhovchenko ...more >>

join question
Posted by HX at 5/14/2007 4:20:59 PM
Is there a type of join that will 'stack' two tables? For example, If table A contains a single field with: fldLetter A B C And table B contains a single field with: fldLetter D E F Is there a join that will give me: fldLetter A B C D E F ??? ...more >>

USING UNION WITHOUT SORTING
Posted by vikram.singh NO[at]SPAM hp.com at 5/14/2007 6:41:38 AM
Hi, I want to use union without sorting the rows. for example i have query like: select job1 from table1 union select job2 from table2 union select job3 from table3 After running this query the jobs are getting sorted by default. I want them to be appeared as they are selected (without...more >>

Turning off WARNING messages
Posted by Hari at 5/14/2007 4:44:29 AM
Hi, One of my colleagues is working on SQL server 2005 and gets a warning message when he tries to run --> Select Sum(Mycolumn) from Mytable; -- > and in this if MyColumn has a null value then he gets a warning message. How to turn off the same (he doesnt want to use the WHERE statement to ...more >>

ms jet stopped the process
Posted by SAC at 5/13/2007 11:35:12 AM
I'm getting ms access error 3197 - ms jet engine stopped the process.... I made a new sql db and a new ms access db, tested it and it still has the same error. If I put the tables into an access db then it runs OK. Any ideas on what I need to do to fix this? Thanks. ...more >>

Update tables in SQL 2005
Posted by Novice exchange admin at 5/12/2007 1:19:02 PM
Hi, I am very new to SQL and I don't know much transact SQL. I have 2 tables in the same database. Both tables have 2 fields which are the same. the first field has the server names and the second has the server owner names. I need to get the data from table 2 and update the server owner na...more >>

timeout expired - will stored procedure help?
Posted by HX at 5/11/2007 8:18:03 PM
I am using SQL 2000 as the database for an .asp website. I have a really complex query behind one of my pages - sometimes it works like a charm, though a little slow, and other times I get a "timeout expired" message. I'm guessing it all depends on how many people are using the server, and ...more >>

varchar or nvarchar
Posted by Port Man at 5/11/2007 1:19:26 PM
When creating my table columns, should I be using the varchar or nvarchar? thanks. -- ...more >>

Copy SQL Server 2005 Express database to SQL Server 2000
Posted by Angus at 5/10/2007 6:41:02 PM
Hello I have a copy of a SQL Server 2005 Express database - the mdf and .ldf files. If I copy to my machine and in the Enterprise manager try to attach the files I get error 602 - and apparently you cannot do this as the database structure has changed so much. Bearing in mind SQL Server 20...more >>

I can not use SQL 2005 Help over Vista
Posted by Edinson at 5/10/2007 12:09:01 PM
Hello. Pleas help me with this. I am usin SQL 20O5 SP2 on Windows Vista PC; but i can not use the help. Documentation and books on line are fully installed. I uninstalled an installer SQL 2005 two times, choosing all the components, bat help is not working. when I try to get help, the MS Doc...more >>

sql date help
Posted by Peter K at 5/10/2007 3:19:22 AM
Hi I have a table with columns like: Name varchar RegDate datetime I need a stored procedure which allows me to select a list of rows where RegDate falls between two supplied values. ALTER PROCEDURE my_stored_procedure @RegDateFrom DateTime = null, @RegDateTo DateTim...more >>

Inserting CSV file into SQL Table
Posted by Tom Woods at 5/7/2007 4:42:44 PM
I have a CSV file that I would like to insert all records into an existing table. I have the following command that is giving me vague parameter errors. Can anyone see what I'm doing wrong? ADOCommand.CommandText := 'INSERT INTO MyDatabase SELECT * FROM [TEXT;HDR=Yes;Database=F:\MyDirect...more >>

Updates fail
Posted by Brian Preston at 5/7/2007 6:26:01 AM
I installed SQL Server 2005 Express Edition from a prompt during install of Office 2003 with Access. I don't use SQL databases and don't need to connect to them. Can I uninstall from Add and Remove Programs without throwing off other seqments of Office Pro? I am attempting to end the error ...more >>

All record count
Posted by Danish at 5/7/2007 4:09:02 AM
Hi, I have one database and i want to count all the tables and records under the each table. how to perform this action? regards danish...more >>

2005 Check user access
Posted by Jesper Nielsen at 5/7/2007 12:00:00 AM
How do i determine if a SQL login have been granted rights to a specific database. I have tried querying sys.server_principals but it returns even if the user has no rights What i want do do i basically, if the user exist for this database, drop him and recreate his login to this databas...more >>

How do I create a new stored procedure
Posted by Paul Kraemer at 5/5/2007 12:16:00 PM
Hi, I just started using SQL Server 2005. I created a database and created one table with no problem. Next, I wanted to create a stored procedure. In SQL Server Management Studio, I navigated the menu tree on the left down to Databases | MyDatabaseName | Programmability | Stored Procedures...more >>

Copy SQL Svr 2000 db and import into 2005
Posted by Paul Kraemer at 5/5/2007 10:14:00 AM
Hi, I have a SQL Server 2000 database on one PC. I would like to make a copy this entire database (tables, stored procedures, etc) and import it into SQL Server 2005 (which I have on another PC). Can anyone tell me how I can do this. Thanks, Paul -- Paul Kraemer...more >>

SQL 2005 Express on Windows 2000 Server
Posted by sql at 5/5/2007 12:00:00 AM
Is SQL 2005 Express supported on Win2000 Server? In the past I have installed and used SQL 2005 Express under WinXP and Win2003 without problems. I have tried installing SQL 2005 Express on a physical machine running Win2000 and everything installed OK. Problem is, the SQL Express Managemen...more >>

Regenerating a table
Posted by John at 5/4/2007 9:03:23 PM
Hi We have a table in the db that we suspect is corrupt. There are only about 40 or so records in there. What is the way to completely recreate this table so it is all clean? We also need the data that is already in the table after rebuild. Thanks Regards ...more >>

Backslash problem with storing text file in MS SQL Server Text field
Posted by Mike at 5/3/2007 11:17:58 AM
I want to store an ini file in a Text field. However if a line in the ini file end in a \ MS SQL Server seems to regard that as an escape character and ignores the following carriage return. So the ini file becomes corrupted when you retrieve it and save to a text file. e.g. [Options] Repor...more >>

Provision a new database
Posted by stevesj at 5/2/2007 6:08:14 PM
I have database with a few tables, stored procedures, etc. I need to recreate/duplicate this database (without the data) for each new customer that signs up for my service. I'm not sure what this process is called and am looking for direction on automating / scripting this task. Thanks ...more >>

Stored Procedure (update) doesn't run, but OnRowUpdated, it shows it did
Posted by Randy Smith at 5/1/2007 4:50:58 PM
For some unknown reason, my SQL Server 2005 Stored Procedure does NOT update. In other words, after executing, it returns "Row updated successfully". protected void gvLaborRates_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { Alert.Show("Unabl...more >>


DevelopmentNow Blog