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
August 2008


all groups > sql server programming > july 2005 > threads for wednesday july 6

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

Removing Date/Time Stamp from Add Remove Data in SMS table
Posted by fstuart1 NO[at]SPAM REMOVE.maine.rr.com at 7/6/2005 11:56:15 PM
Greetings, I'm new to SQL and am trying to cleanup the data that is in the ADD REMOVE DATA table in SMS. I want the data to not have the time/date stamps that were standard at one time in building SMS packages. We do not put the time and date in the ADD Remove Data. Once I get this clean SQL to...more >>

Scripting objects via SQLDMO
Posted by Frank Rizzo at 7/6/2005 10:25:48 PM
Hello, I am a bit new to scripting out objects via SQLDMO, so I have a question. When I script out stored procs via SQLDMO, some scripts start with SET QUOTED_IDENTIFIER ON, some start with SET QUOTED_IDENTIFIER OFF. What does this mean? Why are there differences in QUOTED_IDENTIFIER sett...more >>

Using temp table vs. cusor to loop through records
Posted by JLDominguez at 7/6/2005 5:38:02 PM
What is the real difference in performance between using a cursor and using a temp table to process records individually? Will there be a noticeable difference in performance between cursors or the use a temporary table? Most articales recommend using a temp table instead of cursor to loop thr...more >>

Datatype = int
Posted by Pradeep Kutty at 7/6/2005 4:55:51 PM
Hi All, When I run the following statement, it returns records (as same as) for status = 0 Select Status from sysobjects where status = '' Select Status from sysobjects where status = 0 Here the datatype of status is int. I dont know why.. Prad ...more >>

List of Databases
Posted by Rick Langschultz at 7/6/2005 4:50:07 PM
I am writing an Active Server Page application that will get all of the databases that a user can access. Is there a way I can do this with Active Server Pages? I also will provide the users with the option to change records, table structure, etc with this application. I will also be developin...more >>

Please is this trigger written in the right way?
Posted by Fabri at 7/6/2005 3:53:03 PM
I would like to write a trigger that should insert in another table all records deleted from a table. Because of I quite new to trigger I should like to know if you, gurus, see something strange or something can give problems. ===========================================================...more >>

problem removing leading nonprinting chars from a varchar value
Posted by Rich at 7/6/2005 3:38:07 PM
declare @s varchar(100) select @s = fl1 from tbl1 print '*' + @s + '*' --yields ----------------------------------------------------- * 10808* Obviously a chr(10) chr(13) char(s). I tried select ltrim(rtrim(fld1)... but get the same result as above. How can I remove the chr chars to g...more >>

Gurus I need your advice again
Posted by Chris at 7/6/2005 3:32:01 PM
Hi, How can I simulate a long running process in SQL Server? I need to create a SP so that when called from my front end app (asp.net, vb.net) I need for it to simulate a long running process so that I can test controls like progress bars etc. Thanks...more >>



updating one database with pk from another table in another database
Posted by et at 7/6/2005 3:30:14 PM
I need to update a table in a database (db1) with the id field of a table in another database (db2). Both databases have a client table with a name, company, address field. In db1, I want to eliminate the name, company, address field and replace it with the primary key from the other datab...more >>

Query two different datbases.
Posted by William at 7/6/2005 3:18:43 PM
I have two databases. One in-house and one Co-Located. I want to be able to pull data from both with a single query and understand that there is a way to connect the two databases in some way? Anyone know where I start. Both databases can be accessed from an IP address. Online id,revenu...more >>

Custom Control Flow Item
Posted by AWHK at 7/6/2005 2:58:16 PM
Hi, I am implementing IDTSComponentPersist but my task still not persist data. Am I missing something? Any ideas or direction to where to look for more information (I`ve looked all over Books Online)? Andreas :-) SAMPLE CODE: private static string NamespaceURI = "www.microsoft.co...more >>

Conditional select into on temp table
Posted by wxd at 7/6/2005 2:21:02 PM
Trying to do the following results in the error 'there is already an object named #TmpJ in the database.' I assure you there is not. #TmpJ is to be created with the following select into statement. So why is it complaining? Thank you for your insight. declare @a int set @a = 1 If @a...more >>

Trigger / SP Question
Posted by JLS at 7/6/2005 2:12:12 PM
Is there any reason one would not want the body of a trigger to execute = a stored procedure? I was asked the question today, if someone could have a trigger fire a = stored procedure & this way if it is complex they will just deal with = changing the script of the sp. All opinions are ...more >>

Sub query statement with an alias
Posted by .Net Sports at 7/6/2005 1:55:32 PM
I'm going to be using an sql column's content in one datagrid column, and use another datagrid column for another portion of that sql column select tbldeal.ID, tblDeal.Sale_Type_ID(select tblDeal.Sale_Type_ID < 3 as News) from tblDeal where thedate = '7/6/2005' is giving me an error: Incorre...more >>

joining tables
Posted by Mike Moore at 7/6/2005 1:23:03 PM
I have a situation where I need to join numerous tables in order to display data to the user. The user will be allowed to update the information. I am creating my data adapter and dataset in Visual Studio. However, Visual studio will not create insert, update, or delete commands for this datas...more >>

Sql query
Posted by Sanjay Pais at 7/6/2005 1:20:13 PM
If I have two tables TableA(Col1 int, Col2 int, ColDesc varchar(10)) Col1 and Col2 are part of a unique composite index TableB(Col1 int, Col2 int, ColC varchar(10)) To get all rows in TableA where Col1 does not exist in TableB is easy. Select TableA.* where TableA.Col1 NOT in (select col...more >>

Subselect from same table
Posted by Usarian Skiff at 7/6/2005 1:18:09 PM
I have a table that contains data in different columns in which another column contains a code which classifies what type of entry the row is. Similar rows are linked by identical values in a date/time column. quick example Class column contains A B B C A B column 1 contains data for class ...more >>

Creating Triggers using DDL deletes other system objects
Posted by Garrett Kunimura at 7/6/2005 1:05:05 PM
I am wondering if anyone else had the problem of trying to create a trigger through Query Analyzer and, once executed, it can either wipe out data from a table or drop foreign key constraint objects? If so, how would I resolve this problem? My company is currently using SQL Server SP4....more >>

How many NDF files do we need?!?
Posted by Mike Labosh at 7/6/2005 1:00:45 PM
We have a suit here that knows the SA password. @#$%^& He likes to hop into EM and make NDF files. He says it's to increase performance. So far, we have ISD.mdf, ISD1.ndf, ISD2.ndf, ISD3.ndf and ISD4.ndf all on the same partition. I am convinced that this is stupid, but it would be nice...more >>

Index Question
Posted by Mike Labosh at 7/6/2005 12:53:26 PM
Apologies if this is a multipost. I posted this twice last night and I still can even see my OP. I have these three columns that I want to JOIN from TableA in this order: Vendor NVARCHAR(255) NULL, MachineType NVARCHAR(255) NULL, Model NVARCHAR(255) NULL To this column in TableB: Id...more >>

Convert char to hex string
Posted by Soeren S. Joergensen at 7/6/2005 12:52:32 PM
Hi, How do I convert a char string to equalent hex string, say: 'AA' = '4141' 'AB' = '4142' 'bk' = '626B' I've tried casting from char to int to binary and back again but can't make it work. Any good ideas ??? Thanks in advance Kr Soren ...more >>

Using INTERVAL in date calculation
Posted by Frank D. Nicodem, Jr. at 7/6/2005 12:09:22 PM
I'm trying to do date arithmetic using INTERVAL, and am having a problem. Basically, I want to do something like: set :xdate = :xdate - interval '1' month; And that works just fine (with the variable declared correctly, of course). But what I actually need to do is to have the interval...more >>

Inserting data to a table from other database. Help
Posted by Le9569 at 7/6/2005 11:06:04 AM
Hello, I would like to insert a set of data to another table in different db as: INSERT INTO db88.UserAdmin.dbByUserName (username, dbname) EXEC sp_MSForEachDB "use ? select name as username, '?' as dbname from sysusers where islogin = 1 and hasdbaccess = 1 ORDER by name" I am in ...more >>

server connection
Posted by Hrvoje Voda at 7/6/2005 11:01:27 AM
I'm trying to connect to an sql server from another computer and I get an error message : Not assosiated with a trusted sql server connection... What should i change on that server so that it becomes a "trusted sql server"... Hrcko ...more >>

sp debugging
Posted by Ilann at 7/6/2005 10:18:00 AM
Hi, I'm trying to debug one of my sp via sql query analyzer debuger and I get the following message: "SP debuggin may not work properly if you log on as 'local system account' while SQL Server is configured to run as a service. Do you wish to continue?" I click yes and then I get param...more >>

re: how to compact a MS Access database thru SQL Server...
Posted by === Steve L === at 7/6/2005 10:17:13 AM
I've posted this before but didn't get an answer and would like to try it again. i've tried two ways to do this w/o success. 1. i used docmd.RunCommand acCmdCompactDatabase in SQL DTS task (under an Access mdb connection) but it errored out. (does anyone know how to issue Access VBA com...more >>

ISNUMERIC
Posted by hoelder at 7/6/2005 10:09:01 AM
When you pass a '.' to the function isnumeric, it returns 1 for yes and that throws your conversion from varchar to a number into an error. ...more >>

Performance Monitor
Posted by Ed at 7/6/2005 9:50:04 AM
Hi, Can someone please provide me some helps/hints what should I do to bring up and look at the Performance Monitor to look at the CPU and Memory Usage? Sometimes the CPU usage is 80%/100% and i am not so sure if it is all occupied by the SQL Server Thanks Ed...more >>

Data Comparison
Posted by Hasan Rahman at 7/6/2005 9:27:41 AM
Hi there, hope someone is able to help me with this...any help would be greatly appreciated: Running SQL Server 2000. I download a txt file each morning, import it into a table (Staging) after backing up the previous days into Staging_Backup. All this is automated using DTS and EMS software (...more >>

David, I see what you mean... but
Posted by MCSETrainee at 7/6/2005 8:09:07 AM
Hi again... OK I think I see what you mean by the insert/ select but I do not understand how to add a series of rows based on values in the table. I guess I would have to use the EXECUTE.... but the thing is... when I took the cursor away and just tried to add 600,000 records, I still lo...more >>

Problem - Update commands within a store procedure doesn't always
Posted by in-over-his-head-bill at 7/6/2005 7:57:10 AM
I have a series of updates to a table within a single stored procedure. Each successive update is dependent upon the values updated previously. E.g., Update t1 set userflag='y' where criteria='xyz' Update t1 set userflag1='y' where userflag='n' and criteria2=5 .... Occasionally, (an...more >>

Query Sorting Question
Posted by rickp3131 at 7/6/2005 7:55:02 AM
I'm wanting to group field1, sum their results into field2, and order the set by field1. The twist is some of field1's values are null so the isnull function is being used to default them to "Other" but i want it to fall to the bottom of the output. The following query doesn't work but what ...more >>

Interesting SELECT question
Posted by ms news group at 7/6/2005 7:50:58 AM
Hello Does ANSI SQL support conditional selects ? I have a table with say 15 fields tblTale1 ID F1 F2 F3 F4 F5 F6 .. .. .. F15 What I want to do is, add all the Fields from F1 to F15 and divide that total by the total number of fields which were more than 0. I know how ...more >>

Openrowset and update
Posted by Josh at 7/6/2005 7:34:05 AM
Can someone show me a good example of using openrowset to update a table. I would also like to see one using sspi authentication. TIA...more >>

Newbie: What's wrong with the "WHERE" part of this query? HELP!
Posted by The VanDerbeck Group at 7/6/2005 7:26:08 AM
INSERT INTO ix_spc_product(upc) VALUES ('0120304020101') WHERE NOT EXISTS (SELECT upc from ix_spc_product WHERE ix_spc_product.upc = '0120304020101' ) ...more >>

SPROC question.. is there a way to do this ?
Posted by Stuart at 7/6/2005 7:17:07 AM
Hi there I have an .asp application that provides a Polling facility to an organisation. The Poll targets are different groups of people who are split up in to Zones (1, 2, 3 etc. etc.) They can provide up to 10 responses to a poll topic, then the members vote according to the answer the...more >>

Using TIMESTAMP or DATETIME
Posted by Gandalf at 7/6/2005 5:46:02 AM
Hi, I'm using a table which contains a field. Its type is TIMESTAMP but I don't know how I can update it. What I want to do : send a request with a client which inserts in the table a record with a specific date. I tried to make the following request but without success : INSERT MYTABL...more >>

Int vs. Tinyint
Posted by Bob at 7/6/2005 5:11:35 AM
Is it always "better" or "faster" to use the smaller datatype? How much differnece is there.....assuming you are developing web based programs and speed is a top priority. ...more >>

Implicit date/string conversion?
Posted by Damien at 7/6/2005 3:39:04 AM
Hey team, can someone tell me what's going on here, as I don't think the first 'Yes' statement should work, but it does. Is it an implicit string conversion? Thanks Damien -- Create a table to hold some dummy dates --DROP TABLE #tmp CREATE TABLE #tmp ( test_date DATETIME ) ...more >>

Import XML
Posted by LuMa at 7/6/2005 2:17:05 AM
Hi, i need to sum data in Level 2 . The records in Level 3 must be in one row, but i must to know value of Level 3 . It’s important for me string in “ “. . The best solution is to get value from level to every row in the same row. But how. Thanks for your help and apologize my engli...more >>

How to zip Files in a DTS Package
Posted by Sevugan at 7/6/2005 2:05:03 AM
Hi, I have exported data from 3 tables to 3 different flat files. I am sending all the 3 files using xp_sendmail procedure. I need to zip all the 3 files into a single file and send it off. How can I do this? Plese give me an example. Regards, Sevugan.C ...more >>

Show up SQL Result
Posted by Arnold at 7/6/2005 1:23:01 AM
Hi, -- How do I show up an SQL result in an ASP.NET? Good day all, Arnold, The Frenchy...more >>

SQL statement puzzle
Posted by leonlien NO[at]SPAM dslextreme.com at 7/6/2005 12:00:00 AM
I have a SQL as following SELECT Funded, LOAN_NUM, ABA, LoanType, DTKEY, File_ID, (SELECT MAX(CDate) FROM MMCUW NOLOCK WHERE (Loan_Number = Loan_Num) and deledate is null) AS UWCDate...more >>

SQL query Finding missing "dates" in a period
Posted by Henry at 7/6/2005 12:00:00 AM
Hi Is it possible to make a query on a table and discover missing "dates"? The Table could look like this CREATE TABLE [dbo].[Statistik] ( [SiteID] [int] NOT NULL , [TicketFileName] [char] (12) NOT NULL , [RealDate] [datetime] NULL , [Loaddate] [datetime] NULL , [TotalRecords] [in...more >>

½Ð°Ý ¹w¦sµ{§Ç ENCRYPTION
Posted by SOHO at 7/6/2005 12:00:00 AM
½Ð°Ý§Ú¦³¦h­Ó "¹w¦sµ{§Ç" ¦b§Úªº SQL SERVER ­n ENCRYPTION ¦Ü ¨ä¥L SQL SERVER °£¤F¨C­Ó "¹w¦sµ{§Ç" ¥[¤@¦æ WITH ENCRPTION ¥~, ¥i¦³¨ä¥L¤èªk¶Ü? -- Thanks ! ...more >>

Table Locks
Posted by Shahriar at 7/6/2005 12:00:00 AM
How can I find out what tables are locked and specifically by whom? Ideally, is there a trigger that I can write on a table that fires up if a table is locked more than a specific amount of time? Many thanks Shahriar ...more >>


DevelopmentNow Blog