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 2006 > threads for friday august 18

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

Get unique poolID value for interlinked items
Posted by Veeraraje Urs at 8/18/2006 6:45:51 PM
Hi All I have a table with the data in the following format Col1 Col2 PoolID BOOK1 BOOK2 0 BOOK3 BOOK1 0 BOOK3 BOOK4 0 BOOK5 BOOK6 0 As per the above data our business logic says that Book1 is linked with Boo...more >>


Assistance With Query
Posted by Albert Frausto at 8/18/2006 4:14:01 PM
Hello, I'm a bit rusty with my Transact-SQL and I've come across an issue with a Query. I have the following pair of tables: Scores Grants -------- --------------- scoreID grantID judge_ID grantTitle grant_ID score Sample Data: ...more >>

Odd One
Posted by Chris at 8/18/2006 3:59:01 PM
sql2000 sp4 std ed I have a sp call that an asp webpage calls over oledb/ado - database trace running - duration for completed event takes 15+ seconds. Run exact same sp call in QA - less than 1 second response. When running in QA I issue dbcc dropcleanbuffers to make sure it is not the ...more >>

Design discreet transactions
Posted by Chris Strug at 8/18/2006 2:53:58 PM
Hi, I was wondering if anyone could provide a little guidance to the best approach to this: In my database I generally creat an insert/update procedure for every table (plus a few others). Say that I have an operation that requires an insert into table X, Y and Z - what is the best ap...more >>

Update a table using an aggregate(sum)
Posted by kw_uh97 at 8/18/2006 1:21:02 PM
Hello Everyone How can I update this table to show an aggregate(sum) on a column? CREATE TABLE [SUR2] ( [Domain] [nvarchar] (128) COLLATE Latin1_General_CI_AS NOT NULL, [WorkPack] [varchar] (50) COLLATE Latin1_General_CI_AS NULL , [InvoiceMonth] [datetime] NULL , [InvoiceTotal] [float]...more >>

Trying to restore a .bak in C#
Posted by Jayyde at 8/18/2006 1:00:06 PM
Can I run a SQL command like: RESTORE DATABASE NewDB FROM DISK = 'ApplicationStartupPath\SQLSE2005\DevDB.bak' WITH RECOVERY, MOVE 'DevDB_Data' TO 'C:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\Data\\NewEB_Data.mdf', MOVE 'DevDB_Log' TO 'C:\\Program Files\\Microsoft SQL Server\\MSS...more >>

Upgraded to 2005, but its slow??
Posted by mavrick_101 at 8/18/2006 12:55:02 PM
Hi, For some reasons, our new SQL 2005 is running slower than our old MS Sql server. Is there a tool where I can analyze if there are some differences on indexes on different tables across the two SQL servers? Thnx...more >>

What's wrong with this query
Posted by Henry Jones at 8/18/2006 12:27:14 PM
use northwind select o.orderID, o.employeeID. o.customerID, o.orderdate from dbo.orders AS O join (select employeeID, max(orderid) as Maxoid from dbo.orders group by employeeID) as D ON o.orderid = d.maxoid; ------------------------------------------------- error gene...more >>



Help with a calculation please
Posted by ITDUDE27 at 8/18/2006 11:59:02 AM
Hello, I have this stored procedure that is calcualting invoice payment. For some awkward reason it some of the record the right payment amount and for others it gives some rediculest number. Can anyone see what i'm doing wrong ? sum(ar2.payment_amount - (ih.freight * (ar2.payment_amount ...more >>

UNION and GROUP By
Posted by Ric at 8/18/2006 11:50:02 AM
I want to write a UNION query and group by the entire result set: select submitdate, emplid, sum(submithours) from StandardTime union select submitdate, emplid,sum(submithours) from NonStandardTime group submitdate,emplid This does not work, I need a group by on each individual select sta...more >>

Using sp_dropserver
Posted by moondaddy at 8/18/2006 11:49:24 AM
For a week I have been trying to resolve an issue with VS2005 where it will not debug sql server 2k or 05. One of the many links I was given or found to resolve this is: http://support.microsoft.com/kb/317241/en-us this is the only one I haven't tried yet for fear that I could make matter...more >>

Stored Procedure commit/rollback
Posted by Eric Stott at 8/18/2006 10:58:56 AM
When I run a stored proc in QA, it runs successfully, however when I run the code against BizTalk I get the following error: The adapter failed to transmit message going to send port "SQL://database/". It will be retransmitted after the retry interval specified for this Send Port. Details:"HRE...more >>

Joining Two Tables
Posted by c_shah at 8/18/2006 10:44:55 AM
Table1 Table1ID ControlID (int) 1 100 2 101 3 102 4 103 5 104 Table2 Table2ID ControlID LastChangedDate (datetime) 1 100 08/02/2006 1:30 PM 2 100 08/16/2006 3:3...more >>

How can I calculate a running YTD sum
Posted by Arthur Dent at 8/18/2006 9:05:32 AM
I could use some guidance here. I would like to know how I can calculate a running YTD sum value in the following scenario: -- START CREATE EXAMPLE CREATE TABLE dbo.tblTestData ( generic_id int NOT NULL IDENTITY (1, 1), data_date smalldatetime NOT NULL, metric_value int NOT NULL ...more >>

Determine Table Owner w/Catalog View
Posted by Dan at 8/18/2006 8:58:27 AM
I am using the sys.tables catalog view to get information about tables in my database. I would like to also determine the owner of the table. Is there a catalog view that contains this information? ...more >>

nolock
Posted by Shahriar at 8/18/2006 8:09:02 AM
I am hoping that somebody could point me to a right direction for this question. In a heavily used website, we are getting occasional timeouts accessing tables. Could the casue be due to not having the "nolock" phrase in some of our very complex select statements? Could someone point me t...more >>

Unable to drop index
Posted by StrykerSoccer NO[at]SPAM gmail.com at 8/18/2006 7:40:08 AM
I am trying to drop an index. The error I'm getting is: Cannot drop the index 'dbname.PK_sku_price', because it does not exist in the system catalog. Thanks...Nali ...more >>

Alter Table ....Add Column
Posted by Bob at 8/18/2006 7:14:17 AM
Most everyone knows how to alter a table and add a column...or else we can look it up in BOL. But....how do I add a column WHEN I want the column to be the xth column in the table. So if I have Create table Experiment (id int,fname varchar(15),lname varchar(15)) Then I want to alt...more >>

DateTime format
Posted by amjad at 8/18/2006 7:13:28 AM
is their any function in sql server to format date like ddmmyyyyhhmm i want to create a key from date but date is bydefault like 12/12/2004 12:30:30 but i want to convert it to like we do in vb format("ddmmyyyyhhmm",date)... thanks...more >>

Encrypt function in SQL2K
Posted by DBA72 at 8/18/2006 6:50:02 AM
Has anyone played around with this function? I have different results with it on different servers. Both servers are running SQL2KSP4 but the script below returns: 0x6100 and 0xB0ED on one server (this is what I would expect). But on the other server it returns 0x6100 and 0x6100 - so the encry...more >>

sql2005 output deleted.* into ?
Posted by WebBuilder451 at 8/18/2006 6:46:03 AM
I'm attempting to use the new tsql capibilitied of 2005 and in the book sql 2005 for developers i saw how the output function seems to work and i have the following example that does not work. It gives me this message: Incorrect syntax near 'OUTPUT'. can anyone tell me why? DECLARE @queT TA...more >>

User defined functions and booleans?
Posted by William Sullivan at 8/18/2006 6:10:02 AM
For some strange reason, I can't find any information on this... Can a UDF return a boolean? I know there isn't a boolean type, but there sorta is... The reason I ask is because it would make my UDFs more graceful, as in: UDF GetSecurity: Declare @SecID int Set @SecID = Select SecId from...more >>

BCP .dbf file useing t-sql
Posted by jaylou at 8/18/2006 6:01:02 AM
I am trying o import a .DBF file into my SQL server 2000 database. I have attached the error, my command line code and my fmt file below. Should I be using tab delimited for a DBF? This is driving me crazy, I have been imported XLS and TXT files forever, but never a DBF thru code. TIA, Jo...more >>

Openquery Maximum Length 128
Posted by Fuzzydave at 8/18/2006 5:41:35 AM
Hi, I am writing a query which moves information between SQL Server 2000 and Postgres 8.1.3. Before i modified the script it would very occassionally return the error that my openquery was "is too long. Maximum length is 128" but 99% of the time it would function fine. I had to add in a e...more >>

Probably very trivial SQL Query question....
Posted by Balt at 8/18/2006 4:13:01 AM
Hi all, I'm a bit of an SQL newbie and have the following problem: I have two tables, one contains waypoints in latitude and longitude from a trip. The other contains trips. so: tabTrip: TripID, TripName tabWaypoints: fk_TripID, Lat, Lon, tstamp The relationship is such that one t...more >>

Case don't run in a query
Posted by Luigi at 8/18/2006 3:05:47 AM
Hi all, I have a query that insert in a table some values find in another table. The problem is that one field (marked on a code) is always null (is it impossible, for my data). This is the query. INSERT INTO MOVIMENTI SELECT newid(), --1 cast(convert(varchar, getdate(),112) as int), --...more >>

tough request
Posted by samuelberthelot NO[at]SPAM googlemail.com at 8/18/2006 2:10:08 AM
Hello, My Table: [FlagData] { FlagDataID, FlagID, DataDesc, DataValue} An example: FlagDataID = 1 FlagID = 5 DataDesc = 'FirstName' DataValue = 'Brian' FlagDataID = 2 FlagID = 5 DataDesc = 'LastName' DataValue = 'Smyth' How can I check if there are records with same FlagID and...more >>

Tracking data changes
Posted by Martin H. at 8/18/2006 1:24:02 AM
Hello, I'm trying to understand what is the best way to track data changes in tables (SQL Server 2005). Meaning i need to store data about who and when inserted a row, modified a row (including what columns and corresponding column values) and deleted a row. And i'd like my application d...more >>

Re: Copy SQL ResultSet to Variable or Table This!
Posted by Steve Dassin at 8/18/2006 1:16:45 AM
Hello Tom, http://racster.blogspot.com/2006/08/dataphor-sql-table-this.html I think your too bright not to see thru what sql is selling:) After you work with a 'relational' db you'll see that 'this' or 'that' dialect is not the issue. Perhaps you'll give it a try. best, steve "Tom Coo...more >>

How to combine several long strings and then insert them to a text field
Posted by Joseph Anderson at 8/18/2006 12:00:00 AM
Dear all, I have a question here, could anyone give me a help! I have 4 long varchar strings ,and I want to combile these for strings and then insert them to a text field, ps. the sum all size of these 4 strings is more than 8K How can I get that result ...more >>

Same query ,different results ,why!
Posted by Joseph Anderson at 8/18/2006 12:00:00 AM
Dear all, I have sql scrips like the following lines details --starts here DECLARE @my_cursor CURSOR DECLARE @sqlstr VARCHAR(50) DECLARE @strTable VARCHAR(1000) SET @my_cursor = CURSOR FORWARD_ONLY STATIC FOR SELECT DISTINCT name FROM tbl_temp --LINE 1 OPEN @my_cursor ...more >>

Paging by char parameter
Posted by Arjen at 8/18/2006 12:00:00 AM
Hi, I have a select statement (stored procedure) that selects on the first char. The first char is an input parameter. I.e. on my webpage I show the alphabet a ... z when a webuser select a char the selection will be based on this first char. Now I want to include in the weblist non a ......more >>

ORDER BY VIRTUAL TABLE CASE END bug?
Posted by kurt sune at 8/18/2006 12:00:00 AM
Hi, is this a bug in SQL server 2000? Create a table: create table dbo.Numbers ( Number1 integer not null, Number2 integer not null, ) go Populate it: INSERT INTO dbo.Numbers VALUES (2, 3) INSERT INTO dbo.Numbers VALUES (4, 8) INSERT INTO dbo...more >>

SQL Insert Statement
Posted by John at 8/18/2006 12:00:00 AM
Can i do this : INSERT INTO tblquotation_order (Order_Number, LisaNo, Organisation_Name,Order_Date, Order_Value, Createdby) VALUES (SELECT OrderNumber AS Order_Number, 'LIZ' + RIGHT(ProjectNumber, LEN(ProjectNumber) - 3) AS LisaNo, NameOfSoldToParty AS organisation_Name, PODate ...more >>

Calling an Oracle Stored Procedure from a Sql Server 2000 Stored Procedure using a Linked Server
Posted by Richard Urrutia at 8/18/2006 12:00:00 AM
Hi, I'm trying to call an Oracle stored procedure from Sql server and I have this error message Could not execute procedure 'INTEGRE_INTERNET' on remote server 'ORA_DEV1'. [OLE/DB provider returned message: One or more errors occurred during processing of command.] [OLE/DB provider returned...more >>

How to stop sqlservr.exe........
Posted by Bpk. Adi Wira Kusuma at 8/18/2006 12:00:00 AM
When I connect Internet, I watch on Taskmanager that sqlservr.exe seldom over work and Cannot be stoped. Now, I ask to u, Why does sqlservr.exe seldom over work? Or What is its causing? And How to stop it? Because it can make my connection internet be busy. So amount of bytes (send/receive) w...more >>

issue with sp_OACreate
Posted by Bindu Pushparaj at 8/18/2006 12:00:00 AM
Hi All, When we run the sp_OACreate sp, we are receiving the following error: OLE Automation Error Information Source: ODSOLE Extended Procedure Description: Class not registered This happens only, when we try to run the sp_OACreate sp in a separate memory space using excution cont...more >>


DevelopmentNow Blog