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 > december 2004 > threads for friday december 17

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

referenced row
Posted by Emre Guldogan at 12/17/2004 11:45:53 PM
Hi , i need some help . My problem is referencing a column from another tables column let say these two are my db tables . I want pro_price in Products to be taken from price in Products . Whenever price in Products is updated , pro_price in Products is updated too . How can i do ? CREATE ...more >>

Copy image BLOB from one table to another
Posted by SLP at 12/17/2004 9:36:57 PM
I need some urgent help with copying an image field from one SQL Server table to another. This is a vb.net web application with a SQL Server 2000 database. I need to be able to copy a signature, without the need to display the signature on the web page. Have been trying to do it with a sp w...more >>

exists mod???
Posted by Carlo at 12/17/2004 7:57:19 PM
hi i need the module function in SQL es mod(34-35)=1 thanks Carlo ...more >>

Security architecture
Posted by Leila at 12/17/2004 6:29:18 PM
Hi all, I want to design the security of my application. It seems that I must not use object permissions because every time the users attempts to read/modify/delete a record, he may encounter with a handled error stating that you don't have permissions to perform this task and etc. But I wa...more >>

Concurrency problems
Posted by Leila at 12/17/2004 6:00:23 PM
Hi all, Suppose that client A and client B read a record and B begins editing that. Meanwhile A attempts to delete the record. Our project's rules says that the record must not be deleted while it is being edited by other user. Whereas our clients are disconnected, client B cannot lock the recor...more >>

return values from EXEC(string)
Posted by Jo Inferis at 12/17/2004 5:36:38 PM
Firstly, apologies if this it the wrong place to ask! I have a stored procedure which builds some SQL in an nvarchar. I can, of course execute this SQL with EXEC(@mySQL), but how do I access the recordset that is returned *while still within the stored procedure*? Basically the SQL returns a...more >>

Need help writing hierarchical data query
Posted by Daks at 12/17/2004 3:48:34 PM
MyTable StudentId ClassId MergedClassId DateIn DateOut 1 101 NULL 9/3/04 12:00 AM 10/12/04 11:59 PM 1 102 101 10/12/04 12:00 AM 10/13/04 11:59 PM 1 103 102 10/14/04 12:00 AM 2 101 NULL 10/12/04 12:00 AM 10/13/04 11:59 PM 2 102 101 10/14/04 12:00 AM ...more >>

The number of the week.
Posted by Geir Holme at 12/17/2004 3:25:20 PM
Hi all. The following select returns 2 as the number of the week. I our calendar it is still week 1. Is there any settings that controls this? We have tried the Set DateFirst, but it will not make this select correct. SELECT DATEPART(ww, '2005-01-08') thank's all. -gh ...more >>



concatenate function
Posted by sg at 12/17/2004 2:49:37 PM
Hi, I like to know if there is concatenate function available in SQL script. I like to combine two columns together as a unique key. Please help. Thanks in advance and Merry Christmas Sarah ...more >>

Parameter Sniffing?
Posted by Chris White at 12/17/2004 2:44:18 PM
This is absolutely driving me crazy. I ran into a similar problem a couple of months ago and never got it resolved. That time we just lived with the extra time. Can't do that this time. DDL and Data would be hard to provide, but here some SQL broken down to just the basics of the offending co...more >>

Not allow range within range
Posted by David C at 12/17/2004 2:20:30 PM
I have an application that enters employee timesheets. The start time and end time is entered into each record and the timesheet date and this time are stored in separate fields. I need to be sure that there isn't already time entered that falls within the range of times already entered for tha...more >>

Syntax Question
Posted by Jon Westmore at 12/17/2004 2:12:06 PM
I'm trying to update a variable conditionally based on the value of another variable. I've tried a couple of different things with CASE but can't seem to get it to work. Any Suggestions? --Jon DECLARE @cen_dtime AS datetime DECLARE @cen_count AS int DECLARE @cen_shift AS int SELECT @cen...more >>

Kill mulitple batches
Posted by Greg Michalopoulos at 12/17/2004 2:00:39 PM
Is there a SQL command which will kill or exit all batches in the query analyzer? For example I have this script: query1 query2 GO query3 query4 query5 GO Is there a way so that when I check @@ERROR after query1 that query2,3,4,5 do NOT get executed? GOTO's cannot see beyond the ...more >>

IS NULL not working in WHERE clause.
Posted by Earl at 12/17/2004 1:21:04 PM
The following query returns rows where the time_id IS NOT NULL. This query seems to be breaking SQL Server(?) select bus_date, time_ordered, time_id from [vicorp\gillic].pmix_fact1 where bus_date = '2003-11-01' and time_id is null order by time_ordered The following query does...more >>

Permissions Questions
Posted by John at 12/17/2004 1:17:09 PM
I am having trouble calling a stored procedure from my vb code. I am trying to call the xp_cmdshell extended stored procedure. I was successful calling it from query analyzer, but not in any code. I realized I was logging in as myself w/query analyzer. As myself, I have system administrato...more >>

Error about log file
Posted by Ray at 12/17/2004 12:34:44 PM
Dear all, Now, I would like to insert data into one of the tables in the database. However, the error message "The log file for database 'DT_Data' is full. Back up the transaction log for the database to free up some log space." occurs. What should I do for the log file? Please help. Tha...more >>

Regarding jobs
Posted by Enric at 12/17/2004 11:41:05 AM
Hi collegues, Just a several questions: First one: How can I reckon when a task will finish? I've got the following status: 51 RUNNABLE DW-E01\Administrator nt-ES06 . GERMANY DBCC 436080 4168914 12/17 15:23:26 MS SQLEM 51 If I launch this I don't...more >>

Update Associated Recordsets
Posted by SharonInGa at 12/17/2004 11:31:07 AM
User changes the ID field from ProductID01 to ProductID5001. How do I programmatically update the associated recordset in the other tables to reflect the ID change? ...more >>

Indexes Question
Posted by Rob Meade at 12/17/2004 11:28:30 AM
Hi all, I have just read an article in the Enterprise Server magazine dated December 2004. On page 23 it recommends for optimising your database that you can set up indexes, and in addition keep these on a seperate disc to the database... I have not used indexes in the past, but having ...more >>

check for cascade relationship
Posted by SharonInGa at 12/17/2004 11:25:02 AM
How can you get the application to check for a cacasding relationship when a user attempts to delete a record from the parent table? 1. User attempts to delete a customer record from the main table 2. The parent record has five records in the order table. 3. Insert a message that says "No,...more >>

expanding a stored proc that is already beyond me
Posted by djc at 12/17/2004 11:13:24 AM
I need to expand this stored procedure which is already beyond my current tsql skill level... which is pretty darn low. hehe. I'm working on my first project that utilized stored procedures... The one below is actually the first one I had to create. I use the following stored procedure to bind da...more >>

Updating a partitioned view from a select
Posted by DWalker at 12/17/2004 11:00:02 AM
I'm trying to update a partitioned view, updating all the records in the view from a staging table -- updating the records from the staging table that don't exist in the view already. The view is updatable -- I know the rules, and I can open the view in EM and actually change the data in t...more >>

Is there a cleaner way to do this?
Posted by Jeff Metcalf at 12/17/2004 10:53:02 AM
Declare curr_notify cursor for select RTRIM(SERVICEEMAIL)+';'+RTRIM(OTHEREMAIL) AS Email, 'Call number'+' '+RTrim(callnbr) as subject, 'Call number'+' '+RTrim(callnbr)+' '+'for'+' '+ RTRIM(custnmbr)+' at '+RTRIM(adrscode)+', '+RTRIM(svcdescr)+', '+' has had the status changed to '+RTRIM(ST...more >>

Any possible way I can achieve the following (coalesce maybe)
Posted by Weston Weems at 12/17/2004 10:07:49 AM
I am working with an existing billing situation where changes to accounts are posted in a "journal" with the change and effective date. I need to select a record for each account between two dates... which I can achieve with this: "..WHERE effective BETWEEN date1 and date2.." Thats ea...more >>

Sort order in result of join two tables
Posted by Imre Ament at 12/17/2004 10:07:05 AM
Hi! Can I manage what table give the sort order of rows what are results of two joined table. Exists a hint, clause or command what able to select the wanted table? Regards, Imre ...more >>

Regarding jobs
Posted by Enric at 12/17/2004 10:07:01 AM
Hi collegues, Just a several questions: First one: How can I reckon when a task will finish? I've got the following status: 51 RUNNABLE DW-E01\Administrator nt-ES06 . GERMANY DBCC 436080 4168914 12/17 15:23:26 MS SQLEM 51 If I launch this I don't...more >>

Error When calling stored procedure
Posted by John at 12/17/2004 9:57:06 AM
I haven't received any real hits on this when I have been searching online. Does anyone know what the following runtime error means. I am running it from vb6. I assume this is an sql thing and not really a vb thing. The request for procedure 'xp_cmdshell' failed because 'xp_cmdshell' is a ...more >>

pls help! - displaying result of 2 str proc. in 1 tbl
Posted by Angel at 12/17/2004 9:45:03 AM
Please help!! I have two stored procedures and I want to merge the result of both table in one based on the month , for example: Stored_proc_1 displays: Month | SaleTotal 1 | 100.00 2 | 200.00 3 | 300.00 ----------------------------- and Stored_proc_2 displays: Month...more >>

Moving SQL Log to another Directory
Posted by Lontae Jones at 12/17/2004 9:39:02 AM
Can I move the .ldf from my E: Drive which has 200 mb left to my F: drive that has 18 GB free? If so How and there any issues. ...more >>

Enterprise Manager Settings
Posted by Mark at 12/17/2004 9:09:04 AM
Is there any way to copy Enterprise Manager Settings from one machine to another machine. I need to do it on 4-5 machines and it is kind of a pain to do it manually. Thanks in advance. ...more >>

Newbie: Select Syntax
Posted by Paul at 12/17/2004 8:54:33 AM
Hi all. newbie here, The value in the database Field is "Car" The String being submitted is "CarModel" Is there anyway that if I search using "CarModel" that Car would be returned SELECT * FROM VehicleDetails WHERE Vehicle like 'MMColVehicle' AND Manufacturer = 'MMColManufacturer' AND M...more >>

Calculating the Mode with multiple group bys
Posted by Job at 12/17/2004 8:49:04 AM
I'm new at this so hopefully someone can help. I've seen a few examples but I can't get the correct result to return. Here is what I have. But it doesn't quite work...Somewhere I'm dropping the Contracts SELECT p.Contract , MIN( p.MNTRVU ) AS CommonTRVU, p.Div_Cat FROM ( SELECT p1...more >>

Importing from a spreadsheet.
Posted by Chris at 12/17/2004 8:37:06 AM
Hello, I am a bit of SQL server rookie. I currently have a spredsheet with data that I want to import into my database. The data will need to be transformed in somewhat of a complex way, splitting it up into different tables. The way I envisioned the process was: 1. Import spreadshe...more >>

DTS Wizard
Posted by JoeDz at 12/17/2004 8:29:01 AM
I am new to sql server & DTS; I would like to accomplish the following: table A has 3 columns ( id, priority, name ) I need to extract all priority 1 records, checking every 2 minutes. I would like to only extract those that have been inserted since the last check. 1) select current_max...more >>

xp_cmdshell question
Posted by John at 12/17/2004 7:53:02 AM
Is this an undocumented stored procedure? I can run it, but it doesn't show up in enterprise manager with the other stored procedures. Am I doing something wrong? Thanks...more >>

Update View query in Stored Procedure
Posted by Mike at 12/17/2004 7:21:03 AM
Hi I am trying to update a partitioned view within a stored Procedure. When I run the update statement manually it suceeds without any problems, however when I try and call the stored Procedure, I get a message saying that the view is not updateable because it references a table in the defi...more >>

Newbie: CAST Question
Posted by MrMike at 12/17/2004 7:15:01 AM
Hi. I have a table column as follows... Name - Footage DataType - Decimal Scale - 6 Although the scale is 6, I need to select only 3 digits to the right of the decimal. I'm trying to use the following CAST statement but this does not work. How can I select 3 spaces to the r...more >>

advice on best way to select
Posted by Kurt Schroeder at 12/17/2004 7:11:04 AM
I need to return the most current entry from a table. I'm not sure what would be the most efficent way to do this: here is my query: select top 1 crtRow,crtCol, crtChr, crtType,crtBrR, crtseq,crtDate from crt where crtcsiID = 1003 order by crtDate DESC I guess i'd like to know if there is...more >>

1 SP -- 2 SQL Servers
Posted by j1c at 12/17/2004 6:41:09 AM
What do I need to do to allow 1 stored proc to perform an isnert/update/select on 2 physically different servers? Same domain, same LAN. ...more >>

Trigger - How To
Posted by aplatfl at 12/17/2004 6:36:20 AM
I created a trigger (for Insert, Update) to calculate two columns in a table and insert the result into another column in the same table (checks/balances). The trigger I created works on each insert and update but does not fire when I update multiple rows. How to write the query to catch m...more >>

UNION & JOIN
Posted by Deepson Thomas at 12/17/2004 5:29:02 AM
Hi, can anybody tell me the perfect situation where we have to use UNION instead of join. i will be really thankful if i get a small discription abt the main difference between these two. thanks in advance -- Deepson Thomas...more >>

TRUNCATE and DELETE
Posted by Deepson Thomas at 12/17/2004 4:25:01 AM
Hi i was reading a small note written abt the difference between delete and truncate in sql. I have some doubts in that 1) "The DELETE statement removes rows one at a time and records an entry in the transaction log for each deleted row. TRUNCATE TABLE removes the data by deallocating the ...more >>

Update all similar records
Posted by Guy Brom at 12/17/2004 4:08:05 AM
Hi all, I have this table: pid [int], ptitle [varchar], pdup [bit] There are some duplicate ptitle records which I don't want to delete. Rather - I want to update their pdup with 1 for all duplicate records, but 1 (any one). So in the end I'm left with only 1 ptitle that does not have a ...more >>

Basic Question
Posted by babz at 12/17/2004 2:39:02 AM
Hi Is the foreign keys automatically create index or we need to create index on the foreign keys also. ...more >>

Unknown token received from SQL Server when using FOR XML
Posted by Gas at 12/17/2004 1:33:02 AM
Hi, I've got a problem with a stored proc using the FOR XML AUTO, ELEMENTS clause. It's returning the following message: [Microsoft][ODBC SQL Server Driver]Unknown token received from SQL Server However, when I run the select statement in the proc, it returns the XML string ok. Any ...more >>


DevelopmentNow Blog