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 > september 2007 > threads for thursday september 6

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

How to rewrite this...
Posted by Faye at 9/6/2007 11:18:24 PM
I got the following, DECLARE @temp TABLE( rownum int identity(1, 1), Usr int, Val int ) INSERT INTO @temp( Usr, Val ) SELECT Usr, Val FROM D ORDER BY Usr, Val SELECT A.Usr, AVG(1.0*A.Val) AS medianValue FROM @temp A INNER JOIN ( SELECT Usr, FLOOR(AVG(1.0*rownum)) AS m1, CEILING(AV...more >>


Granting a role to a User
Posted by cbrichards via SQLMonster.com at 9/6/2007 11:05:53 PM
I have a database user (let's call the user TestUser) and I am needing to script the granting of role db_datareader to TestUser. BOL is rather cryptic on how this is to be done, providing the following syntax: GRANT permission [ ,...n ] ON { [ USER :: database_user ] ...more >>

How to handle error in a sproc
Posted by Marc Robitaille at 9/6/2007 11:01:50 PM
Hello, I have this sproc to insert csv files in my tables. First, It truncates the table. Afther that, it inserts the csv file. CREATE PROCEDURE [dbo].[I_TDE_Imports] @FilePath VARCHAR(500), @FileName VARCHAR(40), @TableName VARCHAR(6) AS DECLARE @sql NVARCHAR(2000) DECLARE @Delete ...more >>

High CPU and Restart SQL Server
Posted by cbrichards via SQLMonster.com at 9/6/2007 9:27:49 PM
Running SQL Server 2005, SP1 on Win2K3 with 8GB RAM (6GB to SQL Server and 2 GB to the OS). Just recently a server started exhibiting high cpu. I ran profiler and identified serveral stored procedures that can use some tuning. I also analyzed blocking, and there was very little blocking goin...more >>

Some help with a trigger
Posted by Ayman at 9/6/2007 7:38:59 PM
Ok here is the deal. I have a "Live" table that stores 11 rows of data with several columns. About every 10 seconds two values change on this table (a column called value which stores a number and a timestamp). I have a procedure that takes these rows and inserts them into another table. I w...more >>

Combining the values a column of two rows into one
Posted by Robert Bravery at 9/6/2007 6:19:00 PM
HI all, I need to combine a varchar(200) column from two rows into one row. The rows are the result of a query, and are unique in accountId, Year, and month, columns. I thought of a pivot, but because the varchar column would differ so much of the table, that would seem inpractical. I trie...more >>

Using OPTION(KEEPFIXED PLAN)?
Posted by John Kotuby at 9/6/2007 6:01:01 PM
Hi all, I am trying to speed up performance in a heavily used database. The database is accessed via a VB front-end that I wrote, so I have a pretty good idea what's going on with the 50 or so users. There are usually about 1000 maximum updates and/or inserts of invoice records done daily....more >>

SQL2008
Posted by jeff at 9/6/2007 4:50:00 PM
Is the geospatial in the July CTP? If not where can I find info on it?...more >>



SQL Question
Posted by John Wright at 9/6/2007 3:12:35 PM
I need another set of eyes on this. I am missing something and can't figure this one out. I have a table (definition follows) and when I run the query (definition in the post) I get duplicate rows. I have included the data for the table that is giving me problems as well (CSV). Can anyone s...more >>

Is this correct?
Posted by TKM at 9/6/2007 2:44:01 PM
I have something like this in my Access databse.. ([LOANPROGRAM] <> 'CONSTRUCTION') AND ([PROPTYPE] IN (2010, 2020, 2030, 2040, 2050)) And I need to use a Table Update in SQL to update my table. Am I close or way off UPDATE dbo.pplCheckListItems SET LoanCriteria = '([loanProgram] <> 'Co...more >>

snapshot and Sql 2005 standard edition??
Posted by Sammy at 9/6/2007 2:02:02 PM
I have Sql 2005 Standard edition. I have a folder for snapshots available but cannot create them does anyone know if this will be supported in a future service pack for standard edition or is it there as a constant reminder of " look what you could have got if you had got Enterprise Edition."...more >>

I need to count rows in groups -- like a histogram
Posted by Art at 9/6/2007 1:54:00 PM
Hi, I'm pretty weak at SQL. I'm trying to group the count of rows by the value of one of the columns. I tried this: SELECT Count(*), CASE WHEN perspvalue=0 THEN 0 WHEN perspvalue<1000 THEN 1000 WHEN perspvalue=5000 THEN 5000 WHEN perspvalue=10000 THEN 10000 ELSE 9...more >>

xp_cmdshell in SQL 2005
Posted by Rob at 9/6/2007 1:52:00 PM
Hi, I'm not sure if my following question should be posted in this discussion group or another... but here it goes: We had recently migrated our vendor's SQL 2000 DTS packages to SQL 2005. One of these package uses the extended system SP, xp_cmdshell to create a directory. The problem...more >>

SQL Server 2000 to 2005
Posted by at 9/6/2007 1:34:05 PM
I need to take all databases off an existing sql 2000 box and move them to an existing 2005 box. Is there an easy way I can move all databases and logins, etc.? I don't really want to have to recreate all logins, etc. Thanks a lot. ...more >>

Finding and Orgnization's Event with the latest date
Posted by WhiskeyRomeo at 9/6/2007 12:32:00 PM
I have Organization table linked to and Event table on PK named Org_ID int (identity). The Organization table is the parent of the Event table (1 to many). The Organization table has the following relevant columns: Org_ID (PK) int ParentOrg_ID int (can be null) OrgName varchar(50) OrgType ...more >>

Datatype for Minutes:Seconds Data?
Posted by Dan at 9/6/2007 12:28:03 PM
I am creating a table to store data that is exported from an ACD phone system. Many of the columns are data that is in Minutes:Seconds format. I will need to be able to do aggregations on these columns (i.e. Avg Talk time per user). What is the recommended data type for storing and working wit...more >>

Data type conversion question
Posted by Linn Kubler at 9/6/2007 11:50:42 AM
Hi, I'm running SQL Sever 2000 and am having trouble figuring out how to write this query. We have a table, abreviated to this: CREATE TABLE #temp (claim varchar(5), adj_code varchar(15), amount decimal (14,2)) INSERT INTO #temp VALUES ('00001', '1', 1.5) INSERT INTO #temp VA...more >>

Cannot change data created from trigger
Posted by vtsun at 9/6/2007 9:04:06 AM
Hello, I have a trigger which inserts a new record into the database and updates various tables. It is used to add teachers to a school record. It will automatically create the new record, insert the school's address into the teacher record and create an email address on the teacher record ...more >>

Schema problem
Posted by Joe at 9/6/2007 8:57:34 AM
I'm trying to reset an Identity column - but my DBCC statement doesn't = like me having my schema name before the table name: DBCC CHECKIDENT (determination.EvidenceGroupDim, RESEED, 1) Msg 102, Level 15, State 1, Line 1 Incorrect syntax near '.'....more >>

the perfomence among the update, insert into, and select into
Posted by weileogao NO[at]SPAM gmail.com at 9/6/2007 8:29:38 AM
Why the perfomence is so different? I have a huge table. I try to update some records, but using different way spend huge different time. Update used four hours. Insert into used 40 minutes. And select into just used 10 minutes. I can understand update need more time because matching record spen...more >>

JDBC and Record locks
Posted by Daniel Malek at 9/6/2007 8:24:03 AM
Hi I have a java application that connects to SQL Server 2005 as backend . There are certain records that are updated by the application, which I need to lock as they are being updated. I wonder if someone could explain if they should be done inside Java code or SQL Server 2005 level ? ...more >>

DOWNLOAD CRACKED 2008's SOFTWARE: ARCHICAD 11,UNIGRAPHICS NX5,SOLIDWORKS 2008,XSTEEL 13,AUTOCAD 2008
Posted by John Peterson at 9/6/2007 8:17:04 AM
Our team provide different types of services such as: - proffessional cracking of any kind of software (CAD,CAM,CAE,EDA,GIS,PCB,FEA,FEM,CNC,CFD,PDS,3D,Optics etc.) designed for any kind of operating systems(Windows 95/98/ME/2000/XP, Linux, FreeBSD, OS/2, MAC OS etc.) - producing key...more >>

Tracking blocking
Posted by Leon Shargorodsky at 9/6/2007 8:06:06 AM
What is the best way to track blocked/blocking processes in SQL 2005? I don't want to use Profiler because it needs to be running all the time. Thank you in advance for your help, Leon...more >>

Question about using Multistatement Table-Valued Function
Posted by Cindy Parker at 9/6/2007 7:56:54 AM
I am trying to create/use a Multistatement Table-Valued Function but I'm having a hard time wrapping my head around this. I've searched but can't seem to find the answers, so I have a feeling that either it's something really obvious or I'm taking a totally wrong approach. Here's what I'm try...more >>

Programmatically adding a SSIS component to the toolbox
Posted by j.mulders NO[at]SPAM it-solutions.nu at 9/6/2007 7:54:25 AM
I am trying to create an installation package for a BI solution which uses custom SSIS components. I would like to add the custom SSIS components to the "Data Flow Transformations" tab page of the toolbox of the Business Intelligence Development Studio from the installer. I have tried to accompl...more >>

Partitioned tables on SQL Server 2005
Posted by Polda at 9/6/2007 7:43:32 AM
I tried to use partition scheme on my tables in database, but have one problem. I used one column to divide data to two partitions. This column had to be added to primary key columns, which I understand. But i need to have constraints referenced to my origin primary key columns. I tried to creat...more >>

Convert 2005 database to 2000
Posted by falcon1977 at 9/6/2007 6:20:00 AM
Is there a way to convert a 2005 database to 2000? We have a document system that uses 2005, but we still have lots of customers who're using 2000. ...more >>

Nonlogged INSERT statement !!
Posted by RATA at 9/6/2007 5:02:01 AM
Hi, I have a database that is pretty large in size (almost 200GB) I need to do an Insert statement that selects data from another table straight forward INSERT INTO Table1 SELECT * FROM Table2 Table2 is huge in size, the time needed to complete the INSERT statement is 6-7 hours. The rec...more >>

sql-oracle converter
Posted by bilal687 NO[at]SPAM gmail.com at 9/6/2007 1:02:55 AM
hi, i want to migrate data from MSSQL to Oracle, data transfer successfully but i could not open that table in oracle. an error occurs ' table or view does not exists'. If any buddy know how to convert data after migration data then please let me know . thanks in anticipation. ...more >>

Which One IS Best Cursor OR While LOOP
Posted by Ramesh Subramaniyan at 9/6/2007 12:46:03 AM
hi all . adv thanks...more >>

Can't start Job on SQL 2005
Posted by Lasse Edsvik at 9/6/2007 12:00:00 AM
Hey I got a problem. I have a new serverinstallation and I'm trying to create a job. But I get this error (which I've never encountered on other 2k5 installs) "Cannot start the job "Start Incremental Catalog Population on Testjob" (ID 541CE21B-578B-475A-A526-C7AE75FD29E4) because it does no...more >>

IN with var
Posted by luna at 9/6/2007 12:00:00 AM
currently experimenting with IN and vars e.g. IN(@myvar) - this works ok, i can pass a variable and it works great, however how can i pass it more than one value ? e.g. i can pass it say 'apple' and itll produce apples, but how can i pass it say 'apple','pears' cheers mark ...more >>


DevelopmentNow Blog