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 2006 > threads for thursday september 21

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

retrieving information against the encrypted password
Posted by Muhammad Ahsin Saleem at 9/21/2006 11:41:02 PM
hi everyone i have a problem that i have encrypted the user password but don't know how to retrieve information against that user i have written a store procedure but it does not work kindly if any body can help me, then do help me its urgant store procedure is ALTER PROCEDURE dbo.SelectUser...more >>


Is is normal behaviour to see a table scan for this query?
Posted by mchi55 NO[at]SPAM hotmail.com at 9/21/2006 11:34:33 PM
I have a table with 220000 rows. There is a column called status_id. I have a nonclustered index on statusid. if I do a select from table where status_id = 161 I get a table scan with the non clusteredindex. There are about 16000 records with a status_id of 161. This there no way ...more >>

Is is normal behaviour to see a table scan?
Posted by mchi55 NO[at]SPAM hotmail.com at 9/21/2006 11:34:21 PM
I have a table with 220000 rows. There is a column called status_id. I have a nonclustered index on statusid. if I do a select from table where status_id = 161 I get a table scan with the non clusteredindex. There are about 16000 records with a status_id of 161. This there no way ...more >>

Nested Transactions in c#
Posted by Mana at 9/21/2006 11:13:48 PM
Hi, I want to implement nested transactions in C#. When I write BEGIN TRANSACTION inside another BEGIN TRANSACTION in an SQL Script it works fine. But when I call BeginTransaction() inside another BeginTransaction() in a c# code on same connection object it throws exception as "SQLConnection ...more >>

Rows To column
Posted by xgopi at 9/21/2006 10:43:02 PM
Hi , I have view which returns the following four columns in which only the fourth coulnm differs. A B C AA A B C AB A B C AC I want to modify the view definition to return by grouping the first 3 coulmns and concatinating the last column as follows. A B C AA,AB,AC I need help in...more >>

Need help working with dates in SQL stored proc
Posted by sql_zack at 9/21/2006 9:38:33 PM
I am trying to create a stored procedure that will group and return employee data based on the ending date of a job. Employees basically have a current job and can have one or more previous jobs during the current year and I need to get all of the records for each employee on one row. Here is...more >>

Questions about generated stored procedures by VS 2005 (TableAdapter).
Posted by Steven Spits at 9/21/2006 8:51:58 PM
Hi, When I let a TableAdapter generate stored procedure for "SELECT * FROM Supplier WHERE SupplierID = @SupplierID", it generates (some parts removed): Select: SET NOCOUNT ON; SELECT * FROM Supplier WHERE SupplierID = @SupplierID Update: SET NOCOUNT OFF; UPDATE [Supplier] SET <...> WH...more >>

Table variable and dynamic sql statement?
Posted by xezo at 9/21/2006 8:14:47 PM
Hi, is it possible to insert data into table variable from dynamic sql statement in t-sql (sql server 2000), something like this: declare @tmpTable Table (id int, firstName varchar(50)) declare @tmpStr varchar(2000) set @tmpStr='Select id, name dbo.Table1' Insert Into @tmpTable ...more >>



Left outer join/hash issue
Posted by Jim G at 9/21/2006 6:57:02 PM
Why would SQL Server query analyser insist on using a HASH MATCH/RIGHT OUTER JOIN when I am selecting all rows from one table and performing a left outer join to the second? Doesn’t this mean that all rows in the second table are read?. The second contains vastly more rows that the first ...more >>

Can't Create PRIMARY Index using SMO
Posted by Larry Rebich at 9/21/2006 5:07:03 PM
I am using SMO to copy SQL tables, etc. from one database to another. As part of that process I'm copying a table's indexes. I have successfully copied all indexes except for the PRIMARY index. Is there something unique about the creation of a PRIMARY index as compared to an ordinary index? ...more >>

select the smallest column
Posted by SQL Ken at 9/21/2006 4:07:27 PM
Hi I have a table wiht multiple columns and would like to select the smallest value in that column and populate it in new column or table for example T1 ID Col1 Col2 col3 Col4 1 1 4 2 1 2 4 ...more >>

Fetching results of a stored procedure
Posted by Carlos Lozano at 9/21/2006 3:17:03 PM
Hi, Is there a way to save the results of a stored procedure to a cursor with no modifying the stored procedure explicitly. The database I am working on has many stored procedures. Some call others recursively as some queries are created dynamically. I am needing to fetch the results o...more >>

Help with a date issue
Posted by Chris at 9/21/2006 3:09:01 PM
Hi, How can I get the date of the previous Saturday and Sunday? So if I run the query it gets the most recent previous Sunday then go back one week and get the previous Saturday...hope I am making sense. Thanks...more >>

Need SubQuery Syntax
Posted by Ahmer Anis at 9/21/2006 2:56:02 PM
Hi Experts: Q for SQL2000 I've 3 tables from 2 different databases 1.DB1.COST_RM_PRICES - FIELDS: RM_CODE, OLD_DATE, OLD_PRICE 2.DB1.COST_RM_MASTER - FIELDS: RM_CODE, STOCK_NO 3.DB2.PO_PRICES_BY_DATE - FIELDS: STOCK_NO, NEW_DATE, NEW_PRICE Now I need last update OLD_DATE, OLD_PRICE, NEW_DA...more >>

PL/SQL to T-SQL
Posted by Rob at 9/21/2006 2:01:02 PM
Hello: I've been pulling my hair out in trying to convert the following two Oracle stmts. to its T-SQL equivalent: :::::::::: 1. SET @sSelect = 'Select sum(decode(tc_trx_code_type,''X'',decode(instr(tc_description,''GST''),0,decode(instr(tc_description,''G.S.T.''),0,round(ft_guest_accoun...more >>

The speed impact of a 10-way JOIN?
Posted by bryons NO[at]SPAM gmail.com at 9/21/2006 1:16:37 PM
Today we have four databases (Sharepoint Content DBs, if you know what they are) whose schemas are identical. We have a view that we use regularly that JOINs the databases so we can query values even if we don't know which DB it's in. We would like to create 6 more DBs with the exact same sch...more >>

get fields related to the last record added for each item
Posted by Brian Bischof at 9/21/2006 12:59:45 PM
I'm trying to figure out how to use the MAX(date) function to get the last record saved for each item in the table. However, if I use the Max() function, it just returns the largest date for each item. It doesn't return the other fields in that same record. Of course, I have to use other gro...more >>

Agent Autostart in SMO
Posted by nite_eagle NO[at]SPAM hotmail.com at 9/21/2006 12:41:01 PM
Greetings, Where is the DMO property SQLServer.JobServer.AutoStart in SMO? I'm searching the SMO object model, but not having much luck finding. Thanks, Norman ...more >>

BIDS - Cube calculation designer: Unexpected error occurred: 'Error in the application'
Posted by dbuchanan at 9/21/2006 11:48:49 AM
Hello, Within 'Business Intelligence Develpment Studio' (BIDS) with a cube opened and the calculations tab selected, the design surface displays a message that reading: Unexpected error occurred: 'Error in the application.' This occurs in any project I open and it still occurs when I rest...more >>

SQL2005: Can a computed column which is derived from an XML column be indexed?
Posted by burp48 NO[at]SPAM gmail.com at 9/21/2006 10:27:34 AM
Hi The following MSDN article states that a computed column derived from an XML column can be indexed. "The computed column can be indexed in the usual way." http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sql25xmlbp.asp The following sample code is taken fro...more >>

Allitcertkiller=AD.com_study_guides_now_more_cheaper_than_Realexamquestio=ADns.com
Posted by loyola at 9/21/2006 9:58:04 AM
Allitcertkiller=AD.com study guides now more cheaper than Realexamquestio=ADns.com ...more >>

Query a foriegn key value in a database
Posted by kw_uh97 at 9/21/2006 9:34:02 AM
Hello everyone I wanted to know if I have a table that holds a foreign key value. How would I find out where this value reoccurres in the database. In other words I am looking for the table that holds the primary key to this relationship. Hope I made myself clear. Thanks In Advance for ...more >>

How to make an Ordinal RS return descrete a range SQL 2K?
Posted by JeffP NO[at]SPAM Work at 9/21/2006 9:24:42 AM
SQL 200, I have a need to have an ordered ordinal recordset and return a range of records. This is a phone app that needs small datasets returned. I'm looking for any odd sProcs or methods... ? Details.... Say I have 97 records, I need a sort and to be able to get records 1 - 8 then ...more >>

Connection pooling: Saving username against a @@spid
Posted by JimLad at 9/21/2006 8:22:42 AM
Hi, In an existing ASP/ASP.NET 1.1 app running on IIS 6, I need to RELIABLY pass the logged in username through to the SQL Server 2000 database for auditing purposes. The current method is hideously unreliable. The app includes updategrams, XML Templates and ADO connections. I don't want to...more >>

Help with query using group by
Posted by tcharsley NO[at]SPAM personainternet.com at 9/21/2006 8:08:54 AM
I'm having trouble with this. I sure there are many here that would immediately have an answer. Here is the problem: I have a table where I am interested in 3 fields. The fields are a primary key, a timestamp, and a status data field. What I am interested in is only the last status entry...more >>

Query help for a beginner
Posted by Baba at 9/21/2006 7:46:02 AM
I have a table like this one: PolicyID CustomerGroupId And some other columns.... 1 1 2 1 3 2 4 3 5 3 6 3 How can I select a list with CustomerGroupId and ...more >>

Cannot drop table check constraint
Posted by SQLGuru_not at 9/21/2006 6:36:02 AM
I have created a table check constraint which I cannot drop using t-sql. If I execute the following I get "'CKFulfillmentPackage' is not a constraint": ALTER TABLE dbo.FulfillmentPackage DROP CONSTRAINT CKFulfillmentPackage GO What is the proper way to drop a table check constraint? ...more >>

Security Problem
Posted by FARRUKH at 9/21/2006 6:36:01 AM
we have a offices in NY, LA, Mexico and i work in a head office n TO . The ppl in NY connecting through Terminal Service Server(i.e. Host Name M4). Yesteraday I noticed some of the user in M4 have a full database access which is not secure. I checked SQL Server logins but didnt track anything....more >>

AFTER UPDATE trigger: rollback the update on error within trigger?
Posted by SMC at 9/21/2006 6:01:48 AM
I have a simple trigger which runs an INSERT into an audit table whenever my primary table is updated. The problem is: if an error occurs during this audit insert statement, the audit data is not captured but the initial update still takes effect. Is there any way to catch at error during a t...more >>

How to get the password change date in SQL Server
Posted by SMAC at 9/21/2006 5:26:42 AM
I have searched this topic on google first, and I understood that "xdate2 column of sysxlogins" may store this info, but might not exclusively store this info... this value changes as extra permissions is granted. Is there a way to get the password change date? Either within a column of a ...more >>

this is prob. moronic, but....
Posted by Brian L at 9/21/2006 5:07:01 AM
Hey everyone. I'm trying to pass a parameter to SQL Reporting services ( i know, wrong forum but programmatically speaking, I think it belongs here) . For @StartDate I use =Today() which works fine. For @EndDate, I cannot figure the syntax so that the datetime defaults to tomorrow 00:00:00. Al...more >>

Processing Multiple Results Sets From A Stored Procedure
Posted by CSAWannabe at 9/21/2006 4:19:14 AM
I'm using OLEDB to call a stored procedure on MS SQL Server 2000. The stored procedure looks something like this: CREATE PROCEDURE [dbo].[usp_select_Request_1] AS SELECT TOP 100 ID, RunCount, DATEDIFF( SS, 'Jan 1, 1970', NextRunTime) as "NextRunTime", Type, SequenceNumber,DATEDIFF( SS, '...more >>

Concat
Posted by Kjell Brandes at 9/21/2006 3:56:01 AM
is there any way to select all columns on a row as a separated string, anyone with a function that will do this or is there such functionality built in on sql server 2000. I want to select data from 2 different tables and compare the results of each row in the 2 tables. Any ideas on how ...more >>

Using one stored procedure to update table created in another?
Posted by Moss at 9/21/2006 3:55:00 AM
Hi All, I have a stored procedures which creates a new table and then runs a specific query. The results of said query are then inserted into the newly created table. Now, I have another stored procedure which should, in theory, update that new table with extra data. I thought I could j...more >>

Doing an update and comparing date
Posted by Taniwha at 9/21/2006 3:28:10 AM
Can anyone give me the heads up as to why this SP does not work? ALTER PROCEDURE [dbo].[Jahasma_UpdateCustomerInjury] @injuryDescription nvarchar(35), @injuryID int, @lastUpdateUTC datetime OUTPUT AS BEGIN --The [dbo].[Jahasma.Customer.Injury] table doesn't have a timestamp column. O...more >>

msdn transact ref: boolean expressions versus predicates
Posted by MariusI at 9/21/2006 2:56:02 AM
Can anybody please explain to my why the msdn transact reference differs between predicates and boolean expressions? Boolean expressions evaluate to TRUE, FALSE or UNKOWN, and to my knowledge, so does predicates!...more >>

select_=FCber_Stichworte_in_verbundenen_Tabelle
Posted by Sam Jost at 9/21/2006 2:47:53 AM
Ich hab schon ein wenig danach gegoogelt, finde aber immer nur Joins (und w=FCsste nicht wie ich die auf mein Problem anwende): Ich habe eine Tabelle mit Kunden, und eine Tabelle mit Stichw=F6rten (Tags) zu den Kunden. Die Tabelle mit den Kunden hat eine rowguid, die Tabelle mit den Tags ha...more >>

Is this the way to mislead the query optimizer?
Posted by Oskar at 9/21/2006 2:39:01 AM
Hi In a stored procedure in one of the queries (select) I have a predicate like this: DECLARE stored_proc .... @p varchar(6) = NULL .... AS .... SELECT .... WHERE .... AND ISNULL(@p, table.column_p) = table.column_p -- the predicate .... If @p is null, which, by convention, means...more >>

Dyamic view/function based on table data (?)
Posted by Matik at 9/21/2006 2:15:43 AM
Hey, I'm out of ideas, so, I thought, will search help here again :( I'm trying to prepare a view for ext. app. This is in normal cases very easy, but what if the view structure should be dynamic?! Here is my point (I will siplify the examples). I have a table: create table t_data ( ...more >>

Urgent Assistance
Posted by Chris at 9/21/2006 12:25:02 AM
Hi, The following query is stuck for a while then gives a timeout DECLARE @ERR INT SET XACT_ABORT ON BEGIN DISTRIBUTED TRANSACTION t1 INSERT INTO DBO.SHIPMENT( Act_ID, Customer_ID, ...) SELECT Act_ID, Customer_ID, .... from REMOTEMACHINE.DATABASE.DBO.SHIPMENT WHERE ...more >>

Could this be called a bug ?
Posted by Gurbao at 9/21/2006 12:00:00 AM
Hi, using sql2000 sp4 (8.00.2040) This has to do with parameters in the dateadd function. The following query SELECT dateadd(w, -5, getdate()) returns today - 5 DAYS! I had expected WEEKS. I am aware that w is not listed as a legal abbreviation for week, but as well; it is not lis...more >>

Looking for Opinions on Repeated Dataload Requirement
Posted by BenignVanilla at 9/21/2006 12:00:00 AM
I am working on a project that has an integrated controller that dumps data out from some machinery every minute from the hours of 8am-8pm. The data is written to a CSV file, and then uploaded automatically to an FTP server every 20 minutes. I am working on data-mining, and publishing the d...more >>

date convert question
Posted by Niklas Olsson at 9/21/2006 12:00:00 AM
Hello In my select against an oracle database I do TO_CHAR(c.DateCreated, 'YYYY-MM-DD HH24-MI-SS') As DateCreated, Is it possible to do the same in sql server 2005? when looking at convert I can't see how to do 'YYYY-MM-DD HH24-MI-SS' at http://msdn2.microsoft.com/en-us/library/ms187928.aspx ...more >>

integer division
Posted by simonZ at 9/21/2006 12:00:00 AM
I have integer division and I would like to get float number, for example: SELECT 8/3 If I would like to get float result, I have to cast at least one number as float like: select cast(8 as float)/3 I have sql2005. Is there any new divide function in sql2005 that would return float o...more >>

Determin if values in one parameter are contained in the values of another parameter
Posted by Robert Bravery at 9/21/2006 12:00:00 AM
HI all, I have a SP that has a couple of parameters. Specifically I would like to determine if values from one parameter are contained in another eg @FYDVN = '22,23,24,25,26,27,28,29,30,31,32,33' @YTDDVN = '22,23,24' @REMonth = '24' So in the above @REMonthe of '24' is in @YTDDVN and in @...more >>


DevelopmentNow Blog