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 > december 2005 > threads for monday december 12

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 31

Logical File Rename
Posted by Manoj at 12/12/2005 10:42:02 PM
Dear All How to rename the logical file name of the database? thanks Manoj kumar...more >>


Using wilcards from within table fields
Posted by Adrian Dev at 12/12/2005 9:01:33 PM
Hi, I have a table "aa" like this: create table aa ( cell char(10), desc char(10) ) insert aa values ("*", "Vehicle"); insert aa values ("*car*", "Car"); I want to achieve the following results: a) select desc from aa where cell like "blue car" >Vehicle >Car b) selec...more >>

sql 2000 ÖеĴ洢¹ý³ÌµÄÎÊÌâ
Posted by maomao at 12/12/2005 8:33:19 PM
sql 2000 ÖеĴ洢¹ý³ÌµÄÎÊÌâ ÎÒÊǸöÐÂÊÖ£¬Çë¶àÖ¸½Ì¡£ ÎÒÏ뽨¸ö´ø²ÎÊýµÄ¹ý³Ì£¬À´ÊµÏÖÌí¼Ó¼Ç¼£¬µ«ÀÏÌáʾ±äÁ¿Îª¶¨Ò壬£¿£¿ create proc prc_add ( @i_Id int, @c_name_bm varchar(20), @c_attri_bm varcha(20) ) AS BEGIN INSERT tb_employee VALUES ( @i_Id , @c_name_bm , @c_attri_bm ,...more >>

Explanation of INDEX(index, index, ...)
Posted by Thierry at 12/12/2005 6:36:32 PM
Hi everybody, can someone explain me how to use : SELECT foo FROM table (INDEX(indexA, indexB, ...)) Thanks, Thierry ...more >>

sp_add_jobschedule woes
Posted by Ben at 12/12/2005 6:17:05 PM
Hi I am using this code to schedule a job to execute in 5 seconds. It creates the schedule. If I switch to the Job in enterprise manager before the 5 secs are up: it is marked enabled. If I switch to the job 5 seconds later it is marked disabled. But the job has not run. If I manuall...more >>

Difficult Query
Posted by John Smith at 12/12/2005 6:13:20 PM
Hello all: Well in my opinion it is difficult but for some SQL gurus out there it is probably simple. I have a table with a bunch of bids and another with a bunch of contractors. Each bid can have any number of contractors and the contractors can be associated with any number of bids. ...more >>

Store Procedure return XML
Posted by Goh at 12/12/2005 5:53:05 PM
Dear expert, I recently read an article http://www.eggheadcafe.com/articles/20051130.asp . It require me to create a store procedure like below. I cannot create it becasue of got bug inside the statement. I'm news in MSSQL 2005 with these new syntax. ALTER PROCEDURE [dbo].[GetEmployees...more >>

Problem with SELECT...FOR XML in SQL 2000
Posted by Henrik Skak Pedersen at 12/12/2005 5:48:11 PM
Hi, I have a problem with a SELECT..FOR XML Statement. I would like to do something like: DECLARE @DeletedXml VARCHAR(8000) SET @DeletedXml = (SELECT * from deleted AS Employee where Employee.Id = @Id FOR XML AUTO, ELEMENTS) But I get this error when I try to run: Incorrect syntax near...more >>



check restore verifyonly result
Posted by Tolgay at 12/12/2005 5:38:36 PM
How can I check one of my db backups result is vaild in vb or transact sql? For example if (RESTORE VERIFYONLY FROM disk=c:\1.bak) = isvaid then 'restore it else ' send a message End if thanks ...more >>

Index aginst table having lot of inserts
Posted by Bhaskar at 12/12/2005 5:26:03 PM
Hi , i have a question reg index on my table which is having somany inserts. is that good design to have index on table table which has lot of inserts? Thanks Bhaskar...more >>

Can SQL server return text in column instead of row?
Posted by Chakravarti Mukesh at 12/12/2005 5:04:48 PM
Hi Consider the query "SELECT names FROM Table1" It would return one column with some rows. Abc Xyz Pqr Mno I want SQL server to return is in columns like Abc Xyz Pqr Mno Thank You ...more >>

Copy schema and data from sqls2k to sqls2k5express
Posted by dbuchanan at 12/12/2005 4:53:01 PM
Hello, I am a newbie on this subject. How do I move a database in SQL Server 2000 to SQL Server 2005 Express? How do I manage SQL Server 2005 Express? Can that be done in VS 2005 Professional. Thank you, dbuchanan ...more >>

Copy Stored Procedures From 1 Database to Another Using Query Anal
Posted by RitaG at 12/12/2005 4:34:02 PM
Hi. I have some Stored Procedures (SPs) in one database (WebCentral). I have a table in another database (WebPPO) that holds the names of databases that I want to copy SPs from WebCentral to. I want to copy these SPs via code within Query Analyzer but have no idea how to accomplish this. ...more >>

Full Text Image Type
Posted by Prasad at 12/12/2005 4:29:18 PM
Hi, Can anybody tell me from which system tables / catalog views can I get the Full Text Image Type for a Column in SQL 2005 (Yukon). TIA Prasad ...more >>

checking for Null value
Posted by gv at 12/12/2005 4:24:49 PM
Hi, I'm drawing a blank on how to do this, I'm trying to return the rows where TempERCP.PI_Therapy column does not contain 'sphincterotomy' but, I also want the rows that contain 'Null' there which isn't being returned? SELECT CONVERT(varchar,TempERCP.Examdate, 111)as Examdate, TempERCP.H...more >>

Sum distinct days
Posted by Ryan D at 12/12/2005 4:09:01 PM
I have a table listing each occurrence of a value and I need to get the sum of the days which have this occurrence during the specified interval (which could be longer than one year). So currently I'll have something like this: 03/15/05 03/18/05 03/18/05 03/18/05 03/19/05 03/19/05 03/2...more >>

Why are numbers always integers?
Posted by Roger Twomey at 12/12/2005 3:20:03 PM
I am seeing something strange happening and I don't undestand why. If I type 'select 3/2' into query analyser I get 1. In a stored procedure I created a variable: @PagesExact Numeric(18,2) I then (I am using a query but the numbers are these for this specific one) do the following math...more >>

Table not vaild in VB.
Posted by Bert van den Dongen at 12/12/2005 2:32:17 PM
Hi Pro's. I encountered an error that I cannot solve: In my (compiled) VB-program I try to change the field "CustID" (alfanumeric) in 12 tables. (Update ... Set CustID = 'bla' Where CustID = 'blabla') This works for 11 files but not for the last one I created ("CUSTInvToBeRead"). The prog...more >>

Finding out data values that compromise integrity
Posted by Joe at 12/12/2005 2:29:02 PM
This is just your basic T-SQL question. If I have fact Table A with has a foreign key fk_1 (with no constraint) to look up Table B and I know that in fact Table A there are fk_1's that aren't on Table B what SQL would return all of the fk_1's on fact Table A that aren't on Table B? Apologies ...more >>

renaming a table
Posted by Les Stockton at 12/12/2005 2:12:02 PM
I know you can rename a table using sp_rename, but what I'm not sure about is how to specify which database. I'm doing this in VB (or in C#, it doesn't matter). I have a connection to the SQL Server. I can Exec sp_rename and give it oldname and newname for the table, but how am I making sur...more >>

Suppress a SPROC's return resultsets
Posted by Raterus at 12/12/2005 12:26:41 PM
Hi, (SQL Server 2000) I have a stored procedure used throughout our internal infastructure = that sends an email. I'm trying to make some changes to it, and these = changes are causing the stored procedure to return a grid/resultset (I'm = calling a system sproc within it and it's returning t...more >>

How do I fix this proc? (Table lock fails)
Posted by Hal Heinrich at 12/12/2005 12:01:03 PM
In a multi-user environment, this proc is expected to return distinct values for concurrent users - but it doesn't, some duplicates are returned. I thought that the 'BEGIN TRAN/COMMIT' with (tablockx, holdlock) would provide the required locking - I'm guessing that's where I went wrong. How do ...more >>

Reading a long string
Posted by louise raisbeck at 12/12/2005 11:46:03 AM
Hi there, How can i see what a long string value is? I have a stored procedure which creates a dynamic xml string and when i select it at the end of the SP the result is about 100 chars long although i know it is about 7000 long and I need to inspect the whole string, put it in an xml reade...more >>

Pivot Question
Posted by CJM at 12/12/2005 11:42:07 AM
I want to pivot some data returned from a query. I've use the standard technique [Sum(Case...)] below in the past, but in this situation it's not ideal. Typical solution: SELECT SUM(CASE WHEN MONTH(OrderDate) = 1 THEN 1 END) AS 'January' ,SUM(CASE WHEN MONTH(OrderDate) = 2 THEN 1...more >>

Issue when not storing null db values.
Posted by ChrisB at 12/12/2005 11:39:53 AM
Hello: Because of the possible issues associated with storing null values in the db, the development team of which I am a part opted to avoid using them when possible. This has resulted in an interesting issue - Because we are using surrogate GUID values as primary keys, if a foreign key...more >>

Reviewing deprecated SP's
Posted by Mike Labosh at 12/12/2005 11:23:34 AM
Over the weekend I was going through the SQL Server and our two most commonly used applications looking for stuff to deprecate for removal. Apparently, someone else did something similar. I found a whole fistful of stored procedures that go like this: CREATE PROCEDURE dbo.SomeProc AS ...more >>

filtering in the join clause
Posted by kevin at 12/12/2005 11:23:02 AM
I need to join tables a varchar, datetime and one money field. Is there any performance advanctage between putting these joins in a where clause versus in the the join clause. Following is only a demonstration of what I mean. The actual sql also links other talbles (on int fields thankful...more >>

Bit field index
Posted by JP at 12/12/2005 11:22:02 AM
I have a table with 5 bit fields on the end. Do you can any performace by indxing a bit field, even though its not used in any caculations or where clauses? -- JP ..NET Software Developer...more >>

SQL Calculation
Posted by Habibullah at 12/12/2005 11:12:02 AM
Hello every one. I have a table with 11 fields as follow: Column Name Data Type Length strEmployeeID varchar 9 strReportTime_Mon varchar 12 strReportTime_Tue varchar 12 strReportTime_Wed varchar 12 strReportTime_Thu varchar 12 strReportTime_Fri varchar 12 strCommute_Mon varcha...more >>

Express Edition - limitations?
Posted by Sandy at 12/12/2005 10:26:03 AM
Hello - Is the Express Edition able to handle 300 simultaneous users that are only adding new records? Can it handle a couple million records? Any help will be greatly appreciated! -- Sandy...more >>

Importance of MCDBA certification
Posted by Nicolas Verhaeghe - White Echo at 12/12/2005 9:58:53 AM
I have been working with SQL Server for 6 years now and I think it's time to get certified, don't you think? What do you suggest I do: home study with books, or attend evening classes? What is the job market like for MCDBAs? Is it important to couple it with other certifications like MCSE,...more >>

Stored procedure with conditional ORDER BY statement
Posted by Carol at 12/12/2005 9:58:27 AM
I have a stored procedure that needs to have the output returned ordered by a parameter passed by the user. I know I cannot just use a set variable in the ORDER BY statement. However, I'm a little confused about writing this. When I check my syntax, I get a successful statement, but the query...more >>

Help for INTRO function
Posted by Cristian at 12/12/2005 9:41:54 AM
Hello. I need to create a new table from a query result, then I've written this SQL command: "SELECT Name, Number FROM Friends INTRO Result" BUT SQL give me an error!! Please Help Me Bye Cris ...more >>

Conditional AND statement in stored procedure Select query?
Posted by Ramez at 12/12/2005 9:20:05 AM
This should be simple but I can't figure it out. So I have a select query and I want to run a conditional AND if a value is not NULL. Here is the type of statment I want to run. -- Declared values not shown. SELECT * FROM MyTABLE WHERE city = @city AND department = @department IF @sta...more >>

trim non-alphates
Posted by vongi at 12/12/2005 9:11:43 AM
Dear All: I would like to know if there is a way to trim a string only have alphates. For example, I have a string "Abc123Def5445=-\", but I only want alphates after trimming such as "AbcDef". Anyone could help. If no, how abount concert those non-alphates in the string to space, it als...more >>

possible to copy database with Tsql or SP?
Posted by Rich at 12/12/2005 8:58:02 AM
Hello, I need to create a copy of a Sql Server database. Is it possible to do this using Tsql or is there an SP(s) for doing this? Do I need to use replication for this? Thanks, Rich...more >>

Multiple Select Statements in 1 Query
Posted by scottstein NO[at]SPAM gmail.com at 12/12/2005 8:37:50 AM
i'm going to guess that there's no way to do this in T-SQL (or any other SQL implementation), but I figured I'd ask around: basically, what I'm looking to do is replace this union statement:: SELECT intX FROM Table1 UNION SELECT intY FROM Table1 with a syntactical shortcut: SELECT i...more >>

Converting SP to SQL Server 2005
Posted by Joe K. at 12/12/2005 8:13:04 AM
I have a SQL Server 2000 database that is approximately 100 GB in size with 200 stored procedures and 30 views. I would like to convert this SQL Server 2000 database to a SQL Server 2005 database. Have are the differences that I will have converting this database with triggers, indexes...more >>

Optimizing SQL Query
Posted by khris at 12/12/2005 8:10:14 AM
Hello, I have to run a script which will delete records from 10 tables based on a certain condition. Instead of having to run the condition 10 times I thought running it once would have better performance and did something like this CREATE PROCEDURE testScript AS set nocount on decl...more >>

Search an object in SQL Server 2005 Management STUDIO
Posted by Mark at 12/12/2005 7:26:02 AM
Hi, I cannot find "Object Search (F4)" feature in SQL Server Management STUDIO, is there any way to find objects by name or content in SQL Server 2005 Management STUDIO? Thank you ...more >>

Fill factor 100% affects performance
Posted by Panos Stavroulis. at 12/12/2005 2:38:02 AM
Hi, I've noticed something strange. I've got a table which contains a clustered index. Now I've noticed a very big differences in the logical reads of a complex join when I change the fill factor from 99 to 100. When the fill factor is less than 100 then the number of logical reads is aroun...more >>

Using a VB function in a query
Posted by Gal at 12/12/2005 12:09:15 AM
Hi I need to use a special vb function that I built in a data maniplation query, how do I do that? e.g. insert into NewTable(MyField) select MyFunction(AnotherField) from OldTable thanks gal...more >>


DevelopmentNow Blog