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 2005 > threads for monday august 29

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

oracle's UTL_FILE in SQL server????
Posted by Chandra at 8/29/2005 11:53:03 PM
what is the alternative for oracle's UTL_FILE in SQL server...more >>


basic trigger ?
Posted by Aussie Rules at 8/29/2005 11:07:00 PM
Hi I want to have a trigger than when record is inserting into table A, the trigger inserts a record into table B I want the identity value from Table A to be one of the values inserted into table B. How do I get the indentity value from tableA in my trigger so that I can insert int...more >>

Join / Update Based on Max(Date)
Posted by Theadore at 8/29/2005 7:54:11 PM
custs table contains custid, phonenumber, lastdate custid,phonenumber,lastdate 123, 1112223333, 8/2/2004 555, 4567891233, 4/5/2001 123, 9996665555, 9/9/2005 555, 7878787878, 10/11/2005 newtable contains custid, phonenumber newtable will already contain all distinct custids from cust...more >>

SQL DELETE Follow-Up Question
Posted by Yosh at 8/29/2005 4:56:08 PM
What's the difference between these 2 statements (if there are any): DELETE TableA FROM TableA, TableB WHERE TableA.ID =3D TableB.FKID OR DELETE TableA FROM TableB WHERE TableA.ID =3D TableB.FKID Do they both work the same? Thanks, Yosh...more >>

xp_cmdshell and bcp issue
Posted by Drummer at 8/29/2005 1:56:45 PM
Hey all, I have a Stored Procedure that does a series of BCP's using the xp_cmdshell. The procedure has 9 bcp calls that have static file names and output locations. Further, there is a cursor that contains 4 bcp's, where the path and filenames are dynamic. When I execute this SP in query ana...more >>

xp_cmdshell and bcp issue
Posted by Drummer at 8/29/2005 1:55:38 PM
Hey all, I have a Stored Procedure that does a series of BCP's using the xp_cmdshell. The procedure has 9 bcp calls that have static file names and output locations. Further, there is a cursor that contains 4 bcp's, where the path and filenames are dynamic. When I execute this SP in query ana...more >>

Need help with SELECT statement please.
Posted by Lam Nguyen at 8/29/2005 1:48:24 PM
I need to obtain the result showing below also the the business rules are indicate below as well. Any help would greatly appreciate. Once again, Thank you. IF OBJECT_ID('Tempdb.dbo.#Fcran', 'u') IS NOT NULL DROP TABLE #Fcran GO CREATE TABLE #Fcran ( FCRAN_Id INT NU...more >>

Updating a view from ADO.net
Posted by James at 8/29/2005 1:47:29 PM
I have a view in sql server with some triger which allows me to do insert, delete, update on this view, so that I can treat the view as a table in the sql server. Now I am trying to use ADO.net to modify the view. I use some structure provided by the ADO.net like: sqldataadapter da=new ...more >>



Insert Question.
Posted by Robert H at 8/29/2005 1:22:21 PM
Hello. I am extending an existing proc and encountering a strange issue. I hope someone can shed some light on this. Here's my problem : insert into : table with decimal(14,2) columns ( where you see math ) sql statement : TRUNCATE TABLE dbo.tbl_met_wos INSERT INTO dbo.tbl_met_wos SELEC...more >>

Weird Result....
Posted by John 3:16 at 8/29/2005 12:22:24 PM
Hello... I'm experiencing something that has me stumped. The following query returns identical recs when ran from qa on 3 servers. when I run it on the 4th server, server005.fg2.dbo.addrNotes returns a rec set from the local server instead of Server005 (database fg2 exists as a development...more >>

Filter Out Duplicate Records
Posted by - Steve - at 8/29/2005 12:17:10 PM
I have an HR feed that I'm using to provision AD. We have situations were the same person (same username) appears in the feed twice. One time they'll be listed as active, another time listed as inactive. How can I write my view so that when there are duplicate usernames, it only returns...more >>

Restoring data from another database
Posted by tshad at 8/29/2005 12:14:57 PM
I have a .bak file (about 150MB) that I received from another person and want to put the data into my Sql Server Database (Sql 2000). What would the best way to copy it in? I have already created a Database called SD1. Thanks, Tom ...more >>

Renaming a Database Physical and logical file names
Posted by RSH at 8/29/2005 12:11:30 PM
I have a situation where I need to change a database's name both the logical name, AND the physical filenames. I have found several methods that change the Logical name only but keep the old filenames which will not work in my situation because there is a high probability a new database m...more >>

Wrong week number!!
Posted by Ivan Debono at 8/29/2005 12:10:09 PM
Hi all, My calendar says that 6th July 2005 lies in the 27th week. I do SELECT datepart(week, '06.07.2005') and I get 28 as a result. Do I have to use a different function or configure SQL server in another way. I'm using the German version. Thanks, Ivan ...more >>

SQL DELETE Syntax
Posted by Yosh at 8/29/2005 11:54:45 AM
DELETE TableA FROM TableA, TableB WHERE TableA.ID =3D TableB.FKID Is this the correct syntax? Thanks, Yosh...more >>

Is this a bin packing problem?
Posted by Ross Presser at 8/29/2005 11:49:25 AM
On the face of it, the words "bin packing" seem to very accurately describe this, but I'm not sure anymore. The situation is packing ordered products into shipping cartons. However, we don't have complete freedom to choose what items go into what cartons; for several reasons they have to be pa...more >>

built-in functions - owner required? (newbie)
Posted by Troy.Rudolph NO[at]SPAM ca.com at 8/29/2005 11:42:26 AM
Hi All, Ingres has some functions for converting UUIDs. Specifically, they are uuid_to_char() and uuid_from_char(). I'm new to MS SQL and would like to write some built-in functions (or any other solution) that will allow me to use the same code in MS SQL and Ingres. Example: select uu...more >>

select statement
Posted by Aussie Rules at 8/29/2005 11:39:18 AM
Ok, I have two tables, its a one to many relationship The primary table, return only one record based on the select. However I want to return the max of one field from the secondary table, which returns multiple records Table A : Contact_id, Name, Address, Phone where contact_id = ...more >>

drop constraint?
Posted by Ivan Debono at 8/29/2005 11:36:05 AM
Hi all, How does one drop a constraint using an sql statement? Thanke, Ivan ...more >>

HAS_DBACCESS for any user name
Posted by Oleg Cherkasenko at 8/29/2005 11:22:36 AM
Hi All, I need function looks like HAS_DBACCESS for any user name. How can I check has user access to db? As a user or as a member of group. Thanks. ...more >>

User Defined Data Types in Table Variables
Posted by brian.takita NO[at]SPAM gmail.com at 8/29/2005 11:09:30 AM
Hello, Is it possible to use a user-defined data type in a table variable? Given that type1 and type2 are user-defined data types the following query: declare @cik_records table ( [col1] type1, [col2] type2 ) produces the error Column or parameter #1: Cannot find data type type1. ...more >>

Please help with this SP
Posted by Dib at 8/29/2005 11:03:07 AM
Hi, I could not figure out this, I have 10 different SM.ItemGroup, SELECT Sh.ShiptoName AS [Cust Name], Req.RefNo AS [Reference No], Req.Reqno AS [Req No], ((Case When SM.ItemGroup='UCC' Then Req.Debtor Else Req.Corpname End)+ (Case When SM.ItemGroup='SVR' Then Req.Respecting Else Req.Corp...more >>

user functions and group by
Posted by Joao Mossmann at 8/29/2005 9:38:16 AM
Hello I have a problem using user functions and group by Preparing Ambient To Run SQL Step 01 - Create Table CREATE TABLE [Tteste] ( [Coluna] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL , [Num] [numeric](18, 0) NOT NULL ) ON [PRIMARY] GO -------...more >>

Distributed transaction error
Posted by Aaron at 8/29/2005 9:23:03 AM
We have a server, for various reasons has link to a loop back linked server. We have dozens of stored procedures that refer to the linked server in their code. They have worked fine for several years until a developer added an on update/insert trigger to a table. Now, when these stored proc...more >>

Trigger Question
Posted by Bobby Childers at 8/29/2005 9:22:03 AM
I'm fairly new to SQL programming, so I have a question concerning triggers. I want to cause a "status" form to open when the "today's date" is 4 weeks older than the "start date" of a project. I have fields in my "projects" table that contains the "start date", and when the project form op...more >>

Casing
Posted by tshad at 8/29/2005 9:18:09 AM
What is the accepted way of Casing Table,Fields and Stored Procedures? This is a real problem when mixing and matching. For example, C uses lower case for everything, but when calling .Net functions - you have to use Pascal Casing (1st Character of all words Capitalized). In VB.Net, you u...more >>

Selecting orphaned records
Posted by KRP at 8/29/2005 8:31:56 AM
I have a huge table from which I need to cull orphaned records. The records in this table could be referenced by any one of 8 other tables. Is there any practical, general purpose way to determine if a record in a table has inbound references? Is there general purpose query which will retu...more >>

Stored Procedure with concatenation
Posted by barhoc11 NO[at]SPAM gmail.com at 8/29/2005 7:31:27 AM
Hi, any help on this would be great... I am trying to use a stored proc to update a column to be a concatenation of 2 other columns. This proc will only update the records that are in a certain date range and will be called after those date ranges are entered as parameters. The code below is w...more >>

Help with trigger
Posted by LOST_IN_SPACE at 8/29/2005 6:42:06 AM
Please help I'm trying to create a trigger that grabs the row being inserted updated or deleted in a given table and inserts it to another almost identicle table. For some reason I'm having a terrible tome making it work. Could someone please give me a simple example to build off of. H...more >>

Step-by-step document for...
Posted by Enric at 8/29/2005 5:32:16 AM
Dear all, In order to forget once for all the web interface for these newsgroups and reading and writing from my mail client. Does anyone knows how could I add them to my Outlook 2003? Thanks in advance and regards,...more >>

newbie - Display rows with identical values
Posted by benoit at 8/29/2005 5:06:15 AM
Hello, how can i retrieve duplicate records? I have this table with about 6500 records, and i know that there are a few where a combination (Column1 - Column2) is identical how can i retrieve these? ...more >>

stored procedure which inserts new rec and returns the id
Posted by Jan at 8/29/2005 4:47:03 AM
Hi, I want to implement a stored procedure which inserts a record in a table and returns the id... example: table Books id int identity title varchar(50) stored procedure 1 input argument title 1 output argument id Does someone have such an example of a stored procedu...more >>

dangerous or heavy queries faster in front of me
Posted by Enric at 8/29/2005 3:16:03 AM
Dear fellows, I'd like to implement any kind of task or mechanism which to capture all those queries greater than x minutes. An alarm system which inform me of info such as spid, loginname, and so on and in order to avoid that, from time to time do sp_who_3 for obtain critical information ...more >>

SQL Query design tool
Posted by Ateyya at 8/29/2005 2:56:04 AM
Hi, Any help of getting a tool to design best performance SQL queries on SQL Server 2000. The tool is also needed to visually see the query design (Joins, recommended indexing, ...etc) to fine tune. Thanks -- Ateyya...more >>

changes to sp's
Posted by Bernie Yaeger at 8/29/2005 1:08:30 AM
If I create a new sp in EM I have the date of creation; however, if I modify it, it retains the original date. Is there any way of finding out the most recent modification date of an sp inside sql server 2000? Thanks for any help. Bernie Yaeger ...more >>

Using alias in queries
Posted by Diego F. at 8/29/2005 12:00:00 AM
Hi. I'm having a problem using aliases in queries. I want to use something like select id as [User Name] from table where [User Name] like '%john%' I get an error because the column User Name doesn't exist. How can I solve that? -- Regards, Diego F. ...more >>

SQL Query Help needed...!!!!
Posted by Shibu at 8/29/2005 12:00:00 AM
Hi, Please give me a suggestion to write a sql query; (Connecting one parent table with two child tables in one to many relation) Sample Table structures are as follows:- TBL_PARENT (PARENT_ID, PARENT_NAME) TBL_CHILD1 (CHILD1_ID, CHILD1_NAME, PARENT_ID) TBL_CHILD2 (CHILD2_ID, CHILD...more >>

q
Posted by ichor at 8/29/2005 12:00:00 AM
CREATE TABLE U(col1 INT); INSERT INTO U VALUES(2); INSERT INTO U VALUES(7); INSERT INTO U VALUES(9); CREATE TABLE V(col1 INT); INSERT INTO V VALUES(3); INSERT INTO V VALUES(7); INSERT INTO V VALUES(NULL); SELECT * FROM U WHERE col1 NOT IN(SELECT col1 FROM V); i expected it to ret...more >>

QUESTION????????????
Posted by Bpk. Adi Wira Kusuma at 8/29/2005 12:00:00 AM
Is it possible that the index data SQL Server can be damage? What are its characteristics if the index broken? And how to repair it? Then How to prevent it? ...more >>


DevelopmentNow Blog