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 2005 > threads for monday september 19

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

Jobbing!
Posted by Arpan at 9/19/2005 11:39:05 PM
I want to retrieve all those records from a column (that stores date values) where in the date is 1 + today's date. For e.g. today is 20/09/2005. I want all those records where the date is 21/09/2005. I want to send a reminder mail to all those records retrieved that they have to make the paym...more >>


query to search a column
Posted by Chandra at 9/19/2005 10:58:04 PM
Hi, I know the column name but I don't know in which table it is existing. It will take a lot of time if I search table by table.. Is there a way/query to find in which table a particular column is existing? please let me know if there is one.. Thanks Chandra ...more >>

Query Analyzer Problem
Posted by Entire Display Icon missing at 9/19/2005 10:49:03 PM
I'm writing ad hoc queries and when I press enter to go to the next line, all my prior code is erased. What am I missing?...more >>

Date Problem!
Posted by Arpan at 9/19/2005 9:11:50 PM
A column in a SQL Server7 DB table has the datatype smalldatetime. All the records in this column are stored in 'm/d/yyyy' format like 6/15/2005 (15th June 2005), 8/21/2005 (21st August 2005) etc..... Assume that two of the records stores today's date i.e. 9/20/2005 (20th September 2005). When...more >>

CAST in raise error
Posted by DazedAndConfused at 9/19/2005 8:28:49 PM
Is there anyway to CAST or CONVERT an integer within RAISERROR? I have tried all sorts of permeations to no avail, I have to declare another variable and CAST into that to use it in the RAISERROR. SET RAISERROR(101002,16,1,@errorstring, (SELECT @pid = CAST(@pid as varchar(15)),@uid) SET...more >>

index usage question
Posted by anon at 9/19/2005 8:01:15 PM
hi, i have a query like select * from A, B where A.c1 = B.c1 and A.c2 = B.c2 and B.c2 = 'xx' and A.c3 = 0 there is an index on A(c1,c2) and B(c1,c2) . the query is underperforming. the plan shows that for the A.c3 = 0 condition (which happens to be huge), it is doing a table scan, a...more >>

Advanced SQL script Editor
Posted by Just D. at 9/19/2005 4:04:19 PM
All, Who and how writes very long scripts in T-SQL? Do we have anything more convenient than M$ SQL Query Analyzer? I finally started writing my scripts in WinWord because of the terrible despair. It at least allows me to use formatting, color selection, block separation, etc. Then I can co...more >>

Missing records
Posted by tshad at 9/19/2005 4:04:19 PM
I am trying to find missing Checks from Check Table (I know there are no tables). Here is a sample table (oops did it again) :): if Exists (SELECT 'x',type,Name FROM sysobjects WHERE type = 'U' and NAME = 'TestTable') DROP table TestTable CREATE TABLE [dbo].[TestTable] ( [SeqNumber]...more >>



unintentional rounding problem
Posted by Keith G Hicks at 9/19/2005 3:43:41 PM
I have a procedure that builds an update statement and then I execute the statement. I noticed that I'm getting results I didn't anticipate as follows: declare @TestNum as decimal(10,4) set @TestNum = 3.1234 print @TestNum print @TestNum * (50/100) The results are 3.1234 0.0...more >>

Stumped by SQL challenge
Posted by imani_technology_spam NO[at]SPAM yahoo.com at 9/19/2005 3:19:09 PM
Here is the table: CREATE TABLE [child] ( [pk_child_id] [int] NOT NULL , [fk_parent_id] [int] NOT NULL , [code] [char] (2)NOT NULL , [dt] [datetime] NOT NULL , [newcode] [int] NULL ) There is a situation where there will be mor...more >>

query statement question
Posted by tom taol at 9/19/2005 1:48:36 PM
field1 field2 field3 field4 field5 1 3 4 2 9 2 1 5 3 2 1 3 4 2 7 2 2 5 3 2 2 1 5 3 8 8 1 6 3 2 8 1 6 3 1 8 1 6 3 3 after quering, result below field1 field2 field3 field4 field5 1 3 4 2 9 2 1 5 3 2 2 2 5 3 2 8 1 6 3 2 i want to remain only row of same field1~field4. If field1~f...more >>

Need help with Sql Profiler
Posted by Gene. at 9/19/2005 1:36:04 PM
Hello I need to monitor creation/deletion/modification of objects in a database. I decided to use sql profiler with objects events auditing(create, delete) and TSQL events (SQL: STMstarting, SQL: batchstarting) for 'alter' statement. It's working, but I've encountered a few problems I can not r...more >>

Transactions: Many small or one Biggie
Posted by kevin at 9/19/2005 1:24:01 PM
using SQL SERVER 2K I am working on a data migration project and will be moving records with multiple SPs. I am looking for opinions, criticisms welcome, about my basic design. I have one sp (usp_Biggie) with a single transaction that executes multiple small sps that perform the actual...more >>

How do you replace all occurences of a certain string in a column?
Posted by MittyKom at 9/19/2005 12:39:02 PM
Hi All I have table Tab1 with a column Col1 of data type text. I want to replace every "The" string in that column with "As". How can i do that ? Below is column Col1 with 2 rows of data: Col1 -------------------------------------- <p> The boys are gone </P> <p>She left me by the door <...more >>

shrink log file
Posted by SG at 9/19/2005 12:15:25 PM
Hi, I'm using MS SQL 7.0 on NT4 server. There is a database call "db1" which only has statics information, no daily transactions happen. Recently I found the data is faily large and we short of disk space. db1 data is about 1GB, db1_log is about 5GB. First of all, I ran dbcc sqlperf(logspac...more >>

Formula in a View
Posted by Tom Woods at 9/19/2005 12:05:35 PM
I'm trying to perform the following within a view. I'm not getting the values which I would expect. I'm assuming I have a data type problem where some precision is being dropped. Could someone give me a heads-up on what I'm doing wrong? I need full precision. SUM(((MarketPrice+Market...more >>

Newbie Query Problem
Posted by Chuck at 9/19/2005 11:58:06 AM
I want to use the same field in one table and return multiple columns for different criteria. In other words... First column SUM(Sales.NetSales) as 'Total Sales'). Then I want a second column as SUM(Sales.NetSales) as 'Category 02' where Sales.categoryid='02'. Is this reasonable? I ...more >>

relationship between tables
Posted by HP at 9/19/2005 11:41:06 AM
I need to create a relationship between 3 tables,say x,y,z. y and z being the parent tables to x. there's an id field in all the 3 tables. i need to create a relationship between these 3 tables such that the id field in x is related to either y or z. in other words, sometimes the id field in t...more >>

GUI tool
Posted by Fabri at 9/19/2005 11:33:56 AM
I'm looking for the best free GUI tool to admin MSDE installation. Any help appreciated. Best regards. -- Gibe si è fatto passare perchè Rossi dietro è come una purga, prima o poi una cagata te la fa fare...!...more >>

Help with max()
Posted by Rick Charnes at 9/19/2005 11:23:38 AM
I have two tables: TABLE1 has policy_id and subm_no, multiple subm_no's for every policy_id. TABLE2 has policy_id I'm doing a join, WHERE table1.policy_id = table2.policy_id. I need to display the value of many fields from both tables where table1.subm_no is the max value of that subm...more >>

query with like
Posted by et at 9/19/2005 11:21:17 AM
How do I build a query using like, but the options come from a table? Such as Select lname from tblClients where lname like '%smith%' but the "smith" comes from another table, such as select lname from lnamelist. ...more >>

How to handle exceptions/errors in triggers
Posted by VN at 9/19/2005 11:16:07 AM
I am working on a MS SQL server DB where I have no control over the application code. We want to create a mirror table(say, TableA_mirror) for one of the tables that exist in the DB(say, TableA). Whenever, insert/update/delete is executed on TableA, the record that is changed is inserted int...more >>

Question on mutiuser,Concurrency and Isolation level
Posted by siddharthkhare NO[at]SPAM hotmail.com at 9/19/2005 11:07:30 AM
Hi All, CREATE PROCEDURE dbo.GetNextItem @UserID INT, AS SET TRANSACTION ISOLATION LEVEL REPEATABLE READ BEGIN TRANSACTION SELECT TOP 1 @WorkItemIDOUT = WorkItemID From MyWorkItemIDsTable where IsInprocess = 0 ---value of 0 ensures that one else is working on it in a mult...more >>

business logic location
Posted by PJ6 at 9/19/2005 10:44:04 AM
For quite a while I've had pretty good success with putting most of my business logic in stored procedures and triggers. It's fast, relational, searchable, and updatable without any recompiling. At the moment I'm considering supporting both SQL Server and Oracle, and it seems to me that to ...more >>

recovery model
Posted by js at 9/19/2005 10:39:43 AM
Hello, how to know what's my database's recovery model? hwo to change it? Thanks. ...more >>

Using "Select...IN" with a list of strings
Posted by DonSQL2222 at 9/19/2005 10:08:04 AM
This works: declare @var1 char(30) select @var1 = ('text1') select * from <table> where <field1> IN (@var1) This works: select * from <table> where <field1> IN ('text1','text2') This doesn't work: declare @var1 char(30) select @var1 = ('text1','text2') select * from <table> wh...more >>

stored procedure problem on update
Posted by Tonio Tanzi at 9/19/2005 8:53:06 AM
I'm using MSDE in VisualStudio.Net If I execute this simple stored procedure: ALTER PROCEDURE dbo.StoredProcedure1 AS Declare @rowcount int UPDATE t_prova SET testo = 'pippo', booleano = 1 WHERE numero = 4 SELECT @rowcount = @@rowcount IF @rowcount<>0 SELECT 0 ELSE SELECT -1 RETURN ...more >>

uniqueidentifier as an optional parameter
Posted by jhcorey NO[at]SPAM yahoo.com at 9/19/2005 8:36:16 AM
I'm unable to use a uniqueidentifier as an optional parameter to a stored procedure. I'd appreciate it if someone can confirm this. When I call a proc like this one from my program, Create Procedure MYProc @my_id uniqueidentifier = null as insert mytable (myID) values (@my_id) ...more >>

How to search subfolders??
Posted by Greg2582 at 9/19/2005 8:31:09 AM
I want to extract variable data from files within folders and subfolders and output the results to a report, sorted by file name, variable1, variable2, variable3, etc....more >>

repeat a statement in a loop
Posted by Xavier at 9/19/2005 7:19:14 AM
hello, i need to repeat the update statement for all days in the actual month example:if i run today (19.09.2005) the job - it must run 19 times for the value of GETDATE() to GetDate() -19. How can be done this in a loop. In the update statement is GetDate() used in the where conditi...more >>

rowset processing
Posted by mcourter NO[at]SPAM mindspring.com at 9/19/2005 6:21:03 AM
i need basic sql syntax to accomplish the following: creat a cursor for select rows from table B in DB II that match a key value in table A in DB I. Then check to see if rows in the cursor match this key in table C in DB III. if yes then update, else insert. thansk for the help, mcnewsxp ...more >>

simple xtab join question
Posted by WebBuilder451 at 9/19/2005 6:11:10 AM
My simple join question for the day HOWTO: i have two queries the each product an atomic value. select count(a.usrexpdate) as activemem from usr a where a.usrexpdate > getdate() select count(b.usrexpdate) as activemem from usr b where b.usrexpdate < getdate() how can i join these qu...more >>

number of database users
Posted by Panos Stavroulis. at 9/19/2005 6:01:07 AM
Hi, Does anybody know whether performance is affected if all database connections are done through the same database user name? Ie will performance be better if I had 20-30 different database users instead of one I am using at the moment. Personally, I am not expecting better performanc...more >>

Is there a way to find out which login who created a login?
Posted by mw at 9/19/2005 5:22:33 AM
Hi, I have a question about Microsoft Sql Server 7. Is there a way to find out which login who created a login? And how do I find out which login it created? ...more >>

MSDTC error
Posted by jules remoreras at 9/19/2005 5:19:45 AM
Hi guys, Im new to SQL Server development in general...Well, I've been trying to work on an existing application that uses both ASP and SQL Server that happened to be raising an error that is logged on the Event Viewer 15 minutes after closing the browser. Here it is: Event Type: Informatio...more >>

Out put of Select Statement Stored in a variable to another Variab
Posted by Kag at 9/19/2005 4:47:06 AM
Hi Guys, I need a solution in SQL Server 2000. I wanted to store the output of a select query into a variable. The Select Statement is stored in a variable. the sample is given below. declare @Tmp Varchar(100), @Tmp1 Varchar(100), @Tmp2 Varchar(15) set @Tmp = 'columntitle from ...more >>

CROSS JOIN query with a TRUE/FALSE values
Posted by rubberbong NO[at]SPAM yahoo.co.uk at 9/19/2005 4:31:52 AM
I am using SQL Server. Having two tables Table T1: ID Name -------- 1 A 2 B Table T2: ID Description --------------- 1 a 2 b SELECT * FROM T1, T2 gives: 1 A 1 a 1 A 1 b 2 B 1 a 2 B 2 b =========================================================== Qu...more >>

Cursor
Posted by Jaco at 9/19/2005 4:15:04 AM
Hi I am creating a cursor which runs through a table of database names and execute a script using xp_cmdshell on every database in that table. Declare @DataBaseName varchar(255) Declare DBcursor CURSOR FOR Select dbname From master..upgradedb Declare @command varchar(255) OPEN DBC...more >>

List available SQL servers in VB.Net
Posted by Henry at 9/19/2005 3:48:04 AM
Hi, I want to list all available SQL servers in the LAN in my VB.Net application. Therefore I use SQLDMO and the following code: Private SQLServerDMOApp As New SQLDMO.Application Sub SomeSub SQLServerDMOApp = New SQLDMO.Application ...... ' get available se...more >>

exporting from vision to sql server
Posted by Jose G. de Jesus Jr MCP, MCDBA at 9/19/2005 1:27:02 AM
hi all, i can import my database diagram from sql server using the data>reverse engineer feature the question is how can i send it back? -- thanks, ------------------------------------ Jose de Jesus Jr. Mcp,Mcdba Data Architect Sykes Asia (Manila philippines) MCP #2324787...more >>

Incorrect syntax near the keyword 'Insert'.
Posted by Naana via SQLMonster.com at 9/19/2005 12:00:00 AM
I'm trying to build a command that gets a linkservername but gets this error msg:Incorrect syntax near the keyword 'Insert'. Can anyone help. Thnaks. set @cmd = Insert into Job_Results Select distinct '+convert(varchar(10),@batchid)+', '+@linkservername+', substring(j...more >>

SQL Server paged recordset problem
Posted by Steve at 9/19/2005 12:00:00 AM
I have implemented the Stored Procedure "RowCount" method of controlling paged recordsets in ASP as shown in this page http://www.aspfaq.com/show.asp?id=2120. I have had to make heavy alterations to the code in order for it to work with my application. It all worked fine until I tried to...more >>

How do i can find SQL Server? Is running another server in TSQL?
Posted by Savaþ Gültekin at 9/19/2005 12:00:00 AM
I want to found another SQL Server on other machine. I know server named like SERVER2 and my stored procedure will insert any records to a table on other sql server but sometimes connection is break of. Then SP is interrupt a fatal error and don't continue. However transaction don't rollback. ...more >>

Noob count question
Posted by Seefor at 9/19/2005 12:00:00 AM
I have a table of events, which stores an event ID, event Name and event date. I want to write a stored procedure that returns the next 4 events starting from today, so far I have: SELECT [EventID], [EventName], [EventDate] FROM Events WHERE (DATEDIFF(dd, GETDATE(), Even...more >>

getting the tables names and their size
Posted by genc_ ymeri at hotmail dot com at 9/19/2005 12:00:00 AM
Hi, I would like to write a query that lists all the tables in a db and their size. I can't remember what the right join I have to make or the right sysobjects where to look at. Thank you in advance for any tip.... genc ymeri ...more >>

Application on Windows CE 3.0 and 4.2
Posted by Sathian at 9/19/2005 12:00:00 AM
Hello We have small application writtten for Palmtop/Pocket PCs in Embedded VB for Windows CE3.0 When trying to run the same on Windows CE4.2, "MS embedded Visual Basic Runtime" occured. Can someone guide us how we can tailor the application suitable for Windows CE 4.2 and in future versions...more >>


DevelopmentNow Blog