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 > november 2005 > threads for monday november 14

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

Update records in CLR-UDF
Posted by K.k at 11/14/2005 10:50:06 PM
Hi, I want to update some records with CLR-Function. But I got error that indicate I can't edit records with CLR-Function. "Error Message: A .NET Framework error occurred during execution of user defined routine or aggregate fn_myFunction: System.Data.SqlClient.SqlException: Invalid use o...more >>

abrupt client disconnect
Posted by vanitha at 11/14/2005 10:40:02 PM
Hi, If the client is disconnected abruptly from the server, from where do we get the log? how do we get the data from the server that the particular client is disconnected abruptly? Thanks Vanitha...more >>

Hel with Query Design
Posted by John at 11/14/2005 8:53:12 PM
Can someone please help I have two tables: 1.Project Table that holds a Unique Project No 2. Quotes table that holds the Project No, Quote Number and Creation date and quote value. There are multiple quotes for each project. I want to return Project No and one quote Value for each Pro...more >>

OT: IT Project Failure Rates
Posted by Jordan R. at 11/14/2005 8:47:25 PM
I'm posting to this question to the selected NGs because I'm interested in getting the viewpoint from within the "trenches" (not from academia or the big consulting firms). At the launch last Monday, one of Steve Ballmer's early slides presented the fact that something like 35% of IT projec...more >>

excluding timestamp field in insert
Posted by MarkT at 11/14/2005 7:31:01 PM
I need to create a lot of simply queries that copy records from one table to another. The queries are like the one below: INSERT INTO tblEmp SELECT tblEmp2003.* FROM tblEmp2003 WHERE tblEmp2003.EmployeeId='001' My problem is that all the tables contain a timestamp so the querys fail b...more >>

Insert inside function
Posted by Ilmgard at 11/14/2005 5:11:02 PM
Hi, I want to manipulate the contents of two column (ID and DESCRIPTION) of existing table (ZZPRODUCT_TABLE) into table NEWHIER. The following function is just copying those two column without any alteration, but on syntax checking, it gives "Error 443: Invalid use of INSERT within a functio...more >>

Advantages/Disadvantages of TEXT Column type in SQL 2005
Posted by Ed_p at 11/14/2005 5:08:08 PM
Hello, I know this question has been asked before, but I'd like to get the opinions from others before I continue with my database. I am creating a Database to track calls for a Tech Support dept. There are some tables like tb_Call, tb_Ticket where I need to allow a user to enter a long...more >>

Table Update (Increase column size)
Posted by KT at 11/14/2005 4:45:22 PM
Does increasing column size get logged? I want to make sure it will not take up all my disk space. I'm increasing a varchar field so it should not log much. SQL 7 KT ...more >>



Variable database names
Posted by Mark Lewis at 11/14/2005 4:40:03 PM
I have an application which uses a different database for each company i.e. XXXCo1, XXXCo2, XXXCo3, XXXCo999. I need to write T-SQL stored procs which access each company database to insert transactions from a common source into various tables within the appropriate company database. I prefer ...more >>

move data between databases in transaction
Posted by John at 11/14/2005 4:35:18 PM
Is it possible to move data from tables in one database to, schematically, identical tables in another database within a transaction? The way I have found to move data between tables in different databases is to create a linked server and run the following statement. sp_addlinkedserver N'M...more >>

xp_cmdshell
Posted by Gary Johnson at 11/14/2005 4:33:00 PM
When executing the statement: exec master..xp_cmdshell 'dir c:\*.* /b' on SQL Server 2000, I get the expected results. When executing the same statement on SQL Server 7, I get the simple response of: (0 row(s) affected). In addition, if I execute the statement: exec master..xp_cmdshe...more >>

Resetting @@Fetch_Status
Posted by Charlie NO[at]SPAM CBFC at 11/14/2005 4:26:26 PM
Hi: if I run a loop like so... While @@FETCH_STATUS = 0 BEGIN ...Some code END It will break out of loop when @@FETCH_STATUS = -1. The problem is if I try to run it again, @@FETCH_STATUS will remain at -1 and loop in never entered. I have to close connection to get it to r...more >>

Determining # of business days from a calendar table
Posted by Terri at 11/14/2005 3:08:11 PM
My calendar table is not designed very well but it can't be changed. It doesn't show every day with certain days flagged as holidays, it just shows holidays. My transactions have a start and end date. I want to determine the number of business days. If my start and end date where 11-14-2005 and ...more >>

Architects.......
Posted by sql.greg NO[at]SPAM gmail.com at 11/14/2005 1:22:51 PM
I have tables in a web site database which customers fill their preferences to receive emails regarding some topics. New customers are added everyday and existing customer update their profile. I have also an internal system for internal employees. The table in the website and the one in the int...more >>

Q re: Statistics & Query Performance
Posted by george.durzi NO[at]SPAM gmail.com at 11/14/2005 12:57:18 PM
In the last couple of weeks, my SQL server has been occasionally bogging down during the day. I noticed that it was when a stored procedure that usually takes 2 seconds to run timed out. I ran sp_updatestats in Query Analyzer and everything went back to normal. AUTO_UPDATE_STATISTICS is set...more >>

2 million records
Posted by Precious Acheru at 11/14/2005 12:46:13 PM
I Got this web application runnin on Sql Server 2000 now using ACT to test a search function wit about 500,000 records in the database, gives me about 144RPS, but on two million records i get rates as low as 8RPS my Server runs on a P4 3.2GHZ, 1 GB Ram, 250GB sata HDD does anyone have better...more >>

SERVERPROPERTY
Posted by Tony at 11/14/2005 12:16:09 PM
How can I use this function dynamically in a stored procedure against several different servers? I know what to do with the info after I get it, I just don't know how to get it from any other server besides the one I'm connected to at the time. Thanks, Tony...more >>

query reg Indexed view
Posted by Bhaskar at 11/14/2005 11:58:02 AM
Hi , I am created a view and using the COALESCE function in the defintion of the view. WHen i tried to create a Clustered index on this view, i am getting below warnning. 'Warning: The optimizer cannot use the index because the select list of the view contains a non-aggregate expression.'...more >>

Database problem
Posted by Roy Gourgi at 11/14/2005 11:21:30 AM
Hi, I am trying to add a row to my database and although it does not give me an error message, it is not adding it to my database. I am using C# and SQL 2005 Express editions. When I look into my Database Explorer I do not see the row added. What are the steps that have to be taken to crea...more >>

wzzip hangs under MS SQL 2000 sp3a xp_cmdshell
Posted by marsianin76 NO[at]SPAM tut.by at 11/14/2005 10:49:51 AM
Hi folks, wzzip is a command line support utiliity, Winzip 8.1 installed Script below works fine from QA on my PC. DECLARE @Command varchar(100) SET @Command = '""c:\program files\winzip\wzzip.exe " -yb "c:\a.zip" "c:\a.txt""' execute master.dbo.xp_cmdshell @Command But hangs on remot...more >>

How can I do a monthly pull that will which take
Posted by annstephany NO[at]SPAM hotmail.com at 11/14/2005 10:49:00 AM
How can I do a monthly pull that will which take data from the 21st of the next month to the 20th of the next month? For example. This month I will run a data pull that I will want to pull 12/21/05 -1/20/06. And then next month it will be 1/21/06-2/20/05. Would I use datepart? If so, how? ...more >>

command textbox in job has limitations ??
Posted by maxzsim via SQLMonster.com at 11/14/2005 10:45:55 AM
Hi , Is there any word limitations in the command text box of a job Management -- > SQL Server Agent --> Jobs ?? it seems there is and it has given me some issue. i have pasted all the SQL statements into a .sql file but how do i call that file ? i know using Osql is able to do so but...more >>

Qualified Joins
Posted by Dave S. at 11/14/2005 10:00:11 AM
I need a query that compares two tables with times in them and returns only the common records with the lowest time. Table1 recordID ArrivalTime 12345 12:01am 12346 12:30am 12347 12:45am Table2 recordID ArrivalTime 12345 12:03am 12346 12:29am 12347 12:44am T...more >>

How to update
Posted by J-T at 11/14/2005 9:41:11 AM
I have a base table which its primary key is used in 4 different tables as foriegn key (something like Client ID) .Now there are some wrong Client IDs in this table.I need to delete some of them and update the others. I know that would be problematic ,but I don;t know how to do this cascading ...more >>

select into a temp table
Posted by Krop at 11/14/2005 9:33:03 AM
Hi, ideally I'm trying to get the equivalent of select * from @my_table into #t1 but SS2K can do that. I can't use xp_sprintf or exec as they can't use a local temp table. So, I've settled for a simple if...else. Well, I thought it'd be simple but if I try the code below it says #t1 already...more >>

Need help updating row of view with unique clustered index
Posted by Nathan Alden at 11/14/2005 9:11:36 AM
I have a view with a unique clustered index. When I try and perform an UPDATE on a base table of the view, I receive this error: Server: Msg 2601, Level 14, State 3, Line 1 Cannot insert duplicate key row in object 'LoanStatusView' with unique index 'IX_LoanStatusView_Status_Deleted_Approved...more >>

ISNUMERIC BUG?
Posted by Dave at 11/14/2005 8:54:33 AM
SELECT ISNUMERIC('3D42') returns 1 but I have not been able to cast it to any numeric data type. Am I missing something? ...more >>

Challenge revisisted
Posted by Morten Wennevik at 11/14/2005 8:51:43 AM
Hi, I'm trying to port som old access code to asp.net and the access solution has a couple of queries to sql server that I'm not sure work as expected. I think the idea of the query is to identify if the same event (slaugher of reindeer) is registered in two different places (field 5 in my last ...more >>

Temp Table in Cursor.
Posted by Seequell at 11/14/2005 8:15:07 AM
oHi, Why local or global temp table data are not viewable that is created inside a cursor with in the same session. Is it due to temp table availability (scope) only within cursor. Can someone give some explanation? Thanks in advance. --Seequell...more >>

Splitting comma separated memo field into another table
Posted by timothy.pollard NO[at]SPAM btinternet.com at 11/14/2005 6:54:13 AM
Hi all I have a problem I can't get my head around. I am upscaling an old Access db into a new SQL Server one and am trying to correct some of the design deficiencies of the old db. The db stores news stories, categorised by location. Unfortunately the location data is held in the form of a...more >>

Speed-Up Script
Posted by Butaambala at 11/14/2005 6:16:11 AM
Hello, I have two tables, two user-defined functions, and one script. all of these objects are detailed below, including CREATE TABLE statements, with CREATE INDEX lines. the sript is working properly, but going very slowly. I am hoping that someone can help me to make it more efficient! T...more >>

Populating a Record Set
Posted by Chaplain Doug at 11/14/2005 5:31:19 AM
SQL Server 2000. Excel 2003. I know how to set an Excel sheet to query my SQL Server database table(s) and populate the sheet cells. This works for some of my needs. But in general I would like to be able to do a query and have the results go to a record set, that I can then programmatical...more >>

Help with new Synonym feature
Posted by Chris McGuigan at 11/14/2005 5:06:06 AM
I have found what I think is a good use for synonyms. However there's a BUT I'm hoping someone can help me with. I have several Great Plains databases for each of our overseas operations. I use replication to pull these tables into one database but I put them in seperate schemas, i.e. UK.IV001...more >>

how to query a stored procedure
Posted by Jan at 11/14/2005 4:02:02 AM
Hi, A very simple question: How can I query a stored procedure..? For example: SELECT * FROM sp_tables WHERE table_type = 'VIEW' Thanks!!...more >>

Combo box to exclude blank input
Posted by Sean at 11/14/2005 3:59:07 AM
Hi I have a combo box that displays a list of company names. Some entries do not have a company name on the form so the textbox remains blank. Therefore in the combo box there are alot of blanks in the list. How do I get the combo box to just list out the company names without the blanks? ...more >>

Duplicate record removal
Posted by Howard at 11/14/2005 3:50:33 AM
I can identify the duplicate rows and show number of duplication by using this SELECT [USER_NUMBER], [EMAIL], Count([USER_NUMBER]) AS NUM FROM USERS GROUP BY [USER_NUMBER], [EMAIL] HAVING Count([USER_NUMBER]) > 1 I can't figure out how to delete duplicate records and keep one distinct ...more >>

SQL Server 2005 and Visual SourceSafe integration
Posted by Harri Pesonen at 11/14/2005 3:46:04 AM
Hello! I installed SQL Server 2005 and then Visual SourceSafe 6.0d, and now SQL Server Management Studio does not detect SourceSafe. I tried running SSINT.EXE, it helped with Visual Studio .NET 2003, but it does not work with Management Studio, Options / Source Control / "Current source contro...more >>

removing duplicate rows
Posted by Stimp at 11/14/2005 3:31:45 AM
I've been given a table that has hundreds of duplicate rows but I'm having a bit of trouble trying to remove them, leaving just one unique row, so maybe someone here can shed some light on it... OK so here's the table spec: VFEATURE { idVFeature unique identity idFeature ...more >>

How to consolidate multiple rows into a single column
Posted by jwgoerlich NO[at]SPAM gmail.com at 11/14/2005 3:29:50 AM
Hello, I would like some help on developing a SQL query. I have a Team table and a Person Table. For simplicity sake, lets say the Team has a key and team name. The Person has a person key, team key, and person name. I want to query for all team members, and store the results in a single ...more >>

import a backup to SqlServer 2005
Posted by benoit at 11/14/2005 3:25:02 AM
Hi, this might be a pretty ovious question but anyhow I created a backup file of my Databases in SQLserver 2000 How can i load these into SqlSErver 2005 that I just installed I always seem to get errors... thx...more >>

SQL Statement Design Problem. Please Help
Posted by kelvinweb NO[at]SPAM gmail.com at 11/14/2005 2:05:01 AM
Hi All, I don't know how to write SQL Statement, Please comment. My Report have 4 layers in same table. Please comment my following SQL Statement. 1st Layer (Summary) SELECT COCD05, DESC60, SUM(LQTY70) AS LQTY70, SUM(BLIV70) AS BLIV70, SUM(MARGIN) AS MARGIN FROM dbo.SHIST002 WHERE (SHIST002...more >>

export table with text and ntext fields
Posted by Xavier at 11/14/2005 2:02:05 AM
hello, i have to export more tables. This tables has all kind of fields (date,text,ntext ....) What is the best way to export this data so that the data could be later imported on a other server ....(CSV? .....) any ideas? thanks Xavier ...more >>

SQl Mail vs Sql Agent Mail
Posted by Sammy at 11/14/2005 1:56:08 AM
Hi I have a job that sends a report via Sql Mail...this report displays as over 10mb in the properties of the mail box. As its over 10 mb it does not get sent as 10mb is our internal limit. Yet when I create this report via DTS using Sql Agent Mail the report is only 4 mb...has any one else...more >>

t-sql question
Posted by ALe at 11/14/2005 1:51:11 AM
hi everybody!!! is it possible to use the result of a stored procedure in a select statement, something like: exec sp_1 'parametr1', 'parameter2' = column1, column2, column3 select column1, column3 from ( exec sp_1'parametr1', 'parameter2' where ..... ) I need to do something like ...more >>

Findout matched records in 9 tables
Posted by Paul at 11/14/2005 1:02:04 AM
Hello I got 9 tables in SQL 2000 database (APXT) and each table have more then 10000 entries. My task is find out matched records in two columns of 9 tables. for example in each table column 1 "DOB" (Date of Birth) has 6 zero(mmddyyyy=01121982) and column 2 "UserID" has 5 zero (12345). Now my...more >>

Replace Multiple Characters
Posted by stelioshalkiotis NO[at]SPAM yahoo.gr at 11/14/2005 12:39:13 AM
Hi I need a select statement replace multiple characters from every row in a column. I know about replace : REPLACE ( 'string_expression1' , 'string_expression2' , 'string_expression3' ) but the question is how can i do the replace if there are multiple 'string_expression2' ? For example: ...more >>

My SQL is rusty
Posted by Mr Newbie at 11/14/2005 12:00:00 AM
Hi Guys, Im really rusty on SQL queries so a little help would be appreciated. I have a users table UserID Int UserName String Authoriser Int I am trying to work out one query to return the authorisers name given the users ID. Can this be done in one query string ? -- Best R...more >>

Don't think this can be done?
Posted by Geo at 11/14/2005 12:00:00 AM
I have a table (which I didn't design ) which has the following columns Monday,Tuesday, Wednesday,Thursday, Friday,Saturday ,Sunday each of which are flagged by either an'X' to indicate there is something on that day or an'-' to indicate nothing on that day. Is it possible to write a statemen...more >>

DENY ... CASCADE
Posted by Rebecca York at 11/14/2005 12:00:00 AM
Hi, Can anyone explain, in layman's english, what the CASCADE means? BOL's explanation for this is gibberish IMO ;) eg. GRANT INSERT , UPDATE ON dbo.MyTable TO [RoleX] DENY UPDATE ( myField) ON dbo.MyTable TO [RoleX] CASCADE Thanks. ...more >>

seeking advice on table setup with check constraint
Posted by astro at 11/14/2005 12:00:00 AM
I want to setup data validation on the server end but don't know the best practice for this particular scenario: problem: have a table - 'person' which has fields companyID (guid, FK), PersonID (guid, PK), mailTo (bit) for all rows in a given company I want to have 0 or 1 persons with ...more >>

Trigger Question
Posted by Dazza at 11/14/2005 12:00:00 AM
I have been tasked with creating a procedure/trigger that will execute a dts package (processing a cube) but not for individual updates/inserts (I wish it were so simple!!) . What is required is that the trigger will fire only when a block of records have been inserted/updated. Any sugge...more >>

No .Fill method in Data Adapter
Posted by David C via SQLMonster.com at 11/14/2005 12:00:00 AM
I am developing a Smart Device project for my Symbol MC9000 Windows Mobile handheld. I am trying to make a simple connection to a SQL server. My problem is my Data Adapter object does not have a .FILL method as it always has in normal C# desktop apps. I also noticed I cannot do a dataadapter ...more >>

"Data Source=localhost;..." fails with : General network error.
Posted by Gaetan at 11/14/2005 12:00:00 AM
I replaced SQL 2000 with SQL 2005 Developer edition and my application could not connect to the local SQL server anymore. When connecting from a .Net 1.1 application using the following connection string: "Data Source=localhost;Database=MM;Integrated Security=SSPI" I always received the fol...more >>


DevelopmentNow Blog