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 > april 2007 > threads for thursday april 19

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

Check if record is full-text indexed
Posted by Pacific Fox at 4/19/2007 11:52:38 PM
Hi all, I am dealing with a very large database, and as soon as a record is submitted I need to run a full-text query against it (the new record). I believe it might take a while before the record is fully indexed and therefore would not return a result. How can I check whether the rec...more >>

Opposite of Union Select query
Posted by chuck at 4/19/2007 9:17:33 PM
I have a table which looks like this: table1: Id col1 col2 col3 1 a b c 2 d e 3 f g 4 h Which I can convert to this: old_Id new_col 1 a 1 b 1 c 2 d 2 e 3 f 3 g 4 ...more >>

dynamically change column name when displaying
Posted by Hang at 4/19/2007 5:18:16 PM
Hi, I have a table, after i query the table for displaying, several column names will be changed based on the condition, but I don't want change the acutal table column names, it will only be changed when displaying. I tried CTE and virtual table with column aliases, but they doesn't work, t...more >>

Group By Column with Natural Number Values ( 1 , 2 , 3, N) ...
Posted by sloan at 4/19/2007 3:19:30 PM
anybody have a better solution than what I have? Sql Server 2005 I have a list of Employees. Each Employee is in 1 Dept. (this is just a mock up to show what i need) I have now: (empid, deptid , artificialgroupingid) 1011 555 NULL 1012 555 NULL 1013 555 NULL 1014 55...more >>

Tools to help analyze SQL Profiler Traces in SQL Server 2005
Posted by JasonDWilson at 4/19/2007 1:52:01 PM
Are there any tools to help analyze SQL Profiler traces (.trc files or traces stored in a table) for SQL Server 2005? I believe there was a tool called something like read80trace for SQL Server 2000. I want to "normalize" query text, and find the heavy hitting queries interms CPU, memory...more >>

Query Syntax Error
Posted by RickSean at 4/19/2007 1:22:02 PM
How do I fix the following query? SELECT * FROM OPENQUERY(LNKsvr, 'SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY CatID, CatType) AS rownum, CatID, CatType FROM Category) AS D WHERE rownum between 11 and 15') ERROR: OLE DB provider "MSDAORA" for linked server "LNKsvr" returned...more >>

Seconds to mm:ss
Posted by CipherTeKST at 4/19/2007 12:18:04 PM
I am trying to convert seconds to minutes. for instance 103 seconds, I try 103 / 60 but I get 1.71. I need to get 1 minute and 43 seconds. Any help will be greatly appreciated! -- CipherTeKST MCSE: Security 2003, CCNA, Security+...more >>

Can I JOIN Database Tables on Different SQL Servers
Posted by Fred Block at 4/19/2007 12:02:42 PM
Hi All, I have a query that will JOIN tables in different databases within the same SQL server. However, what if a different SQL Server is registered and I need to JOIN into a table on that server. Here's what I have: SELECT * FROM sourcedb.dbo.tablename srcdb WHERE srcdb.column_name N...more >>



Absolute time diff
Posted by David S. at 4/19/2007 11:59:32 AM
How can I get the absolute time diff between to records regardless of weather it is negative or not. in other words I am looking for column absdiff below. time1 time2 diff absdiff 12:01 12:03 2 2 12:04 12:01 -3 3 ...more >>

Outline number sorting
Posted by Jeram at 4/19/2007 11:26:54 AM
Is there a way to in SQL to sort outline numbers to retain the "natural order" state? E.g.: 1.1 1.2 1.3 1.10 Shows up now as: 1.1 1.10 1.2 1.3 Is there any way to use recursive functionality to check for longer outline numbers (i.e., like 1.1.1.1.1)? -J ...more >>

Update statement performance issue
Posted by Omar Lopez at 4/19/2007 11:02:01 AM
Hi, I have a question regarding an "update from" statement performance issue, the "update from" statement normally updates around 4 or 5 millions of rows, this process has been always lasted around 4-7 mins (for around a year), but last days we have been having delays due to this update statem...more >>

query by sub-categories with category totals
Posted by John Grandy at 4/19/2007 11:00:37 AM
This is actually a more advanced data structure than category/sub-category, but I'm not sure of the nomenclature. For a many-to-many data-structure that includes a join table, for example : ServiceTypeEnum table ServiceId ServiceName (ex: FoodAndBeverage , Lodging , Concierge , Valet, Mis...more >>

case stmt - need to select subset
Posted by kyong at 4/19/2007 10:42:02 AM
hello!! quick question.. i need to do a sub select based on a param and wanted to know how to do that... I want to do something like this... -- @paramID i have this.. SELECT x, y, z FROM myTable WHERE ( CASE WHEN @paramID IS NULL THEN x NOT IN...more >>

problem understanding coalesce function
Posted by Rich at 4/19/2007 10:14:03 AM
According to BOL, coalesce returns the first non-null value in a column CREATE TABLE #tmp2(fld1 varchar(10), fld2 int, fld3 int) INSERT INTO #tmp2(fld1, fld2) Values('a',1) INSERT INTO #tmp2(fld1, fld2) Values('b',1) INSERT INTO #tmp2(fld1, fld2) Values('c',1) INSERT INTO #tmp2(fld1, fld2) ...more >>

Cannot BCP in from a view
Posted by Yofnik at 4/19/2007 9:56:46 AM
Hello All, This is driving me crazy and I would appreciate some help. I am trying to transfer some data from one database to another database with the same schema. I have done this before with BCP but have no idea why this is happening now. The table I am trying to copy has the follow defin...more >>

creating a new user for database
Posted by rodchar at 4/19/2007 9:56:01 AM
hey all, like i said i'm creating a new user for my database and i was just wondering why there is User name and Login? what's the difference? and it its applications? thanks, rodchar...more >>

select and display 1:many
Posted by cris at 4/19/2007 9:24:03 AM
hello, i have one table that contains the following records(2 FIELDS). id $ 1 10 2 20 3 25 the second table contains all tax information id $ tax 1 2 state 1 3 ferderal 2 3.5 state 2 5 federal i would like to display the...more >>

Creating report and sending it in an email.
Posted by jack at 4/19/2007 6:56:03 AM
Hi im new to this group and sql server 2005 too Im trying to use sql 2005 reporting services. Im trying to create a report and send this report in mail in any format like for example in excel or word format.. but i dont know how to start and how to do this.. I would be glad if any one help m...more >>

diff at a glance
Posted by rodchar at 4/19/2007 6:38:05 AM
hey all, is there a quick way to get a glance of the differences of a stored procedure in one database and the same stored procedure on another database? thanks, rodchar...more >>

Question about standard restore procedures
Posted by B. Chernick at 4/19/2007 6:30:00 AM
Assume a database has been fully backed up to a disk file and that the disk file is automatically passed on to another server that has a job running that will restore it to a copy of that database. (I know there are probably more sophisticated ways to do this but this is what the boss wants f...more >>

How to get the first and last day of the previous month
Posted by Gopal at 4/19/2007 6:26:05 AM
Hi Friends, Need your assistance. I have few queries which i run every month which generates reports of previous months transactions. I just change the dates manually ( like BeginDate='2007-03-01 00:00:000 and EndDate='2007-03-31 23:59:59' for March 2007) and run the query manually . ...more >>

Backup/Restore of non-standard databases for beginners
Posted by B. Chernick at 4/19/2007 6:10:11 AM
I'm not really a DBA but I've been told to setup an automatic database restore on a server. For the most part this is simple (Restore Database blahblah from Disk = 'file name') What appears to be a problem is databases with physical files in non-standard locations (Navision for example, mu...more >>

Challange With Search Stored Procedure and Like Operator
Posted by GCeaser NO[at]SPAM aol.com at 4/19/2007 5:58:00 AM
I have a situation where a use can search for some items in my database using one or more fields on a screen. I would like the search to execute through a stored procedure versus dynamic SQL passed in from the program or dynamic SQL built in the stored procedure and executed. My problem is thi...more >>

MSDTC on server '' is unavailable - INSERT to #tmp EXEC sproc
Posted by dickster at 4/19/2007 5:44:14 AM
I have 2 sprocs GALAXY & STAR GALAXY returns a resultset based on a query where the calling tables are on linked servers STAR runs on the same server as GALAXY and attempts to insert the resultset of GALAXY into a #temp table I get this error: MSDTC on server '---' is unavailable eg. ...more >>

SUBSTRING FUNCTION
Posted by Derekman at 4/19/2007 5:26:01 AM
I am writing a stored procedure to try to pull out specific text from a trigger. I am using the code displayed below in order to try to selectively pull out text from the trigger. My over all hope is to create a front end with VS that will allow the end user to replace the specific area with...more >>

RETURN vs OUTPUT
Posted by achristov at 4/19/2007 3:46:02 AM
Hi, Which one is better to use in a stored procedure? To narrow scope: return number of row in a table. Both methods may be used with the same effect so, what is the best practice when returning scalar values from a SP? Thanks...more >>

How to implement multiple assignment?
Posted by colinehat at 4/19/2007 2:37:00 AM
Consider the following three tables: CREATE TABLE PersonInfo ( ID INTEGER NOT NULL PRIMARY KEY) ; CREATE TABLE Earns ( ID INTEGER NOT NULL PRIMARY KEY REFERENCES PersonInfo) ; CREATE TABLE SalaryUnknown ( ID INTEGER NOT NULL PRIMARY KEY REFERENCES PersonInfo) ; CREATE TABLE Unsal...more >>

Determine if SQL Server in recovery process from code
Posted by DUS at 4/19/2007 2:16:00 AM
Hello, We are experiencing problems with SQL Server (seen on 2000 and 2005) when it starts up and enters the recovery process. If the server has numerous databses it can take a significant amount of time for the recovery process to complete. When the recovery process is running the SQL Serv...more >>

Assign a select ...case.. to a variable
Posted by loufuki NO[at]SPAM gmail.com at 4/19/2007 12:57:36 AM
Hi How do you resolve this DECLARE @Name VARCHAR(20) SET @Name = 'NewColumn' SELECT column1, CASE WHEN Column2 = 2 THEN 3 AS @Name the above Statement gives an erroR AT @Name any work around for the above select statement? Thanks ...more >>

select then update in stored procedure
Posted by GotDotNet? at 4/19/2007 12:00:00 AM
I have a stored procedure that is doing a select on some tables and returns the results to a device. I need to update a column after I do a select and the data is returned. so for example: select Id, downloaded, name, from custSales I need to then update the download column to True afte...more >>

xp_cmdshell
Posted by Scott Rymer at 4/19/2007 12:00:00 AM
SQL 2005 SP2 (9.0.3054) Once a month, I am being asked to dupicate our live production system over to a test environment. I thought I would make my life easier and make a stored procedure to do it for me. The production system includes an SQL DB and some other files on the server that I...more >>

DateTime
Posted by New Bee at 4/19/2007 12:00:00 AM
I am using sql Server 2000 and writing a stored procedure for adding a record. I have a question on the date format. If I enter the date in the UK Format dd/MM/yy it complains because it needs it in us format, is there a way I can specify the format in the stored procedure ? ALTER PROCED...more >>

Flattening table
Posted by bob at 4/19/2007 12:00:00 AM
Hi, I have an existing query which returns a row of data per customer. I need to add the phone numbers that are stored in another table with a one ot many relationship on the cust ID. I want to incorporate all of the phone numbers and their type into a string that is an additional field in the...more >>

Really well locked down sqlserver
Posted by Michael C at 4/19/2007 12:00:00 AM
I've encountered a customer has his sqlserver so locked down I can't do anything. SA account has been disabled and I can't login via windows authentication. The only user that can login has no rights to do anything. Is there any way around this? This is sql2005 and of course no one remembers ...more >>


DevelopmentNow Blog