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 > february 2005 > threads for friday february 11

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

calculate status based on other records
Posted by John at 2/11/2005 11:12:17 PM
I am trying to retrieve the order status of a record based on the existence of other records, but I am having difficulty. Below is a sample of what I'm trying to accomplish. Any help is appreciated. To determine if an order event is returnable, I need to find if there are any return o...more >>

Detect (local) SQL Server
Posted by Rob Gibson at 2/11/2005 9:54:34 PM
Can someone please point me to some code (preferably C#, but C++ or C or VB will work) that will detect if the (local) instance of SQL Server is running on a machine or not? Many thanks! -- Rob...more >>

SQL in VB6 Help
Posted by tina miller via SQLMonster.com at 2/11/2005 8:35:32 PM
I have the following: ' assigns recordset fields to boxes on form Set rs = daoDB.OpenRecordset("SELECT * FROM Archived_Patients " & _ "LEFT JOIN tblboxno ON archived_patients.vendorboxno = tblboxno.vendorboxno " & _ "WHERE ...more >>

Sample Database Designs ?
Posted by rgn at 2/11/2005 6:54:44 PM
I would like to learn more about DataBase Design and Data Modelling. Are there any Sample OLTP/OLAP Data Models that I can find on the web for my edification? Thanks, rgn ...more >>

Execute Stored Procedure into a temporary table problem
Posted by Darren Tweedale at 2/11/2005 6:46:09 PM
Hello, I was wondering if anyone can help me with this little problem using INSERT and EXECUTE within a stored procedure. I would be very grateful if anyone can solve the problem. I have a simple table (tblEmployees) to hold all the employees details empID int -- contains the employee i...more >>

joining two queries ?
Posted by Aleks at 2/11/2005 6:38:09 PM
How can I return the results of two different queries ? So that the recordset returned has all the fields from query A, plus the results from query B ? Both return the same columns. A ...more >>

Access another SQL Server inside of a stored procedure
Posted by John Baima at 2/11/2005 5:55:42 PM
Is it possible to access another SQL server when inside a stored procedure? I would like to select some data in one database and then insert that data into another database on a different SQL server. Is that possible? Examples? Thanks! -John ...more >>

How can I do a bitwise or on a column across multiple rows?
Posted by Ken Varn at 2/11/2005 5:25:26 PM
I have a column that I want to do a bitwise OR from a select statement. Is there anyway to do this in SQLServer? Something like this: select Bitwise_OR(ColumnName) from TableName -- ----------------------------------- Ken Varn Senior Software Engineer Diebold Inc. EmailID = varnk ...more >>



Programatically disable trigger
Posted by Rob C at 2/11/2005 4:19:46 PM
Is it possible to disable a trigger for the duration of a stored procedure ? It would become enbled after the sp runs. ...more >>

Problem when field is NULL
Posted by Aleks at 2/11/2005 4:00:50 PM
I am doing a LEFT JOIN, that should display all files in table a even if there is no match with table B as far as I know. The problem is that if the field that joins A with B is NULL then I get no results, I am trying the following: ----------------------------------- SELECT a.Id , a.CaseId...more >>

using stored procedure in select statement
Posted by Rizwan at 2/11/2005 3:23:31 PM
Suppose I have a stored procedure like this : CREATE PROCEDURE testing_sp AS ..... SELECT 'test' can i use this stored procedure in any SELECT statement like this? SELECT *, EXEC testing_sp FROM ... WHERE ... I am using MS SQL Server 2000. Thanks ...more >>

Change Identity value
Posted by Joe at 2/11/2005 2:59:57 PM
I changed a column on an existing table to be a Identity column but when I try to insert a record I get an error that the id already exists. Is there a way for me to change the value so identity returns a higher #? ...more >>

SQL date Format Query
Posted by Nick at 2/11/2005 2:28:50 PM
Hi, I'm entering a date into an SQL server using an Infragistics ASP.Net control. The control picks the date format up from the system setting (UK). When the date is entered into the database it gets switched to US format -swapping the month & day. In the stored procedure thats storing ...more >>

selecting the sum of a select
Posted by tshad at 2/11/2005 1:59:13 PM
I have a select statement select count(*) from ApplicantResume a where a.PositionID = 25 group by firstname,lastName,email that gives me back something like: 5 3 1 12 What I need is to add the rows and give me back 4. Something like select count(select count(*) from ApplicantR...more >>

Test for Results, IF ElSE Query Help
Posted by TheBook at 2/11/2005 1:14:05 PM
I'm a lowly network guy trying to write a query. The logic I need is IF the below query returns any rows, then do the query and return the results. If this query returns no rows/results, then Print: No Data Select Server_Name, database_name, Activity, Succeeded, Error_Number, duration,...more >>

Steve Kass: Help with your bucketize sp
Posted by Steve at 2/11/2005 12:59:18 PM
Steve, In an earlier post I made on this group in you responded with a link to a previous posting of yours. http://groups.google.co.uk/groups?q=kass+%22exec+bucketize%22 First let me thank you as with a very minor modification to the SQL statement within the procedure I got exactly what...more >>

Password Generating Stored Proceedure
Posted by Ben at 2/11/2005 12:51:09 PM
Hi Does anyone know of any sample stored proceedure code for a random password generator where I can set the character lenght to 6. Any help would be much appreciated Thanks Ben ...more >>

concatenation
Posted by JMNUSS at 2/11/2005 12:31:15 PM
I am trying to concatenate a long string together ad it keeps truncating how can I extend the length that is allowed to truncate? TIA...more >>

Select @Field From @Table
Posted by Dib at 2/11/2005 12:16:12 PM
Hi, I am trying to write a SP with a parameter Select @field From @Table. @field and @Table are parameters. can this be done? Please advice Thanks Dib ...more >>

Schedule DTS to import data from Oracle to SQL
Posted by Yuhong at 2/11/2005 12:13:03 PM
Hi, I am trying to schedule a DTS daily to get data from Oracle to SQL Server but the job are failing. It works if I manually run the DTS. I think it is because the SQL Agent domain account doesn't have any access to Oracle database. I don't have control over the Orcale DB. Any idea how I can ...more >>

Stupid questions - OUTPUT Params & stored procedures
Posted by Sandy at 2/11/2005 12:02:09 PM
I have four tables - Login, Main, Composite, & Type. I need three insert statements for Login, Main and Composite. (Type is a lookup table.) The Main tbl needs the ID from Login and the Composite needs the ID from Main. Is this usually accomplished using three separate stored procedures, ...more >>

PRB: Single Query to build database and schema.
Posted by ATS at 2/11/2005 11:05:05 AM
PRB: Single Query to build database and schema. Please help, I'm quite frustrated with a problem. I want to issue a SINGLE query to completely build my database (IF IT DOESN'T ALREADY EXIST), "use" it, build an entire schema of tables, stored procedures, triggers, and even populate tables ...more >>

how to use stored proc output?
Posted by Al Blake at 2/11/2005 10:23:27 AM
I want to check that the srv_datasource value of a liked server is still pointing at the correct location. I can run the stored proc sp_linkedservers and see that the value is correct....but how can I do that programmatically? I mean how do I actually code to look at the value of srv_data...more >>

Which event fired a trigger?
Posted by Vik at 2/11/2005 10:19:27 AM
If a trigger is created for Delete, Insert, Update, is there a way to find out in the trigger code which event (that is Delete, Insert or Update) fired the trigger? Thank you. ...more >>

Errors with linked server
Posted by Ram Kumar Koditala at 2/11/2005 9:27:03 AM
We have a scheduled job that is running on a server, which gets the data from other linked server using SP. OLE DB provider 'SQLOLEDB' reported an error. [SQLSTATE 42000] (Error 7399) [SQLSTATE 01000] (Error 7312) OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IDBInitialize::Initialize r...more >>

ANSI defaults, Linked Server
Posted by Gerard at 2/11/2005 9:03:08 AM
Hey all, I have a linked server on our SQL 2000 box, which points to PCCW.mdb; An Access database that our Credit Card processing software uses. I have written a SP to grab some data from this Linked Server, and from my local SQL database. The Syntax check on the SP goes fine, but when ...more >>

Upload Autonumber
Posted by David C at 2/11/2005 8:48:26 AM
I am testing an upload from Access 2002 (using replication, but unreplicated before upload) to SQL Server 2000. The Access database has Autonumber fields which I expected to upload as Identity. Instead it created insert trigger similar to one below. CREATE TRIGGER T_AssessmentDocs_ITrig O...more >>

Security question - Adding a role to a user dynamically ?
Posted by Dave Pylatuk at 2/11/2005 8:45:03 AM
Hello all, this is my first time posting here. I do not know what the best strategy is to accomplish a 'security' task in SQL Server 2000. I have a database with lets say two roles on it: --------------------------------------------------------------------------- ROLE_READ_ONLY and ROLE_D...more >>

Sql puzzle
Posted by sgpgpjr NO[at]SPAM yahoo.ie at 2/11/2005 8:15:39 AM
Hi all, I have a sql puzzle (which I've solved) but seems very unwieldy. Is there a more efficient way of doing this? It reads like so: SELECT a.* FROM axindex a INNER JOIN axindex b ON a.id4 = b.id4 AND a.id1 = b.id1 AND a.id5 = b.id5 AND a.conflict_type =...more >>

Problem with "select a, b, a+b from table" in SQL Server 2000
Posted by Mr Nice at 2/11/2005 8:10:32 AM
Using SQL Server 2000, I'm having a problem trying to derive a query field from two other fields returned in the same query. select [User - Name] = user.name, [User - ID] = user.id, [Num Laptops] = (select sum(...) where id = user.id ), [Num PCs] = (select sum(...) where...more >>

DRI or Triggers
Posted by David C at 2/11/2005 8:00:59 AM
We are planning an upload of Access 2002 database tables to SQL Server 2000 database and wanted to find out more about DRI vs Triggers as it is one of the options in upsizing. Does anyone have any ideas on what is best? I have worked with triggers before and found them to be very good and fl...more >>

Alerts passing info to a job
Posted by MattBell at 2/11/2005 7:57:04 AM
I'm not sure if this is the right place to post this, but here's my question. I have a trigger on a table where if a particular field is updated, I need to create a file containing some info relevant to the row that was updated. My initial thought was to raiserror in my trigger and then fire a...more >>

question regarding bcp
Posted by velmj at 2/11/2005 7:47:05 AM
Hi , I am executing the following command from query analyzer. It is successfull but i couldnot see the output file. I am connecting to the database server from my workstation through query analyzer. exec master..xp_cmdshell 'bcp "SELECT * FROM pubs..authors ORDER BY au_lname" quer...more >>

Newbie : Efficiency question - performance
Posted by Boonaap at 2/11/2005 7:43:09 AM
Hi, querying through SQL, wich gives the best result having to look in to a large table, or looking in smaller tables but with a lot of joins... I'm asking this because right now, i have in my design a couple of tables with only two or three columns, and about 10 records in each. Woul...more >>

Replace blank fields
Posted by Jaco at 2/11/2005 6:37:05 AM
Hi I am replacing null and blank fields in a table. Does anyone know the syntax to replace a blank field? Update site Set postcode = '-' Where postcode is null ...more >>

How do I copy a file using xp_cmdshell
Posted by Vincel2k2 at 2/11/2005 6:29:02 AM
Things I have tried. xp_cmdshell "Copy D:\Database\Apps\Ven.mdb D:\ultradb\Ven.mdb" This Works Great xp_cmdshell "Copy X:\MMS\Data1\Log_data.mdb D:\ultradb\ Log_data.mdb" Returns this error: The network name cannot be found. The path and filename are correct xp_cmdshell "Copy \\SERVER01...more >>

Stored Procedure Owner Issue
Posted by Raul at 2/11/2005 6:25:05 AM
I have several stored procedures and tables that are owned by me (I'm not a system administrator). The stored procedures work when executed from query analyzer but I can't run these stored procedures from a scheduled job. I'm assuming it's because the owner names for the stored procedures an...more >>

Transact SQL Problem
Posted by Serghios at 2/11/2005 6:21:10 AM
Hi, I have a table with 2 columns, a Name, and a QuantitySold column I would like to return 1 row for each Name which displays the Highest QuantitySold for that name. How can I do this in T-SQL in a single query? Example Name QuantitySold John ...more >>


DevelopmentNow Blog