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 > october 2006 > threads for thursday october 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 31

Left processes after killing thread that executed stored procedure
Posted by Alexander Korol at 10/19/2006 11:48:01 PM
Hello! I am using SQL Server 2005. VB.NET framework2 I have to execute long running code in SQL Server. The execution is started in a separate thread in my application. What I need - is to stop execution whenever a certain event occures and start calling same long running procedure with ...more >>


Problems copying live DB for testing
Posted by NathanG at 10/19/2006 11:23:02 PM
Hi, I am using server 2005. I copied our live DB to create one for testing only. I renamed the db with 'test' on the end of the filename. Now the test db isn't working and gets no results from any queries. The queries are retrieving data, performing a calculation and output the results. The...more >>

help with query
Posted by JFB at 10/19/2006 11:07:10 PM
Hi All, I have two tables and I want in the result first record of the second table join as you see above. TableA Col001, Col002 1 Customer1 2 Customer2 TableB Col001, Value 1 100 1 30 1 60 2 20 2 70 2 ...more >>

Sql / Dot Net general discussion
Posted by Doug at 10/19/2006 7:03:33 PM
Hi, I wanted to start a general discussion more for getting some thoughts on what other people think/practice out there just to see how far (if at all) I'm off base on my own thoughts. My primary experience is developing applications using VB or DotNet. I have some sql skills but they are ...more >>

variables vs. exec(string) performance difference
Posted by no.spam NO[at]SPAM junk.mail.net at 10/19/2006 6:54:09 PM
Sorry about the cross post_ I think I posted this in the wrong group initially_ From: no.spam@junk.mail.net Date: Thu, 19 Oct 2006 07:41:53 -0400 First off_ pure - uneducated - hacker - novice - alert!! If you are offended by silly questions close this posting immediately! I'm sure this h...more >>

HOWTO: Image / Text Datatypes
Posted by Mike Labosh at 10/19/2006 6:31:43 PM
Humor me: I'm not doing anything like this in production; it just annoys me that SQL Server Northwind does this, and I don't know how to use it in an application: Consider the Northwind..Categories table: CREATE TABLE Categories ( CategoryID INT IDENTITY(1, 1), CategoryN...more >>

How to identify spaces within a field
Posted by wildfire2windsong at 10/19/2006 3:54:01 PM
I need to identify employees who have an initial after their first name in a field, for example: Melissa A What scripting can I use to help me identify all employees with a space and then additional letters after their first name? Below is the script I am currently using but it still ret...more >>

restore from log file
Posted by Keith G Hicks at 10/19/2006 3:01:02 PM
I'm trying to understand this but the help file makes it sound like you have to have a log file backup in order for it to work. That doesn't make sense to me. Let's say I have a db running and the mdf file is on a certain box. I back it up each night to a tape or CD and take it off site. Let's...more >>



backup help
Posted by JJ at 10/19/2006 2:03:19 PM
Here is my backup strategy for one of my database Full backup at 12:00 AM every day and log backup at every 30 minutes. For log backup, I would like to retain one day and their file name to be 'E:\IncrementalBackup\Test13:30:00' for log backup created at 1:30 PM and 'E:\IncrementalBackup\T...more >>

Adding non "Primary Key" in the create table statement
Posted by sid at 10/19/2006 1:58:30 PM
I need to write a "Create Table" statement with a "Primary Key" and a field that it keyed, but not primary. Any help is appreciated. Sid. ...more >>

BEST NEWSGROUP
Posted by RON at 10/19/2006 1:51:27 PM
I have been accessing the different Google NewsGroups (like ASP, ASP.NET, this one) & other free forums available on the web (I won't name them, to be on the safer side!) for quite some time now but with whatever little experience I have experienced in all the NewsGroups & forums, I have absolut...more >>

repeated transactions
Posted by sheelchitre NO[at]SPAM gmail.com at 10/19/2006 1:45:58 PM
I have a table where I have one transaction number(row) and five data items. If all entries are correct then the five values are OK, but if there are two entries one manual and one automatic for one transaction the row gets repeated. The repeated transaction has correct manual and automatic data...more >>

Very poor performance in join query
Posted by Chama at 10/19/2006 1:40:03 PM
Hi all: I have a Sp with a big select. The select has 80 columns from 12 tables. The query contain DISTINCT clause. All tables have index and the where clause have 8 filter fields. The statistic of the index are updated. The tables have aprox. 1 million of records each. The result of the qu...more >>

striping milliseconds from timestamp
Posted by Kim at 10/19/2006 1:28:53 PM
Can somebody please tell me how I can strip the milliseconds from a timestamp without losing the seconds in the process. I have tried several different things the closest being dateadd(minute, datediff(minute, 0, [timestamp]), 0) the problem with this format is that it returns 00 for the seco...more >>

Counting Entries by 24 Hour Period
Posted by randy1200 at 10/19/2006 1:06:02 PM
I have a table that includes a DateTime column. I need to create a select statement that displays the number of entries for each period: Period Count 01 Oct 06 + 4 7 02 Oct 06 + 4 10 03 Oct 06 + 4 10 If the 24 hour period began at m...more >>

How to write this query...
Posted by modhak NO[at]SPAM gmail.com at 10/19/2006 12:47:06 PM
Hi All I have a table as follows... CREATE TABLE dbo.run_details ( seqid int identity primary key, buildid int, runid int, testCaseId int, testStartTime SMALLDATETIME, testEndTime SMALLDATETIME ); insert into dbo.run_details (buildid,...more >>

Query Help
Posted by modhak NO[at]SPAM gmail.com at 10/19/2006 12:44:53 PM
Hi All I have a table as follows... CREATE TABLE dbo.run_details ( seqid int identity primary key, buildid int, runid int, testCaseId int, testStartTime SMALLDATETIME, testEndTime SMALLDATETIME ); insert into dbo.run_details (buildid,runid,testcaseid,testStartTime,testEndTime) ...more >>

Null Values
Posted by MittyKom at 10/19/2006 12:23:03 PM
Hi All Why is it that if i subtract a null from a value like 27 i do get NULL? I am expecting to get 27. Below is the SQL for the table and the sample data. Create table temp_Oct (Pbid int identity (1,1), num1 decimal (18,2), num2 decimal (18,2)) insert temp_Oct (num1) values (27 ) ...more >>

real estate database
Posted by hadi at 10/19/2006 11:14:06 AM
HI, Could any body help on designing a real estate database. I want to know that do I have to have two different entities for sellers and buyers or could they be just one entity called client. thanks ...more >>

Weird 128 Characters
Posted by Jeff Allan at 10/19/2006 11:10:38 AM
OK, I have been using SQL Server 2000 a long time and now I have a weird limitation. Scenario: SQL Stored Procedure to update a table Data being passed in: SELECT @DATA1 = '123456789012345678901234567890 123456789012345678901234567890 123456789012345678901234567890 123456789012345678901...more >>

Generating sql queries in query analyzer throws error
Posted by venkat at 10/19/2006 11:09:49 AM
Hi, I am trying to migrate some data from dev db to prod db. my idea is to generate the sql queries in query analyzer. Basically i need to create multiple insert queries like "Insert into productinfo (programname) values ('test1')" "Insert into productinfo (programname) values ('test2')" ...more >>

CityZipLookup Table
Posted by josh.tucholski NO[at]SPAM gmail.com at 10/19/2006 11:09:23 AM
Hello, We have a database for retrieving location data and I have been attempting to optimize it recently as searching for US Counties based on a given City, Zip, State, or Area Code takes over 12 seconds to return a valid response. Sadly there are only 78k rows in the database, therefore I ...more >>

Cross Post -- "Scripting" Imports in SQL 2005
Posted by Curious Joe at 10/19/2006 10:41:09 AM
I have 129 DBF (Fox Free Tables) that I need to import into a single SQL Table. Is there a way to "script" something to run the import on File_1, then File_2, then File_3 and so-on? I really don't want to have to run through and import these all by hand as our client will be sending these ever...more >>

Backing up master
Posted by CLM at 10/19/2006 9:44:02 AM
I've got a 2000 server that we just started doing log backups on. Well, the network admins actually handle backups using TSM and put in log backups that backup all databases including system databases in spite of my recommendation not to do that. So they are trying to log back up master, msd...more >>

Bulk Insert Not Copying some data
Posted by Danny at 10/19/2006 9:34:02 AM
I am using the Bulk Insert command to import a text file. On some rows, the last column is not imported. The text file has 4 columns that are tab delimited, the first 3 are numbers and the last is a long text string. On rows where the last column exceeds around 850 characters, it does not i...more >>

Text DataType and XML Explicit in SqlServer 2005
Posted by Rajesh Patel at 10/19/2006 9:22:18 AM
Hi, I have a table with an id column and text data type column. My following query runs fine on Sqlserver 2000, but in SqlServer 2005, It gives me an error "Invalid character value for cast specification". Does anybody have idea? table contains 2 columns id int identity(1, 1) textcol...more >>

Update failing when run against linked server
Posted by Curtis at 10/19/2006 9:06:24 AM
Can anyone tell me why I receive the following error when running an update against a linked server? It fails when I try updating a table on a linked server from a table on my local server. "column prefix 'T1' does not match with a table name or alias name used in the query" -- This one wor...more >>

Table Structures and rules
Posted by Henry Jones at 10/19/2006 8:41:29 AM
I'm not sure how to generate the Create statements but here is the layout of the tables that I am working with: InstTiers Table InstID int TierID int ProductID int SubProductID int Products Table ProductID int ProductName varchar(50) InstSubProducts Table InstSubProductI...more >>

stored proc issue
Posted by param NO[at]SPAM community.nospam at 10/19/2006 8:28:53 AM
Hi all, We have a stored proc as shown below. Every morning this stored proc fails with error:- Incorrect syntax near 's'. So what I do is drop the stored proc and re-create it and everything starts working again. It repeats itself next morning. create procedure [appone].[sys_adduser...more >>

Need help with complex query
Posted by Henry Jones at 10/19/2006 8:03:28 AM
I have a query that works and I need to get information out of two more tables and I don't know how. The query so far is select P.ProductName, S.InstProductName as SubProduct, T.TierName from InstTiers I Join Products P ON I.ProductID = P.ProductID left JOIN InstSubProducts S ON I.SubProduc...more >>

how to extract a string from within a string
Posted by Jake Smythe at 10/19/2006 7:42:35 AM
Hello, I have a varchar(500) column that will have some dynamic data but will always have the values "/name=john" I would like to get the value of the actual name. How can I accomplish this? Thanks in advance. Sample row data 'this is a test/name=john' 'name=joe' 'this is another ex...more >>

SQL Closest Future Date
Posted by Syd Bolton at 10/19/2006 7:18:40 AM
I've seen some posts about SQL Statements to select the "closest" date from some other date. What I am looking for is slightly different. I have a table with a DateTime field called "OpenDate", which has dates (just the date, no time) in it. I would like to know how to select the closest ...more >>

Query Help
Posted by Jeff at 10/19/2006 5:59:02 AM
Need a query for: Table1: Computername IPAddress NetworkAdapter InvDate Table2: Computername IPAddress CPU InvDate There is no unique ID on either table, I need a query that returns computername, IP Adress, Network Adapter, CPU and InvDate. We want the computername and IP add...more >>

Get Serial No....
Posted by RON at 10/19/2006 5:22:01 AM
Assume that a SQL Server 2005 DB table has 3 columns - FName (varchar(50)), LName (varchar(50)) & Country (varchar(50)). Also assume that there are 30 records in this table. Of these 30 records, under the 'Country' column, 13 records are from France, 7 from Germany & the remaining 10 from Ital...more >>

Troubleshooting delete trigger
Posted by Kungen at 10/19/2006 5:19:47 AM
Hello. A question from a newbie. Handle me with care... My DB is a discography, and it has 3 tables: Artists artID (primary key) artistName Recordings recID (primary key) recordName artID (foreign key) Tracks traID (primary key) trackName recID (foreign ke...more >>

Client thread killed SQL Server process still working?
Posted by Alexander Korol at 10/19/2006 5:17:02 AM
Hello! Does anyone know whether SQL Server 2005 keeps executing long running commands even when client thread that executed the command was killed? And if it is still executing then is there any way to break the execution simultaneously with killing the client thread? Thanks....more >>

"Which Recovery Model" using SQL
Posted by CraigHB at 10/19/2006 4:47:01 AM
What SQL do I use to find out which Recovery Model is being used (Full, Simple etc). I know how to do this in mgt studio, but I need to qry it in SQL. I am using SQL Server 2005. Thanks, Craig...more >>

Get Serial No.....
Posted by RON at 10/19/2006 4:46:49 AM
Assume that a SQL Server 2005 DB table has 3 columns - FName (varchar(50)), LName (varchar(50)) & Country (varchar(50)). Also assume that there are 30 records in this table. Of these 30 records, under the 'Country' column, 13 records are from France, 7 from Germany & the remaining 10 from Fran...more >>

trigger doesn`t fire on update multiple rows ???? SQL 2005
Posted by M. Posseth at 10/19/2006 1:45:02 AM
SQL server 2005 , Transact SQL and VB CLR ( both react the same ) i have an update trigger wich works fine as long as i update row by row however if i write a query that updates a range of rows ( UPDATE .......... WHERE countcolumn < 5000 ) the trigger isn`t fired i wrote this trig...more >>

Help needed
Posted by Peter Newman at 10/19/2006 1:29:02 AM
SQL2005. Im trying to write a stored procedure. One of the parameters ia a nvarchar(1024) whic contains data that is ; delimeted. what i want to do is enter a seperate record for each peice of data. ok that s not to clear, maybe this example will help Paramater @ITRCDiscriptor = 'NOTICE;...more >>

How to create a temporary stored procedure via SQL query?
Posted by Pradeep at 10/19/2006 1:15:02 AM
Hi, Using a SQL query, is there a way to create a stored procedure temporarily, execute it, delete the stored procedure, and return the data back? Ideally, all these must happen within a single query call to SQLServer. Also, if there is a way to create the stored procedure temporarily, how ...more >>

Join not working SQL 2000 unusual datatype
Posted by mitchchristensen NO[at]SPAM gmail.com at 10/19/2006 12:10:38 AM
I have a table that has a column of varchar(18) with a value of 803308 which I'm trying to join to another table with a column of char(6) with a value of 803308. For some reason the join will not work for certain values, but works for others. Even if I view all the contents of the column and s...more >>

Connection Timeout
Posted by perspolis at 10/19/2006 12:00:00 AM
Hi all I set the connection timeout property in my connection string but it dosen't effect in my connection and my connection time out in 30 sec..I set it to above 30 but it dosen't effect.. ??? ...more >>

matching rows
Posted by Yan at 10/19/2006 12:00:00 AM
Hi, Table T1 contains 3301 rows. I got to split the table into 2 based on the only common column available which is Email. When I use inner join to return matching rows I get 1151 records returned and when I use IN I get 1026 records returned ??? --3301 SELECT COUNT(*) FROM T1 --1151 ...more >>


DevelopmentNow Blog