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 2006 > threads for monday september 4

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

Unicode Comparison.
Posted by Mahesh at 9/4/2006 11:17:45 PM
hi i want to compare a unicode string "=E0=AA=85=E0=AA=AE=E0=AA=A6=E0=AA=BE=E0= =AA=B5=E0=AA=BE=E0=AA=A6" with a string fetched from database, example code is given below. str contain value fetched from database and "અમદાવાદ" is unicode of "=E0=AA=85...more >>


Security (How to protect SQL Server)
Posted by Leila at 9/4/2006 9:32:59 PM
Hi, I'd like to know about the ways that someone can attack to SQL Server, and how to protect it. I already know SQL Injection but I'm more interested in network attacks, like Slammer worm (and how it works) or etc. Are there any resources (web sites) to help a network admin about securing SQ...more >>

Stored procedure help
Posted by Jacob Salas at 9/4/2006 8:13:30 PM
I'm trying to get the following to function correctly but it's not resulting in the way that i'd hoped. @counter is always 0 and even when I force a static value in place of @keywords, @ids never contains a value. I know C++ programming a bit, but not so much with SQL. Any help would be most...more >>

What is the search query for that?
Posted by ibiza at 9/4/2006 8:02:11 PM
Hi all, I have a table that has an id (and other fields) : Table1_id .... Then I have another table with also an id (and other fields) : Table2_id .... And I have my pivot table for the 'many to many' relationship : pivot_idTable1 pivot_idTable2 Let's say the pivot table contains ...more >>

How do I place multiple records of a sub-query in one record?
Posted by Sam at 9/4/2006 7:03:03 PM
Hi, I think this can best be explained with an example. I don't have a specific case or sample table. I can make one up if you guys want me to. What I'm trying to do is this: Let's say there are three snake charmers in Florida, two in California and one in Texas. I want to end up with t...more >>

Primary Key
Posted by James at 9/4/2006 5:45:02 PM
I have a table that has 3 columns: firstname, middlename and lastname. The concatanation of the 3 columns will always be unique. I would like to create a fourth column called fullname that would have [firstname]+ ' ' + [middlename] + ' ' + [lastname] as a formula and make this the primary key....more >>

String concatenations
Posted by Bassam at 9/4/2006 5:35:36 PM
Hello, a simple string concatenation question please if i write SELECT cast('July' as char(10)) + 'NPTCO' UNION ALL SELECT cast('August' as char(10)) + 'NPTCO' then i got July NPTCO August NPTCO This is a simplified situation, in reality the word 'July' and 'August' will ...more >>

Postcode problem
Posted by ricky at 9/4/2006 5:31:28 PM
Hi I have a table containing address of contacts. I have been asked to extract these details, but there must be a separation between Address and Postcode. The Address fields are made up of 6 fields. The script below is for the table described above: CREATE TABLE [Customer Address Unit ...more >>



Query working in EM and QA but not in Store proc
Posted by kongsballa at 9/4/2006 1:36:38 PM
Help, strange things happening! How come I have an sql query that I can run in both SQL Server 2000 Enterprise Manager and Query Analyzer, but when I try to run it as a stored procedure, I get a different result. Instead of the expected 505 rows, I get 9425 rows. I haven't bothered to descr...more >>

Numbering rows in SELECT query?
Posted by pedestrian via SQLMonster.com at 9/4/2006 1:05:54 PM
I'm using the Northwind database. I retrieved rows [Order Details] table using this query: SELECT * FROM [Order Details] WHERE OrderID = 11000 The result return 3 rows. I would like to generate add an extra column named [No.] to number the rows so the result will looks like below: No...more >>

Please help me with a SELECT
Posted by buttonsoft NO[at]SPAM yahoo.com at 9/4/2006 12:34:58 PM
Hi I'm a newbie to SQL and have problems getting a SELECT to work. What I want to achieve is to select data from table A for which more than 1 entry related exists in table B, e.g. SELECT A.id, A.desc, B.desc FROM table1 A INNER JOIN table2 B ON (A.id =3D B.id) AND {number of entries in B ar...more >>

Triggers: using checksum()
Posted by yitzak at 9/4/2006 11:07:15 AM
Hi I want to start using triggers. However I want to work out if the update has actually changed data. If I set a field of value 'abc' to the new value of 'abc' (i.e. no change) I don't want to do anything. Whats the best way to determine if any columns have changed (not just updated) insid...more >>

Implicit conversion from datetime to int not allowed
Posted by Assimalyst at 9/4/2006 9:03:27 AM
Hi, I have the following stored procedure, which selects a single dattime value. I wan't to return this value but am unable to save the sp because of the following error: "Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query" But i...more >>

Mitery variable
Posted by plan9 at 9/4/2006 8:02:01 AM
i'm having the strangest error .... i declare and use a variable I eaven use it to do prints theres no problem but a few lines down the code it pops up an error saying that same variabe isn't declare.... Server: Msg 137, Level 15, State 1, Line 1 Must declare the variable '@j_range'. th...more >>

Query Problem
Posted by trullock NO[at]SPAM hotmail.com at 9/4/2006 7:50:17 AM
Hi, I have an orders table and an order_items table. Simply, they look like this: Orders: ID | Status ------- 0 | New 1 | InProgress 2 | InProgress Order_Items: ID | Ord_ID | Supplier | Status ------------- 0 | 0 | Fred | New 1 | 1 | Fred | New 2 | 1 ...more >>

Query Problem!
Posted by Jami at 9/4/2006 7:15:31 AM
Hi to All! i m running following query Select MIN(TI_DateTime), Min(Familyid) AS FamilyID, min(Formno)as FormNo, min(tokenno) as TokenNo, min([Name]) as ApplicantName From Main_Head Where FormStatus = 'D' and ThumbStationId = 'ABCD' and familyid is not null and day(TI_DateTime) = day...more >>

DATEPART Gives different answers on different machines?!
Posted by Steve Barker at 9/4/2006 6:44:01 AM
Hi guys, I've noticed that the following line of T-SQL: SELECT DATEPART(dw, GETDATE()) ....when fired on different servers, gives different answers. For instance, as I write this, it's Monday. One server returned 1, and the other 2! The difference occurred when the T-SQL was run through...more >>

Deadlock problem
Posted by Roshan Jayalath at 9/4/2006 6:21:01 AM
Hi all, I'm having a terrible day full of deadlocks, and I would be greatful if someone can help me out of this problem. We have a table NEXTSERIALNO which is used to generate a sequencial number. To ensure that the sequence is properly maintained (as a duplicated number would mean a s...more >>

About Cursor on Dynamically created Tables.
Posted by amit at 9/4/2006 6:06:14 AM
DECLARE @SID Varchar(10) SET @SID = '00260AMIT' DECLARE @STR VARCHAR(1000) SET @STR = '' SET @STR = 'CREATE TABLE RD_'+ @SID +' (RESPID INT PRIMARY KEY, FLAG BIT)' EXEC(@STR) DECLARE @FIELDCODE INT, @FIELDNAME VARCHAR(20) SET @STR = 'DECLARE CURTABLECREATION CURSOR LOCAL STATIC FORW...more >>

SQL Emergency! Need Help
Posted by manmit.walia NO[at]SPAM gmail.com at 9/4/2006 5:54:02 AM
Hello All, I am having trouble with a stored procedure I am working on. Just a little background, I am trying to do a GridView inside another GridView but the trouble I am having is that each row in the Parent GridView is display the entire Child GridView. What I want to do is basically for G...more >>

Incorrect syntax near the keyword 'End'.
Posted by Betty at 9/4/2006 5:29:25 AM
Afternoon, I am having trouble with the following code due to a syntax error near 'End'. But i cannot see why it has an error. The code should display in two separate columns the total amount of 'Leads' raised by Joe Bloggs. Code as follows... SELECT AWD.EmpName, IsNull(FirstMonth.Lea...more >>

Union-Record count difference when a column is used in the select
Posted by xgopi at 9/4/2006 4:50:01 AM
Hi, select (A - B) as Diff, (C-D) As Diff1,idd , oDate from [view1] with (NOLOCK) where oDate>= convert(datetime, '01/01/2005') and oDate< (convert(datetime, '09/01/2006') + 1) and idd = 1 UNION select (A - B) as Diff, (C-D) As Diff1,id ,...more >>

Requesting network information
Posted by Kostja at 9/4/2006 4:07:02 AM
Hello out there, in order to avoid using 'xp_cmdshell' for purposes like this: "CREATE TABLE #Info (res varchar(255), ID int IDENTITY (1, 1) NOT NULL) SET @cmd = 'NET USER /domain' INSERT INTO #Info (res) EXEC master.dbo.xp_cmdshell @cmd" Can anybody tell me how to request networ...more >>

Date between two wildcards
Posted by jochenhebbrecht NO[at]SPAM gmail.com at 9/4/2006 2:50:15 AM
I have a webapplication where the administrator can view into a logbook. To shorten the list of the logbook, he can filter the list by entering a startdate AND/OR an enddate. If he doesn't fill in the dates, the list shouldn't be filtered. So this is what I did for my PreparedStatement SELE...more >>

Unicode Comparison.
Posted by Mahesh at 9/4/2006 12:15:13 AM
aGkKCmkgd2FudCB0byBjb21wYXJlIOCqheCqruCqpuCqvuCqteCqvuCqpiB3aXRoIGEgc3RyaW5n IHRoYXQgZmV0Y2hlZCBmcm9tCmRhdGFiYXNlIGRhdGEgdHlwZSBvZiBkYXRhYmFzZSBjb2x1bW4g aXMgbnZhcmNoYXIuIGhvdyBjYW4gaSBkbyBpdCBpbgphc3AubmV0IHVzaW5nIHZpc3VhbCBzdHVk aW8uIGJlY2F1c2UgaWYgaSB3cml0ZSBmb2xsb3dpbmcKCmlmIHN0cj0i4KqF4Kqu4K...more >>

Creating 2nd transaction form inside db ?
Posted by Adrian Parker at 9/4/2006 12:00:00 AM
We have a table that holds last inserted key values for several tables. These keys are alphanumeric with a fixed format, so we can't just do Max +1 on them. So we have a procedure that gets the current key, increments it as necessary, updates the table and returns the key to the caller.. be ...more >>

Add a Column at Particullar Position n MS SQL Server
Posted by Ravi Kandukuri at 9/4/2006 12:00:00 AM
Hello All, I want to add a new column at a particular position in table without droping/recreating table. How to do it? Thanks & Regards Ravi Kandukuri | Database Administrator | SUVI Information Systems Pvt Ltd (CMMI 3) | 582 MG Road Indore - 452 003 MP [India] | Work +91-731-243-6611-13 Ex...more >>

SQL server 2005 query problem
Posted by steve at 9/4/2006 12:00:00 AM
Hi All I am using SQL server 2005 with vb.net 2005 and need to retrieve data from an appointments table, inner joined with a customers table I need to retrieve only 1 row for each customer account number in the appointments table and that row is to be the row with the earliest time of da...more >>

Restoring data from SQL2005
Posted by Roy Goldhammer at 9/4/2006 12:00:00 AM
Hello there I've upgrated my sql server to 2005. When i try to restore backup file created on 2005 format it failed on my computer. On my computer sql2005 is installed, however, the version is still 2000. What is the problem and how can i solve it? ...more >>

Record searching question
Posted by Gary Howlett at 9/4/2006 12:00:00 AM
Hi, Im trying to find a solution to easily perform the following in SQL 2005 I have 3 tables Cases -> Client -> Addresses (one-many on each) Say for instance I wish to find a Client by surname. I can easily create a join and get that client, case details and their related addresses. ...more >>

Windows Integrated Security
Posted by Goofy at 9/4/2006 12:00:00 AM
I have a curious situation here. I have a database on the sql server which I have set up access to for a number of people. I can get access to the database from my machine and they cannot. However, if they log on to my machine as them, they can access the database. The error which comes up...more >>

newbie: comparing dates in sql
Posted by Jeff at 9/4/2006 12:00:00 AM
Hey Sql Server 2005 In my select I'm comparing dates like this: convert(char(10), publishingDate, 104) = convert(char(10), GetDate(), 104) It works for me, but isn't there a better way in Sql Server to compare dates? Jeff ...more >>

testApp error LNK2005: "unsigned long * Table_CRC16" (?Table_CRC16@@3PAKA) already defined in CRCTest.obj
Posted by ja at 9/4/2006 12:00:00 AM
Hi, all. I have only one line in my project head file, unsigned long Table_CRC16[256]; When I compile the project ,there is no complier error ,but when link this project ,it will turn out the error like the subject detailed. testApp error LNK2005: "unsigned long * Table...more >>


DevelopmentNow Blog