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 > october 2007 > threads for wednesday october 24

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

insert convertion question
Posted by Andy at 10/24/2007 8:14:49 PM
Hi, I noticed that if I do insert into table (num, name) values ('1', 'john') the result is the same as (1,'name') where num is int field and name is varchar(50) So does sql server convert string value to number if it can? And last question, how with datetime field, how to set default valu...more >>

Dynamic Time Query
Posted by ibcarolek at 10/24/2007 7:25:35 PM
I know there's someone who knows the answer to this question, but I can't seem to figure it out - forgive me! I want to query SQL Server and set up a query so that yesterday is always returned. SELECT AL1.TDate, SUM ( AL1.NBR ) FROM dbo.Table AL1 WHERE AL1.TDate = _____________? How do ...more >>

CHARINDEX() equivalent function for data type 'TEXT'
Posted by shil at 10/24/2007 7:17:02 PM
Hi every one, Is there a way to search for a particular character in the TEXT data type of SQL 2005. I have tried CHARINDEX() function but it was said this function doesn't work for TEXT or NTEXT data types. The data I have in the TEXT field I'm searching for is really huge. Thanks in advan...more >>

HELP! I can't access my databases.
Posted by Sandy at 10/24/2007 5:52:01 PM
Hello - I am getting a message to the effect that my evaluation copy of Sql Server 2005 has expired. A few months ago (probably more than 180 days), I installed an evaluation Enterprise Edition copy that came with Microsoft's book. I have a real registered copy of the Standard Edition i...more >>

Can you Query Jobs
Posted by Bob at 10/24/2007 5:44:19 PM
Is it possible to query Jobs for Step Number and Step Name? tia Bob....more >>

Literal N for Unicode data
Posted by QDL at 10/24/2007 5:35:11 PM
Hello everyone, i have a quite large application that has shown some problems when dealing with Unicode chars. I have learnt (as I didn't know) that I should always use the N operator before strings in order to use the Unicode characters in INSERTs, UPDATEs and SELECTs. Like: INSERT I...more >>

Sequential GUID
Posted by shapper at 10/24/2007 4:58:13 PM
Hello, What is a sequential Guid in SQL 2005. I am using the following code to create a table: -- Users ... create table dbo.Users ( UserID uniqueidentifier not null constraint PK_User primary key clustered, [Name] nvarchar(200) not null, Email nvarchar(200) null, UpdatedDate d...more >>

How to do a join on two fields?
Posted by zwieback89 via SQLMonster.com at 10/24/2007 4:58:08 PM
Hi, Current SQL Server 2000 database is going to stop getting its feed from an earlier Java web based application and will instead information from Oracle HRMS. In the old database EU, there is a field called LawsonID, ADUserName In the new databaseEUHRMS, there is a field called LegacyID...more >>



compare same table in 2 diff servers
Posted by TG at 10/24/2007 3:23:21 PM
Hi! I have sql 2000 and sql2005 in 2 diff boxes. I want to compare 2 temp tables created in each of them. I tried the following: select * from server1.dbname1.dbo.temp_table1 where hashcode not in (select hashcode from server2.dbname2.dbo.temp_table2) I am getting the error M...more >>

Updating records in CRM 3.0 through SQL
Posted by GrizzSpitter NO[at]SPAM gmail.com at 10/24/2007 3:06:12 PM
I'm trying to match contacts and accounts in SQL for an import in CRM 3.0 but I keep running into msg 512 errors. I have placed a new column on both the accountbase and contactbase tables that have the address line 1 that I was going to use to match the contacts and accounts. Here is an example ...more >>

Find most commonly occurring value in INT column
Posted by Karch at 10/24/2007 2:39:11 PM
How would I find the most commonly occurring value in an integer column? ...more >>

Project Server 2007 Report Pack
Posted by greg at 10/24/2007 2:38:15 PM
Hello, I am trying to follow the "Project Server 2007 Report Pack" demo. In the project data source.rds. In the project properties. there is a target server URL. with http://epm2007demo:90/reportserver I am guessing I change this to <my server>reportserver? Do I have to create a new web site ...more >>

Subquery with invalid column name runs
Posted by Anne at 10/24/2007 1:51:05 PM
Hello! Here is the statement in question: --STATEMENT A SELECT * FROM dbo.myTable WHERE colX in (SELECT colX FROM dbo.sourceTable) The problem with Statement A is that 'colX' does not exist in 'dbo.sourceTable'. It does, however, certainly exist in 'dbo.myTable'. Breaking the sta...more >>

Need help finding bearing between two points (Lat1,Lon1 to Lat2, l
Posted by JC at 10/24/2007 12:55:03 PM
Hi, I have been struggling for a couple of days to write the correct SQL 2005 query to find the bearing (based on 360 degrees, 0-N,90-E,180-S, 270-W) between two points given as Lat1 Lon1 to Lat2 Lon2. Below is the Excel formula. =(MOD(ATAN2(COS((LAT1*PI()/180))*SIN((LAT2*PI()/180))-SIN...more >>

SQL Server Management Studio Express and Job Scheduling
Posted by John at 10/24/2007 11:48:01 AM
I am currently using SQL Server Management Studio Express and want to schedule a job. Is this possible? Thanks....more >>

Recursion with SQL Server 2000
Posted by hardieca NO[at]SPAM hotmail.com at 10/24/2007 10:43:07 AM
Hi, I have a table with a recursive relationship: Sections ======= id - primary key parentID - Foreign key name A section can be a parent to another section. What I need to do is return a recordset containing all the descendant sections of a given section. Is there a way to do this...more >>

Open Query using a sub query
Posted by Eric at 10/24/2007 9:20:02 AM
This is a simplifed query but the one I actually need to incorporate contains multiple subqueries which I then reference in my select statement. How do I acheive this as the following produces an error. select sub1.company_name from OPENQUERY ( LinkedServer, '(SELECT TOP 1 * FROM ...more >>

Snapshot isolation level now working as expected
Posted by Sputnik at 10/24/2007 8:50:22 AM
I have two tables (that are related) in a database where the isolation level is READ COMMITTED SNAPSHOT. As I understand it the SNAPSHOT isolation level does row versioning and when a row is finally updated it updates that row successfully provided no other transaction has modified that row in...more >>

Change Trigger Order?
Posted by garyh at 10/24/2007 8:45:02 AM
I've added an INSERT trigger (to send an email) and am having problems with other triggers. My sense is that if we moved the trigger to run after all other triggers, we wouldn't have this issue. How can I move the trigger to run after all other triggers have run? Thanks. G...more >>

blank line in xp_sendmail message
Posted by pedestrian via SQLMonster.com at 10/24/2007 7:40:34 AM
I created a stored proc to send mail. The mail content is a NVARCHAR(2000) data type variable. The value is build based on certain criteria I would like to leave some lines for my mail content (for readability purpose) using the SET statement. How could I do that? Thanks! -- Regards, ...more >>

inserting data from another table -- Dynamic type casting?
Posted by Pete at 10/24/2007 7:20:18 AM
Hi all, I have a question reguarding if type casting is now transparent in MS SQL 2005 when inserting data. Below I describe the scenario at hand. ** 1. Consider the following two tables CREATE TABLE [dbo].[test_varchar]( [name] [varchar](50) NULL, [age] [varchar](50) NULL, [numbe...more >>

Dataset - Add row with Guid as PK
Posted by Frank Goris at 10/24/2007 6:53:03 AM
Hi, (Using Visual Studio 2005 and Sql server 2005.) I have a sql server employee table with a uniqueidentifier (rowguidcol) as PK. The default value for this column is (newid()). Here's the create table script (not all fields included): CREATE TABLE [dbo].[Employee] ([EmployeeId] [uniqueid...more >>

PIVOT to combine rows
Posted by INTP56 at 10/24/2007 6:27:08 AM
I did a thread search, and while there are many threads that have these words, they didn't seem to address my question. Basically, I have data coming in from an instrument in 4 columns; a timestamp, a group, a tag and a value. (I'll post the DDL at the end) I want to create a procedure that...more >>

Locking Problem
Posted by Bob at 10/24/2007 3:51:02 AM
I need to do an UPDATE on two very large tables, 20+ million rows. I need to check the tables to see if any old values exist, then update the table. I'm using normal READ COMMITTED isolation with TABLOCKX, to avoid lock escalation, but, can anyone see any problems with this: IF EXISTS ( ...more >>

Information_Schema
Posted by Jaco at 10/24/2007 2:56:03 AM
Hi, Is there a way to list all computed columns from a specified table by use of Information_schema and not syscolumns? Many Thanks, Jaco...more >>

Performance problems in an implicit transaction
Posted by Dr Jools at 10/24/2007 1:54:51 AM
I'm having some puzzling performance problems. Any help would be gratefully received. I have a SQL 2000 database and a set of stored procedures, tables and user-defined functions which "do some calculations". I've been careful to make these entirely set-based, avoiding cursors. The calculation...more >>

Updates/Inserts locking tips needed
Posted by oliviers at 10/24/2007 1:13:48 AM
Hi, Not sure I'm posting in the correct group. My apologies if not. I'm facing a problem when some users are uploading data to our SQL 2005 database. A sp is creating a temp table. Data (a flat file) is just bulk loaded into that temp table. An update is then performed by executing an upda...more >>

Accessing Lotus Notes from SQL Server
Posted by aroraamit81 NO[at]SPAM gmail.com at 10/24/2007 12:04:05 AM
Is it possible to pull the data from Lotus Notes to SQL Server 2000/05. And if yes then how? Thnx in advance Amit Arora ...more >>

text to varchar
Posted by SOC at 10/24/2007 12:00:00 AM
I need to change a text column to varchar 8000. I don't mind truncating the text where necessary. My attempt failed as below. Can anyone suggest a solution? Thanks Soc. SET ANSI_WARNINGS OFF update story set s_body=short_body SET ANSI_WARNINGS ON Server: Msg 511, Level 16, State 1, L...more >>

what is the function to generate blank space already?
Posted by pedestrian via SQLMonster.com at 10/24/2007 12:00:00 AM
If I'm not mistaken, there's a function in T-SQL to generate blank spaces. What is that function and how to use already? Thanks... -- Regards, Pedestrian, Penang. Message posted via SQLMonster.com http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200710/1 ...more >>

select into cursor ?
Posted by Steph at 10/24/2007 12:00:00 AM
hello, i ve a big sql request and from it i need TO count the rows and do a pagening. so, count the row, no problem. pagening, no problem. but do both... in one procedure ... ! (???) //Simulation : 1) @cursor = select * from table 2) SET @nbr = @@rowcount 3) select top(20) from @cursor...more >>

Login Issue
Posted by Rahul at 10/24/2007 12:00:00 AM
Hi I am getting following error, during login with sql server authentication. (SQL Server 2005) Lastly i have window authentication, Now I have change it with mixed server auth. Login failed for user 'mylogin'. The user is not associated with a trusted SQL Server connection.(Microsoft Sql Se...more >>


DevelopmentNow Blog