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 > august 2007 > threads for tuesday august 7

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

Help with Count() in query when between two tables
Posted by jakeatkins via SQLMonster.com at 8/7/2007 10:44:24 PM
Hello, I have a query where I'm trying to count the amount of posts each user has made for a blog. The first table (user) has the username and user_ID, the second table (posts) has the user_ID, post_status (publish, draft, etc.). I want to create a query so I can show each username, userID, a...more >>

group by with data from other table
Posted by .nLL at 8/7/2007 10:37:44 PM
table 1 ============================= id | ip | file ------------------------ 1 | 127.0.0.1 | testfile.jpg table 2 ====================================== ip | country ------------------------------- 127.0.0.1 | us 1.2.3.4 | de query =============================== Select C...more >>

Join Problem
Posted by hon123456 at 8/7/2007 10:12:45 PM
Dear all, I am new to SQL statements, Now I want to join 3 tables: Table A ,Table B, Table C, I want to join A and B First and then use the result of joining of A and B to join C. Can I write the following SQL statement. Select * from (A join B on A.fieldA = B.fieldA) join ...more >>

Sync between SQL Server 2005 and 2000
Posted by Spam Catcher at 8/7/2007 9:17:09 PM
Hello Everyone, We have a project which requires (one-way) synchronization between two databases across the Internet. We need to maintain a relatively up-to- date database < 5 mins difference? We will be synchronizing a couple tables from the customer's database over to our company's data...more >>

How to call stored proc continuously
Posted by chris fellows at 8/7/2007 9:01:48 PM
Without writing an application, is there a way to continuously call a SQL 7 stored procedure every 0.5 seconds or so? Is it OK to configure a SQL job that starts once and simply runs some SQL that sits in an infinite loop as my example below or will this cause problems for SQL Server? E.g. C...more >>

Help creating a query to find date that a running total reaches x amount.
Posted by at 8/7/2007 7:43:32 PM
I am trying to build a query that will tell me the date a customer crosses a predetermined threshold. I have an invoice table that carries the invoice date and the amount invoiced among other things. We would like to reward customers that do x amount of business with us. How can I query a the in...more >>

Multi-column Index vs Single Column Indexes
Posted by Sonny at 8/7/2007 6:10:27 PM
Hi, Would like to know the performance differenece between Multi-column Index vs Single Column Indexes. Let's say I have a table with col1, col2, col3 along with a primary key column and non-indexed columns. In queries, I will use col1, col2, and col3 together and some times just one or two ...more >>

Transactions & Locks Problem: how to move the items from a big container to tiny baskets
Posted by Deniz at 8/7/2007 5:05:31 PM
Hi, I am trying to solve this problem in SQL 2000 and any help is appreciated. Imagine there are big containers each with various items in similar quantities. tbl_containers -------------------- container_id int item_type char(1) qty int We can, for example, have 10 of A, 20 of B, 40...more >>



Query Help
Posted by BUC at 8/7/2007 4:42:38 PM
I have two tables TEST1and TEST2 that have 2 cols (clmA,clmB in TEST1 and clmC,clmD in TEST2) I have this data in TEST1 (TEST1) is on a remote linked server called server1 A , 1 B , 2 C , 3 I want to copy this data to TEST2 only if TEST2 does not already contain on of these entries. S...more >>

case sensitive LIKE
Posted by toni at 8/7/2007 4:20:02 PM
Hi, I'ld like to have returned only records where a field contains uppercase characters, example select * from customers where company like '%FIAT%'. Is this possibile with standard transact SQL for SQL2000 and SQL2005? best regards Toni Santa ...more >>

Backup in maintenance plan appends and fills tape
Posted by Jordan at 8/7/2007 3:47:13 PM
I am backing up to a tape drive to backup 3 databases. All appears works well except that each backup appends to the tape rather than overwites it. I setup the backup plan with the wizard a couple of times, but I do not see any option that says overwite tape. I thought I would just adjust ...more >>

SQL Server 2000 Performance Issue
Posted by hiddenhippo at 8/7/2007 2:26:54 PM
Hi, I've got a problem in that a stored procedure of mine always times out within my application. Realistically there's no need to increase the timeout because the individual sections of the SQL execute fast, yet when I bring them together the execution time increases dramatically. Firstly...more >>

write easy script?
Posted by TKM at 8/7/2007 1:50:00 PM
I am in one heck of a bind. I need to know how I would write a script in SQL Mangt Studio for the following: I have two fields I need added into my linked table. BestEfforts is a check box UserField is a standard text box that should be varchr255 How would I write this or where do I begi...more >>

Help With Stored Procedure
Posted by Manekurt at 8/7/2007 1:47:56 PM
Hello, I need to create a stored procedure in SQL Server Express 2005, and I´m gettign errors. Can anyone tell me waths going wrong in this code? Tahnk you! USE [mydatabase] GO SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[mysp_sp_syncroaddserver] ( @a_da...more >>

Enterprise Manager update ignores instead of triggers
Posted by Neil W. at 8/7/2007 1:32:02 PM
Lets say I open a View in Enterprise Manager (or Management Studio), display the rows and then Update some data. It appears that EM or MS updates the base tables directly, updates rows in the base table, thus ignoring any "instead of" triggers on the view. Is that correct? Is there any offi...more >>

Export database
Posted by FARRUKH at 8/7/2007 1:24:01 PM
can we export/attach data/database from SQL Server 2005 Enterprise editon into SQL Server 2005 cluster environment? thank you...more >>

A Strange Query
Posted by Luke Davis at 8/7/2007 12:54:32 PM
Hi guys, I'm trying to work this query out in my head see if you can help me with it. I'll give you a little background information so you have the big picture. This is a real estate database, every home has an APN number it's a unique number that always means the same property. When a co...more >>

time message entered service broker queue
Posted by wdudek at 8/7/2007 12:54:03 PM
We are using service broker to keep 2 databases in sync via an activated stored procedure. This works fine, but it seems like allot of data is building up in the queue waiting to be processed by the stored proc. Is there a way to tell how long a message has been in a queue?...more >>

Checklist for security
Posted by rodchar at 8/7/2007 12:46:05 PM
hey all, what do i have to do to secure my database so that only one person with login rights can access the database? For instance, System Administrators, Domain Administrators, etc. should not be able to view my database either? I basically want all modifications possible only thru a .net...more >>

Header & detail record question
Posted by Blasting Cap at 8/7/2007 12:36:02 PM
I'm running a query to create a temp table: insert into order_tempfile select orders.orderid, orderdetail.productid, orderdetail.productname, orderdetail.quantity, orderdetail.unitcost, orders.totaltax from orders inner join orderdetail on orderdetail.orderid = orders.orderid where ord...more >>

Increasing index performance - ip2location
Posted by Stephane at 8/7/2007 11:36:02 AM
Hi, I'm using the ip 2 location service (http://www.ip2location.com/) to find where a web site visitor is from. The table has more than 2 000 000 rows. The table is created like this: CREATE TABLE [dbo].tbl_IPS ( [ipFROM] [float] NOT NULL , [ipTO] [float] NOT NULL , [countr...more >>

REATE DATABASE permission denied in master
Posted by Mike9900 at 8/7/2007 11:36:01 AM
I have installed windows vista, but when I want to create a database from our software I get this error: "REATE DATABASE permission denied in database 'master' ". I worked in a new windows vista we installed on our desktop, but did not work on a new laptop we purchased with Win Vista on it. ...more >>

Using a variable in a WHERE IN clause does not work
Posted by kw_uh97 at 8/7/2007 11:30:04 AM
Hello everyone I am trying to use a varchar(string) in my where in clause and it will not work why is it not working and how can I get to work. Here is some sample data, DDL, code I am trying to run and desired results. CREATE TABLE #UsersTable ( [UserName] [varchar] (50) COLLATE Latin...more >>

Notification Test Code
Posted by CLM at 8/7/2007 11:00:11 AM
I posted this yesterday but never got a response, so I thought I'd try it again: If I want to do a one line test to see if an alert exists, it's as easy as if exists(select name, enabled from msdb.dbo.sysalerts where name like 'Access to database denied%' and enabled = 1) blah blah blah ...more >>

Looking for a Speedy Insert Process
Posted by Agho at 8/7/2007 10:26:07 AM
I process a text file daily with about 500,000 rows. The data are inserted into two different tables: Customer and Items. What I do now is read the customer header in the text file and inserts the record into the Customer table which generates and ID (identity column) or an Item table if the r...more >>

Incorrect results from query with left join
Posted by Aurin at 8/7/2007 8:18:07 AM
I have the following SQL statement select config.AssetConfigId,config.RemovedRemInsId, a.TEC, a.SerialNumber, a.Site ,t.title from AssetLCF a left join AssetConfig config on a.AssetKey=config.AssetKey and a.Site=config.AssetSite join AssetInspection ai on a.AssetKey = ai.AssetKey and a.Si...more >>

Tracking Failed Logins
Posted by FredG at 8/7/2007 7:10:02 AM
Hello Gurus, Strange behavior tracking failed logins. Environment: SQL Server 2K STD SP 4 build 2187 Windows 2K3 SP 1 SQL Server Audit Level: Failed Logins only Failed logins are be written to the SQL Server log as expected. However, successful logins are also being logged. Now here is...more >>

help with dump/backup
Posted by mike at 8/7/2007 6:54:00 AM
I'm working with an outside firm to develop an application for our database, and they've requested a database dump to use for design and testing. However, we're only giving them a portion of the database, so I don't want the back up file to contain everything. I've designed a number of view...more >>

In SSIS EnvDTE and other dependencies not found
Posted by Dick C. at 8/7/2007 6:23:27 AM
Hi When I start up Visual Studio for SSIS package development and add a VB.Net Script task to the package the messages below show up and The script can't be compiled. This happens before I add any text to the script. The dependency 'EnvDTE' could not be found The dependency 'Microsoft.SQ...more >>

Dependant nullable unique columns
Posted by msobik at 8/7/2007 6:22:01 AM
I have a table similar to the following: CREATE TABLE [dbo].[Person]( [ID] [bigint] IDENTITY(4,1) NOT NULL, [LastName] [varchar](50) NOT NULL, [FirstName] [varchar](50) NOT NULL, [DOB] [smalldatetime] NULL, [SSN] [char](11) NULL, CONSTRAINT [PK_Person.Contact] PRIMARY KEY CLUSTERED ...more >>

differencial equations
Posted by Henrik Staun Poulsen at 8/7/2007 5:52:20 AM
I've been searching many placing for ideas on how to improve the speed of this problem: We have a system that samples various equipment every minute or so, and stores these measurements in a table in our database. Currently there are about 300 mio rows in this table. There are about 200 colum...more >>

Extend Functionality in SQL Server 2005 Management Studio with Add
Posted by Ameet Phadnis(e Tek Global Inc.) at 8/7/2007 5:10:08 AM
Someone had posted a question few days back about SSMS Add-In. Here is the article that explains how to create an add-in for the object explorer. We used it to create our SQL SP Generator tool - http://www.etekglobalinc.com/Downloads/SQLServerDownloads/tabid/320/Default.aspx ...more >>

SSIS Package execution options for user
Posted by swetha sankaran at 8/7/2007 1:24:23 AM
Hi, We have 30 jobs in SSIS that we now execute manually from Sql server 2005 BIDS. We want the user to be able to execute it using a browser. How do we do it? I searched online resources but none explained it clearly. Do we use .ASP or C#. Is it possible to use both? We do not have C# or VB...more >>

Update script
Posted by Sam at 8/7/2007 12:54:28 AM
I have a table called Accthist. The table has values Acct,subaccount, Ptd00 to Ptd11 (12 coloums for the 12 months in the year. I want to update the value in PTD06 for acct 25010 by adding in it the value that is in acct 25150 where the subacct is the same. That is Update accthist set acct2...more >>

execute with double quotes
Posted by farshad at 8/7/2007 12:50:01 AM
What is wrong with the following query please? dtexec /f d:\sysappl\CEM\SSIS\Imports\Trades\BaseProfiles2.dtsx /set \Package.Variables[User::FileName].Properties[Value];"d:\ApplData\CEM\WorkingTemp\profiles.csv" /set \Package.Variables[User::ConnectionPath].Properties[Value];"Data Source=...more >>

Update - undefined?
Posted by shiju at 8/7/2007 12:06:18 AM
In the last update I am always getting 50. Is the standard has defination for this sort of update where we have multiple possibility or this behaviour is undefined? Use Tempdb Go create table #temp1 ( o int identity(1,1), SID int, tId int ) insert into #temp1 (sid) values(23) cr...more >>

Disk Performance end-of-rope
Posted by fnadal via SQLMonster.com at 8/7/2007 12:00:00 AM
I'm pretty much at my wits end with this server. Running Sql server 2000 sp3. 4 gigs of memory. The server is utilizing 6 disks. D: Logs (.ldf) F: Data (.mdf) G: Filegroupings of our two largest and most used tables H: Tempdb K: Tempdb L: Tempdb M: Tempdb We are experiencing slow di...more >>

Restore database
Posted by Roy Goldhammer at 8/7/2007 12:00:00 AM
Hello there I've worked hours on some of my database. Suddenly someone has just made restore in this database and erase all the data i inserted. Unfortunaly i don't have full recovery module. Is there a way to restore it somehow? ...more >>


DevelopmentNow Blog