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 > april 2007 > threads for monday april 30

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

Query Analyzer Command Line Switches
Posted by scott at 4/30/2007 8:17:49 PM
I want to create a desktop shortcut that will open QA with a .sql file and also open with the master database as the current database. I found the example syntax on the web, but still need some help. If my server name is "myServer" and my script file is "c:\sql\myScript.sql" and I'm using S...more >>


BCP error....
Posted by dfateman NO[at]SPAM gmail.com at 4/30/2007 7:16:19 PM
Hi all, I'm migrating a process from SQL 2000 to 2005. it generates an XML file using the cmd: bcp "EXEC PROD.dbo.client_export_events_xml 1" queryout "e:\cli_DP\cli_events.xml" -S"PRD-SQL1\SQL2005" -Uxxx -Pxxxx - c -r -t The proc works fine in SQL 2005 SSMS, BCP crashes with the following e...more >>

how view value of Transact-SQL 'timestamp' column?
Posted by Rick Charnes at 4/30/2007 4:04:03 PM
How can I view the actual date and time value of a Transact-SQL 'timestamp' column? I see that it's a string of binary numbers. Can this be translated into a real data and time, or is just a way of version-stamping table rows that really has nothing to do with an actual date and time? Tha...more >>

Newbie question on what s/b a simple select statement
Posted by Terry at 4/30/2007 3:46:00 PM
Have a simple sales tax table containing: CityId, TaxRate and EffectiveDate colums. The table contains historical data as well as planed rate changes in the future. Need to return a set of records, one for each CityId with the rate that is in effect, to make it simple, lets say today. You...more >>

append a field to a variable
Posted by Peter at 4/30/2007 3:02:05 PM
SQL SVR 2000 I have a list of about 100 stores DECLARE @store varchar(4), @storeList varchar(600) SELECT Store_CD from STORE In the end, I want a variable to contain all of the store_cd's delimited by comma's. expected output (variable contents): 01,02,03,04...etc. I can cursor throu...more >>

How to simulate an error?
Posted by Peter at 4/30/2007 2:58:02 PM
I want to create an alert for an error # and the alert message will include the hostname (not spid) which causes the error. 1. How to simulate an error to test the alert? 2. How to include the include the hostname as part of the alert message? Thanks....more >>

Confused about proc vs. dynamic SQL vs LINQ
Posted by Ronald S. Cook at 4/30/2007 2:39:52 PM
I've always been taught that stored procedures are better than writing SQL in client code for a number of reasons: - runs faster as is compiled and lives on the database server - is the more proper tier to put it since is a data function But then I've heard that writing SQL in my client .NE...more >>

CREATING A USER LOGIN
Posted by JHPAZOSF NO[at]SPAM gmail.com at 4/30/2007 2:39:30 PM
Hi I am learning to use SQL Server 2005 I created a database called db on the DOTCOM server but when i try adding a new user using the SQL server authentification i get no accounts on the dropbox. How can I create a user that would appear in the login ...more >>



How does a view work?
Posted by jbyrd at 4/30/2007 2:22:30 PM
When using views; does the view get executed completely before adding the where clause in a select? Example: Test1 is a view. Select * from test1 where name = 'John' Will all data get pulled from test1, then rows eliminated according to the where clause? How does it work exactly? ...more >>

Calcs from same table
Posted by Mark Goldin at 4/30/2007 2:15:22 PM
I have the following structure: line_id Int, job_id Int, totaltime Int, catergory Int Here is a data sample: 1 1 10 1 1 1 20 1 1 1 15 2 1 1 25 2 I want to have: 1 1 30 1 1 1 40 2 using one SQL statement. Can someone help, please?...more >>

backing up and restoring diagrams in SS2K
Posted by PJ6 at 4/30/2007 1:31:22 PM
Google isn't showing me the love today. I know it's possible to back up and restore SS2K diagrams, but I just can't find the article(s) at the moment. Anyone? Thanks, Paul ...more >>

Oracle equivalent to @@serverName
Posted by mcdonaghandy NO[at]SPAM gmail.com at 4/30/2007 1:23:56 PM
Hello, In Sybase I can use the select @@serverName, but I was wondering if there was an equivalent statement that I could use in Oracle. Thanks, Andy ...more >>

Optimization Job
Posted by FARRUKH at 4/30/2007 12:46:07 PM
we have very critical databases running n 24/7 production environment. I want to set optimization job (Reorganize data/index pages AND Remove unused space from database files) Whats the impact on the system if I set these optimization jobs? During these jobs, will application slow or perfor...more >>

MSDE and ISQLW
Posted by Robert Taylor at 4/30/2007 12:42:36 PM
Is there a way to use ISQLW to query an MSDE database? Thank you. Robert *** Sent via Developersdex http://www.developersdex.com ***...more >>

How to Update an Oracle Row from a SQL Row
Posted by tyrus at 4/30/2007 11:46:03 AM
I have a stored procedure that looks like: UPDATE Openquery(DEVDB3,'select Crew_Member_ID, fleet_Type_nbr from crew_member') set fleet_type_nbr = Crew_DataSQL.dbo.CrewVacationBiddingDataUpdated.fleet_type_nbr From Crew_DataSQL.dbo.CrewVacationBiddingDataUpdated Where Crew_Member_ID = @Crew...more >>

selecting the most recent date for each item
Posted by isabelle at 4/30/2007 11:16:02 AM
Hi, I've been looking at previous posts to try and figure out how to get my query to return the most recent date for each item and I can't figure it out. Here is my query: select vw.item_code, vw.qty_onhand, rh.date_rcvd from incinvw vw, incinv1 v1, podinrh rh where v1.lot_control_ind =...more >>

Combine records into one SELECT statement
Posted by jackso95 NO[at]SPAM hotmail.com at 4/30/2007 9:29:47 AM
Is there a way to use a single SELECT statement to "combine" multiple "LIKE" records in a one record output? In this case, the common field between these two tables is "frecno = item_rec" Thank You. Jack Table 1: Item Item_code desc1 frecno table 2: Item_status Item_rec Loc...more >>

Select records - Join
Posted by shapper at 4/30/2007 8:58:14 AM
Hello, I am selecting some articles and some comments related with it: SELECT a.ArticleID, a.Title, a.Content, c.CommentId, c.Title, c.Comment, u.UserName AS ArticleAuthorName, u.UserEmail AS ArticleAuthorEmail FROM Articles a INNER JOIN Users u ON a.AuthorID = u.UserID INNER JOIN C...more >>

Eliminate Nested Cursors
Posted by piipco NO[at]SPAM gmail.com at 4/30/2007 7:52:43 AM
I have a somewhat complicated billing process, and the only solution I can come up with is using nested cursors and dynamic SQL. I'm hoping there is a better way. Big picture view: an administrator can create custom rules that will trigger certain fees on a set of users that will be invoiced. ...more >>

Calling a stored procedure from inside another
Posted by Karl Rhodes at 4/30/2007 7:31:22 AM
Hi all, I need to be able to pull back a list of rows (user data - names etc) from a database who exist lower in a hierarchy than the user who is calling the stored procedure. I know I can use Microsofts new CTE in SQLServer 2005 to get a list of all the hierarchy points for the hierarchy of ...more >>

Reality Check
Posted by Greg Larsen at 4/30/2007 7:20:04 AM
I'm looking for a reality check into the best approach to solving an issue. We currently have a single server that houses many databases. We are undertaking an effort to migrate these databases off onto two different servers. Some of the databases contain confidential data while other do no...more >>

Passing GetDate() as stored procedure function parameter
Posted by Amit at 4/30/2007 7:02:33 AM
Hey, I have a stored procedure, which requires current timestamp as one of it's parameters. I tried resolving the issue using the following piece of code strcpy(sqlString,"{call Pi_FUNCTION1 (?,?,?,?,GetDate(),?,?,?,?)}"); returnVal = SQLExecDirectA(hstmt, (UCHAR*)sqlString, SQL_NTS); On...more >>

Select using a comma delimited variable
Posted by Steve at 4/30/2007 6:06:46 AM
I've done a lot of searching on this and can't find anything that looks like what I want to do. I'll simplify things greatly. I have a variable coming into a stored procedure that contains the columns I want to select on eg: @metrics = 'CPU_Average,CPU_Peak,MEM_Average' the select stateme...more >>

Can i have one trigger for both Update and Delete
Posted by satish at 4/30/2007 6:04:14 AM
hi, Can i have one trigger for both Update and Delete Delete Trigger --------------------- create Trigger [tr_delete_user_log] on [dbo].[user_log] for delete as begin insert into z_user_log select * from deleted end Trigger Update --------------------- CREATE Trigger [tr_update_user_lo...more >>

Select From Remote SP without using temptable
Posted by cortukmehmet at 4/30/2007 5:28:02 AM
Hi, My procedure looks like; -->S001002DB01 is linkedserver create table #tmp(KutTracking nvarchar(50)) insert #tmp exec S001002DB01.BetaShop.dbo.Net_OrderGetTracking @promaxKey select top 1 @kut=KutTracking from #tmp drop table #tmp when i execute it, it throws an error like 'Th...more >>

Reporting service
Posted by Archana at 4/30/2007 4:24:05 AM
Hi all, can anyone tell me whether i can install reporting service on windows 2000 or not. if yes how? thanks in advance. ...more >>

insert into tbl1 () select() tbl2 - error
Posted by GotDotNet? at 4/30/2007 12:00:00 AM
If I do a insert into tblA (id, name) select (newid(), frstname) from cust do the colums I'm inserting into have to match the columns I'm selecting from? so should it be insert into tblA(id, name) select (newid(), name) from cust or will insert into tblA(id, name) select (newid, ...more >>

sending to url
Posted by mml at 4/30/2007 12:00:00 AM
Hello, I've to send data to a url. Example : Send data to "http://targeturl/articles.htm/" How can I do that in Transact SQL ??? Thank's a lot if you can help me... ...more >>

Asymmetric data syncronization: possible?
Posted by mik at 4/30/2007 12:00:00 AM
I have two sql server instances on two different machines with the same db; on the first machine some tables need to be copied on the second machine, and on the second machine some other tables need to be copied on the first; all the tables are related with the others in some way. It is possible...more >>

character to numeric
Posted by Agnes at 4/30/2007 12:00:00 AM
any function can change the string "200706" into numeric 200706 Thanks ...more >>

Transactions AND Stored Procedure Question
Posted by Sugandh Jain at 4/30/2007 12:00:00 AM
Hi, We have the following scenario: Suppose we have following scenario. StoredProcA :- This SP begins a transaction A and inserts a row in TableA. Now We call a StoredProcB from StoredProcA and in this SP, We Begin Transaction B and insert a Row in Table B. Now...more >>


DevelopmentNow Blog