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 2005 > threads for tuesday april 5

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

What does SET NO_BROWSETABLE OFF do?
Posted by Scott at 4/5/2005 11:59:01 PM
I have spent some time writing a complex stored procedure for use in a Crystal Report. My app uses Crystal as supplied with VS.NET 2003. The SP accesses about 6 tables, several OUTER JOINs, a WHERE BETWEEN clause on a datetime column, and a GROUP BY to SUM severals columns from about 100,000...more >>


Metadata Detail
Posted by AM at 4/5/2005 11:23:10 PM
Hi all I want to get some metadata information for my tables Some column properties I can get using System tabes and Information Schema but I can not get some information as below I want to get information of column properties Identity Seed, Identity Increment, Is Rowguid , Formula...more >>

A SOLUTION FOR THAT QUERY
Posted by Frank Dulk at 4/5/2005 9:58:10 PM
It follows the following query below: Select rel_30.cpf, rel_30.cliente, rel_30.enderecoentrega from rel_30 where (((rel_30.enderecoentrega)In (Select FROM [enderecoentrega] FROM [Rel_30] As Tmp GROUP BY [enderecoentrega]HAVING Count(enderecoentrega)>2))); * Of the way that is brings the f...more >>

How to Select a column by its ordinal number?
Posted by jm at 4/5/2005 9:36:23 PM
Is there a way to select a column by it number as appose to its name? I am importing a large flat .csv file that doesn't have column names and I like to select and name a few of the columns. Thanks for you help jm ...more >>

Scheduling a java process
Posted by Rizwan at 4/5/2005 9:17:11 PM
This question is more of a java question than a SQL Server question. But still... I am working in java; application server is Jboss and database is MS SQL Server 2000. I have a process written as an EJB in java. I want to schedule this proces to run every hour every day. I was thinking abou...more >>

Restored Database User Issue
Posted by Lontae Jones at 4/5/2005 9:07:01 PM
I restored a SQl database from one server to another and everything was exact from one server to another besides the users. I had 2 users that would not update correctly. I have tried to drop and recreate and had errors. Any tips on getting users from one database to another? TIA...more >>

Assign multiple values using CASE in a Select Statement
Posted by rgn at 4/5/2005 8:07:52 PM
Hello All, I have a need to assign the values of the three variables in one select statement. Currently, this is done using three different Select statements : Select @Male = SMnemonic from sex where SName = 'Male' Select @Female = SMnemonic from sex where SName = 'Female' Select @Unknown...more >>

Stopping Transaction Process
Posted by Roy Goldhammer at 4/5/2005 7:50:55 PM
Hello there Someone has open transaction in one of my database How can i stop it? -- øåòé âåìãäîø roy@atidsm.co.il ôìà' 050-7709399 ...more >>



accessing stored procedure
Posted by Vince
Hi there! I 've defined a sp while I was logged as 'sa' into query analyser...well, I defined this sp with a specific owner, I mean: create proc myowner.myproc....Etc... once defined, I can invoke this sp from query analyser, no pb..(exec myowner.myproc...) But, when I log into dat...more >>

IF UPDATE
Posted by Chris at 4/5/2005 5:59:56 PM
I created an IF UPDATE statement in a trigger which I though was working fine, until I worked out that is fires even if the actual value has not changed. E.g. I created an UPDATE statement that sets the values of three columns. One of these columns is the column I am checking for in the IF ...more >>

create table from another table
Posted by don at 4/5/2005 5:47:03 PM
In oracle i can do a 'create table xyz as select * from abc'. How do i accomplish this with sqlserver? -- Don ...more >>

Select question
Posted by simon at 4/5/2005 5:45:42 PM
I have table A with column cone varchar(10) and table B with column cone varchar(10) I would like to get all cone from table A which are good for all records. for example: 1.tableA: id cone ----------------- A1 AB (that means there is cone A and cone B) A2 ...more >>

Dependent Objects
Posted by Shimon Sim at 4/5/2005 5:22:26 PM
I am trying to find all the objects - SP, triggers, Views that depend on some Table. I was trying to use sysdepends table but it seems to me that it doesn't return all the dependent objects. It misses obvious Update and Insert SP for this table. Is there a reliable way to find dependent ...more >>

permissions problem
Posted by Random at 4/5/2005 5:06:57 PM
I have what I'm sure is a simple problem with setting permissions on some objects. Here's the situation... I have one database (Central) that I want to allow inserts to a table (Queue) on via a stored procedure. That stored procedure I am storing in the master database so that any of the oth...more >>

Minutes since midnight
Posted by John Baima at 4/5/2005 4:57:10 PM
I would like to know the number of minutes past midnight for the system date. Is that possible? -John...more >>

Help with SQL SELECT Statement Syntax
Posted by WB at 4/5/2005 4:29:12 PM
I have a Transaction table with CustomerId, Transactionid, TransactionDate as the relevant fields. I want to create a query that selects the most recent transaction for each customer. I can create the syntax with ORDER BY CustomerId ASC, TransactionId DESC but that doesn't return a single rec...more >>

SP Analysis
Posted by DMP at 4/5/2005 4:21:01 PM
Hi, How can I fine tune of my Stored Procedure ? How 'Show Execution Plan ' helps for the above purpose ? Thanks, ...more >>

Problem working around a process quirk
Posted by Rumbledor at 4/5/2005 4:18:47 PM
Hello. I work for a managed care organization. I am currently dealing with a process which compensates practices for seeing members. A "contact point" is awarded to a practice for treating a member. That practice can only receive one contact point for a particular patient within the specifie...more >>

Using INNER JOIN and LEFT statement
Posted by JD at 4/5/2005 4:16:26 PM
Hello Everyone, I am running a query on my client's production server and I have an inner join where I link up zipcodes to my customer codes, but I only want to work with 5 digit zip codes. So my query is as follows: SELECT ac.[Cust Code],ac.[Store Code],ac.[Store Add1],ISNULL(ac.[Store ...more >>

Using like in "select in"
Posted by Sergey at 4/5/2005 4:03:48 PM
Hi, I have 2 tables: Table A (FieldX varchar 30) and TableB (FieldY varchar 30) I want to create view like that: Select FieldX from TableA where "FieldX value" contain "FieldY value" (like %FieldY%) ****************************************************************** Simple data sets: F...more >>

Master Database and Stored Procedures
Posted by BB at 4/5/2005 4:01:16 PM
Hi, I have a set of stored procedures that are used in several databases. I do not want to maintain the procedures in each database. I'm considering placing these in master so that I can manage a single version. However, I would rather not modify master if it is not necessary. Is it pos...more >>

I need help...!
Posted by James T. at 4/5/2005 3:57:39 PM
Hello! I am using IN to determine if a given StateId values matches any value in a query. Previously, I used following query: SELECT * FROM Cities WHERE StateId IN (1, 2, 3) but now I would like to pass dynamic values as a input parameter... SELECT * FROM Cities WHERE StateId IN(@St...more >>

Error when writing to a #temp table
Posted by Larry at 4/5/2005 3:55:02 PM
Hi Everyone, I've got a temp table that has just 2 columns as shown below: EXEC ( ' Create table ' + @Table + ' ( Location_ID INT, Site_Alias_Name VARCHAR(255) )' ) Problem: I'm getting the error message below when I execute the procedure. I've tried specif...more >>

index on joined columns
Posted by RayAll at 4/5/2005 3:54:18 PM
I have and joined between two tables like this: ........TB1 join TB2 on TB1.col1=TB2.col3 and TB1 .clo2=TB2.Col4 There a lot of records in TB2 ,so I wondered to make an index on Col3 and Col4 of TB2.Now my question is that according to the join above it's better to have a compound index...more >>

Why does this deadlock?
Posted by Luke Stevens at 4/5/2005 3:49:02 PM
I have two transactions with serializable isolation going and I hit a deadlock, but I don't understand why. Can someone explain? Transaction 1: insert into MyTable (Name) values ('TestA'); [Transaction 2 begins and executes here] insert into MyTable (Name) values ('TestB'); Transaction 2:...more >>

why do I need to defrag index
Posted by SQL Apprentice at 4/5/2005 3:42:46 PM
Hi, I have a 1.1 TB database that has constant insert and update transaction in a 24/7 work place. What are the benefits of running DBCC INDEXDEFRAG and DBCC DBREINDEX? Do I need to run defrag for all my dbs? and when should I run it in a 24/7 work place? Thanks a bunch. ...more >>

Filter by months & days without years
Posted by CASystems at 4/5/2005 3:01:04 PM
I have an application that holds BirthDates. Is there a way to query for all birthdates between two dates without considering the year ? Like: Between "April 1" and Dec 10". I know who to query between two dates, but it considers the year. -- CASystems...more >>

sql server limit
Posted by Aaron at 4/5/2005 2:56:07 PM
Will the number of columns affect performance? my table will have around 20-30 columns and what are MS SQL Server 2000's limits on columns and rows? ...more >>

how do I create multiple selects if the preceeding value is NULL
Posted by Mark - HIS at 4/5/2005 2:47:06 PM
Help! I am trying to create a query that will perform 'Fallback' queries if the preceeding value is NULL. and then change the result to display fixed text (like using the CASE statement) eg: The first select is select name from guest where room='123' and status='I' If there are no names foun...more >>

Pass parameter into a view
Posted by moondaddy at 4/5/2005 2:02:32 PM
Is there any way to pass a parameter into a view? I'm working with sql 2k. Thanks. -- moondaddy@nospam.nospam ...more >>

sql scrript for editing the bytes in an image field
Posted by Stephanie at 4/5/2005 2:02:05 PM
I have a table with a field of data type "image." In version X of our software, the data stored in this field was a bitmap plus a bunch of other bytes that the little editor program we used adds to the bitmap. Before display, our application stripped the wrapper bytes. In version X+1, we have a ...more >>

Shrinking File
Posted by Daniel Caetano at 4/5/2005 1:53:26 PM
I have restorded a database and his size is 1gb.(940mb datafile and 60mb logfile). Data is really occupying only 10 mb of datafile e 4mb of logfile. I´ve been trying to shrink the datafile(primary) as smaller that possible , but it havin´t been worked it !! THE dbcc shriking file doesn´t de...more >>

system stored procedures and security
Posted by Stephen Ahn at 4/5/2005 1:12:08 PM
One of our clients sites has limited the rights with our application's database user so that it does not have access to execute system stored procedures. eg. during our automated database upgrade process, our application's SQL Server user does not have access to execute sp_refreshview. ...more >>

XML as output from SQL server
Posted by Tor Inge Rislaa at 4/5/2005 12:52:25 PM
Hi, is there a way that SQL server could present output data as XML according to the following syntax <?xml version="1.0" encoding="UTF-8"?> <messages> <note id="p501"> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> ...more >>

cursor and insert table
Posted by Chris at 4/5/2005 12:41:06 PM
Hello. I have a newbie question. Does anyone know where I can find an example of the syntax used where a cursor is employeed to insert records into a table? Any tips or suggestions are appreciated. Thank you, Chris...more >>

conver datetime to age... new
Posted by chad at 4/5/2005 12:27:03 PM
using the following query.. SELECT userid as UserID, Age=datediff(year,Birthdate,getdate()) FROM UserProfile WHERE UserProfile.Birthdate IS NOT NULL AND datediff(year,Birthdate,getdate())>=0 order by UserID the converts the table userid birthdate 2 1985-03-...more >>

aggregate function in the argument to another aggregate function
Posted by CG at 4/5/2005 12:23:45 PM
Hello all, I am new to SQL Reporting services and I am having trouble performing a group sum. I Currently have a group within another group the embedded group (group2) is performing a group sum (=3DCount(Fields!FacilityTemp1.V=ACalue/Fields!Temp2.Value) and this works fine but now I would lik...more >>

Row count mismatch
Posted by sean sobey at 4/5/2005 11:31:55 AM
Hello! When I double click on a table in EM I get 536929 rows. When I do a select count(*) in the QA, I get 537054 rows. A difference of 125. Why do I get two different row counts for the same table from two different sources? Baffled, Sean ...more >>

Outer Join woes
Posted by John Beatty at 4/5/2005 11:21:59 AM
/* Hi - Is there a better way to get the desired results? Thanks, John -- contents T1 C1 C2 A ----------- ----------- ----------- 1 1 100 1 2 100 -- contents T2 C1 C2 B ----------- ----------- ----------...more >>

Detect if rows have changed
Posted by Terri at 4/5/2005 11:20:54 AM
I want to build some pseudo-update-trigger code that will tell me if the a row in an Access database has changed. My overall strategy is do successive imports into SQL Server, join the tables and compare the rows. Is there a reliable way to determine if a row has changed? I'd like to design a jo...more >>

Sort Order Syntax Help
Posted by Dawn Coelin at 4/5/2005 11:17:27 AM
DECLARE @ColumnName varchar(50), @SortOrd varchar(50) SET @ColumnName = 'Job_Status' SET @SortOrd = 'DESC' SELECT tblWorkOrders.ID AS WOID, tblWO_JS.strJSID AS Job_Status, CONVERT(CHAR(10), tblWorkOrders.dtScheduled,101) AS Sched_Date, tblStores.strCHID AS Customer, tblStores.strSI...more >>

Executing SQL held in a Text column
Posted by sugnaboris NO[at]SPAM gmail.com at 4/5/2005 10:57:41 AM
Hope someone can give me advice on a problem I'm having with my current development. I need to build up very long pieces of SQL, then execute them. The SQL itself is dependent on the structure of the data in 2 other DBs. I was using varchar(8000) fields to accumulate the dynamic SQL, as I didn...more >>

Stored Procedure not seeing parameters
Posted by tshad at 4/5/2005 10:54:13 AM
I have a stored procedure that came from another stored procedure that worked fine. This one gives me an error: Procedure 'GetCityNames' expects parameter '@StateCode', which was not supplied. The problem is that it is: exec sp_executesql N'Exec GetCityNames', N'@StateCode char(2),@C...more >>

copy an object in the procedure
Posted by toosie at 4/5/2005 10:52:39 AM
Hi. Is there any simple way to copy an object ( table,view, procedure) and write it with another name or different owner. A new object should have the same CONSTRAINTS, IDENTITY column etc.. For tables I've tried to create a new table and later add columns or change data type with ALTER, but th...more >>

Compatibility between SQL2000 and SQL2005
Posted by Kay-Christian Hansen at 4/5/2005 10:52:25 AM
Will my old applications with standard T-SQL code work againt the new SQL2005 without modifications ? Kay ...more >>

bulk insert syntax error
Posted by Vince
Hi there !! I try to bulk insert a table like this: bulk insert mytable from 'c:\mysrcfile.csv' with ( formatfile = 'c:\temp\bcp5.fmt', firstrow = 2 ) and I always get : Server: Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'from'. I try the same thi...more >>

Sql Error Enumerations for .NET
Posted by Andrew Robinson at 4/5/2005 10:38:16 AM
I am successfully trapping SQL error exceptions when making updates using ADO.NET, but are there standard error number / code enumerations for SQL that are accessible via .NET? I want to handle certain errors such as 2627 (Violation of Unique Key Constraint), but would want to pass others on to ...more >>

Database Migration
Posted by Shahriar at 4/5/2005 10:37:08 AM
Need advice on how to best achieve migrating a 20 GB database to a new server without any downtime. Would Backup+Differential Backup+transaction log backup up a solution ? Is replication the way to go? Any advice would be appretiated. Many thanks in advance Shahriar...more >>

Proper case of a field
Posted by Asim at 4/5/2005 10:33:07 AM
Is there a way which helps to standerdize the case of a field e.g. I have a field called location name which is sometimes all in caps or in lower cases, I need to format it to be like CAMBRDIGE becomes Cambridge and etc Thanks ...more >>

Newbie: Help with basic SQL
Posted by steve at 4/5/2005 10:09:29 AM
Hello, I dont know wether I have spreadsheet-ditis but I just can`t figure out a way to do the following: - Two tables , linked via a StationID. One tblAQMeasurements has air-quality measurements for various pollutants (ozone, mercury , etc.) datetime | StationID | PolutantCode | va...more >>

What is the solution for error 8629: The query processor could not produce a query plan from the optimizer because a query cannot update a text, ntext
Posted by Nadim Wakim at 4/5/2005 10:09:29 AM
what can we do when we face error 8629 in Sql Server: The query processor could not produce a query plan from the optimizer because a query cannot update a text, ntext, or image column and a clustering key at the same time. ...more >>

finding bad date
Posted by Emma at 4/5/2005 10:05:02 AM
I have a database where a varchar field is being used to store dates. I wrote the following function to check if the data is a valid date. If it is not a valid date, Null is returned. ALTER function f_ToDate(@inDate varchar(50)) returns datetime begin declare @returndate datetime if...more >>

Finding numerics
Posted by rodchar at 4/5/2005 9:59:03 AM
Hey all, i have a text field with values like: abc123 abcd12 ab1234 how would i move the numeric values to a new field in the database? thanks, rodchar...more >>

Web hosting and SQL Server Enterprise Manager?
Posted by John at 4/5/2005 9:53:27 AM
Do you guys have any idea if web hosting companies usually give access to SQL Server databases through Enterprise Manager? I used to have have access to my DB through EE with my previous provider and now the more I am looking into offers on the net the less I can see this feature specified. ...more >>

primary filegroup is full?
Posted by Rafael Chemtob at 4/5/2005 9:50:21 AM
Hi, I'm trying to use DTS to import a text file into a table and I get an error saying that space cannot be allocated for the file because the primary filegroup is full. Any ideas how to extend the primary filegroup? thanks ...more >>

Case statement Error
Posted by John Smith at 4/5/2005 9:26:01 AM
Hi, I don't know what i am doing wrong here, I am always getting this error Server: Msg 170, Level 15, State 1, Line 3 Line 3: Incorrect syntax near '>'. When I am running the following query SELECT title, price, Budget = CASE price WHEN price > 20.00 THEN 'Expensive' ...more >>

update text field in trigger
Posted by sql at 4/5/2005 9:12:53 AM
Hi all, Is it possible to update a text field of a table in an instead of trigger or after trigger? Thanks. -Nikhil ...more >>

Index
Posted by HP at 4/5/2005 8:49:04 AM
Should a clustered index be created on a unique field or non-unique field?...more >>

Stored Procedure - Bypass Linked Server Error and Continue process
Posted by Jay Kusch at 4/5/2005 8:37:05 AM
Have an SP where I create dynamic SQL statements, based on a table var that contains the linked server name, to pull fields across from the linked server. Works great as long as I have a good connection. Is there a way to trap for the "SQL Server does not exist or access denied" issue so th...more >>

Oracle vs Sql Server
Posted by Enric at 4/5/2005 8:27:04 AM
Dear fellows, I was wondering how many capabilities, features and advantages, powerful and so on have got more ORACLE at the front if you compares it with RDBMS Microsoft? Best regards, ...more >>

Concatenating strings
Posted by mike at 4/5/2005 8:11:21 AM
I have a table with seven different descriptor fields, and at times it's necessary to concatenate all seven into a single field in a query. I tried simply concatenating the fields together, but if a single input field has a null the output is a null. It does this even though the concat_null_...more >>

Conditional statements in Views
Posted by -Ldwater at 4/5/2005 7:43:33 AM
Hi all, Another interesting question for ya :P When contructing a view, I hit across a field that internally is stored as a single charactor to represent a status, like 'P' = Pending, 'C' = cancelled etc. Now, when I create a view, I want this view to say the full word 'Pending' or 'C...more >>

Best book for relational db's?
Posted by Guerrilla_Coder at 4/5/2005 7:34:27 AM
Greetings, I'm reentering SQLServer-land after an absense. I've forgotten most of my school-taught relational/OO database design theory. Normalization is still in the old memory banks, but it too is fading fast. :) Can anyone recommend a good book on relational design that can refresh my ski...more >>

Development Examples for SQL Server 2000
Posted by Marcel K, MCDBA at 4/5/2005 6:49:05 AM
Can you point me in direction of Applicaiton examples for SQL Server 2000? Thanks in Advance, Marcel K, MCDBA...more >>

How to carry forward inventory balances
Posted by karenmiddleol NO[at]SPAM yahoo.com at 4/5/2005 6:04:05 AM
I have data stored in a table in the following format. Product# Month Year Inventory Balance For example the inventory balances for a Product A exists in the table as follows: Month Qty on Hand ======= =========== 001.2004 120 004.2004 235 0...more >>

query difficulties
Posted by help at 4/5/2005 5:37:36 AM
Hello All, I hope you can help with this. I have next kind of data in the database(80000 rows) and I want to drop out the min and max values. day number prod quantity monday 411 12004 545 monday 411 12004 776 monday 411 12004 345 monday 411 ...more >>

automated change config notifications
Posted by SQLcat at 4/5/2005 5:23:03 AM
There is a company, Idera http://idera.com/Products/SQLconfig/ that produces a product called SQLconfig. Among other things, it monitors database server hardware, operating system (OS), SQL Server instance and database configuration, providing both automated change notification and comprehens...more >>

db design question
Posted by Aaron at 4/5/2005 3:36:11 AM
One united table with all the records? all the fields are same type (text) * represents non-null value UnifiedTable |DataA|DataB|DataC|DataD|DataE|Cat| * * * 1 * * * 2 or is it better to...more >>

Basic SQL Query Question....
Posted by Tim::.. at 4/5/2005 1:47:02 AM
Can someone please tell me how I do the following... I have a variable @Date which is a year... EG: 2005 what I want to be able to do is return all the records found in a table which match the @Date variable! E.G: IF @Date = 2005 All the records added to the database which match the ye...more >>

Dataset Select
Posted by Itzik at 4/5/2005 12:00:00 AM
Hi i using C# language i have Dataset (ds) and added 2 tables "Customers" and "Orders" Customers columns : CustomerID, CustomerName Orders columns : OrderID, CustomerID can i select data from both tables "Customers" and "Orders" i need datatabe with 2 columns : CustomerID , Or...more >>


DevelopmentNow Blog