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 2007 > threads for tuesday april 3

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

Login failed for user
Posted by Sajith at 4/3/2007 11:00:03 PM
Hi all, I have these lines repeated many times, every 1 second, in the error log: Login failed for user 'user' Login failed for user 'sa' Login failed for user 'root' Login failed for user 'admin' Is someone trying to hack my SQL server (version is 2000)? How can I control a...more >>


How do I insert rows to a table of Database from a XML file stored in somewhere in hard disk
Posted by Orgil at 4/3/2007 10:31:29 PM
I have a XML file. Its physical file path is "C:\Dursgal.xml". There is a posibility to get the xml file's rows to a table in SQL database. I use MSSQL 2000. The xml file's some nodes are: <Dursgal> <UNBMS_ID>1122=D0=91=D0=9E=D0=9C00003</UNBMS_ID> <IsDursgal>true</IsDursgal> <ID_Zeregle...more >>

Partition View being used effectively?
Posted by David W at 4/3/2007 9:44:09 PM
I am working on a strategy for archiving some tables that are growing quite large. We are on SQL 2005 Standard version, so I am running some tests using Partitioned Views. I have my main table and created an archive table identical in structure. Records that are over a year old are moved t...more >>

Anyway to only count business days (mon-fri) between two dates?
Posted by Rico at 4/3/2007 8:46:16 PM
Hello, I have a request to that requires me to return the number of business days between two dates (only counting days between mon and fri). Is there an easy way to do this in SQL? Thanks! Rick ...more >>

Parameters won't work
Posted by ana9 at 4/3/2007 4:44:53 PM
I have a simple query with two parameters and for some reason they are not allowing any results to be returned. SELECT * FROM POLINE WHERE (PO_NUMBER = @PONUMBER) AND (COMPANY = @COMPANY) If I use the following: SELECT * FROM POLINE WHERE (PO_NUMBER = 1111) ...more >>

How to DENY DELETE PERMISSIONS FOR ALL OBJECTS ALL AT ONCE
Posted by Lontae Jones at 4/3/2007 2:48:04 PM
How can I DENY DELETE PERMISSIONS FOR ALL OBJECTS ALL AT ONCE instead of doing each object one at a time for a particular role called STAFF?...more >>

Load the Data in to flat file from SQL Server Table.
Posted by Rajendraa at 4/3/2007 2:06:00 PM
I wanted to Load the data in to a flat file from a SQL Server table..I know the options like BCP, DTS...but i want to know is there any way that we can dump using TSQL programming...appreciate if any one can send me the code snippet for the above functionality.........more >>

Setting Primary Key on Temp Tables
Posted by AMDRIT at 4/3/2007 2:04:05 PM
Hello Everyone, I am looking to set a primary key on a temp table in SQL 2000. I am getting an error that the a constraint by that name already exists when two or more folks call the stored procedure that creates the temp table. Anyone know what I need to do to accomplish this? ALTER T...more >>



(Sql Server 2000) Get new @@identity values after multiple row insert
Posted by Janet at 4/3/2007 1:29:41 PM
I'm inserting multiple records into a table with an identity column. Now I need to retrieve the new ids for the inserted records. I thought of getting the max id before the insert and afterward selecting all records where the id > @maxIdBeforeInsert. But that won't work if another insert occurs ...more >>

Cascading INSERT???
Posted by Jim Abel at 4/3/2007 12:26:00 PM
I had a request to create a table that contains rows that are inserted and deleted based on the Primary key of another table. This looks like an ideal case to use the relationship properties between tables and check the Cascading Update and Cascading Delete options. after setting this up I ...more >>

convert datatype
Posted by JFB at 4/3/2007 12:25:22 PM
Hi all, I have two integer columns that I want to format as date like 02/02/2007 3:30:00 am First column is for date and the values are like 20070202 Second column is for time and the values are like 235900, 200000 any ideas how can I do this? I got the date with cast(cast(colum_date as var...more >>

Create Database at a User Level
Posted by Scott at 4/3/2007 12:10:04 PM
This question is with regards to SQL Server Express. A user does not have administrator permissions and only has read/write access. However at some point it will be necessary to create another database. Is there a way to create a database with code even when the user does not have permissions...more >>

64 bit and AMD
Posted by CLM at 4/3/2007 11:52:05 AM
We're going from SS 2000 SP4 to 2005 by EOY. From what I have read and heard, AMD is the more safe way to go in the sense that it does not emulate 32 bit apps but rather actually has a 32 bit architecture. Is that correct? Is AMD a little safer way to go if you're migrating generally speaki...more >>

COUNT
Posted by shapper at 4/3/2007 11:07:39 AM
Hello, I am getting the error: 'dbo.Posts.PostId' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. On code: SELECT PostId = bp.PostId, PostTitle, PostContent, PostUpdatedDate, PostIsPublished, PostCommentsAreAllowed, U...more >>

SQL GENERATION
Posted by SKUMARI at 4/3/2007 10:54:16 AM
I have the following tabel select * from a id fnm fsrc tsrc 1 col1 abc t1 1 col2 xyz t1 2 col3 pqr t1 2 col4 abc t1 how do i generate the following sql based on the above table when I pass in id as 1? create view v1 (col1,col2) as select abc,xyz from ...more >>

Memory Issue Caused by Program
Posted by rmcompute at 4/3/2007 10:48:06 AM
I am running a program which continues to run for a long period of time. During this time everything on my computer slows down and eventually I have to re-boot. I think it relates to the fact that I use Select Into many times to create tables which are used throughout the program. I delete ...more >>

getting network login ID from sql server trigger
Posted by roy NO[at]SPAM mgk.com at 4/3/2007 10:01:18 AM
i'm working with an ERP system that logs all users into sql-server under one sql-server login ID. Can I get the person's domain login ID from a trigger? ...more >>

Learn Stored Procedures
Posted by Tom LeBold at 4/3/2007 8:48:04 AM
I have written several simple stored procedures that receive parameters. Any suggestions on a book and/or web site that will give examples on how to write stored procedures that are more complex. ...more >>

SELECT
Posted by shapper at 4/3/2007 8:26:00 AM
Hello, I have the following tables: [Blogs] > BlogId (PK), ... [Posts] > PostId (PK), BlogId (FK), Title, Content, ... [Labels] > LabelId (PK), LabelName [LabelsInPosts] > LabelId (PK), PostId(PK) I am selecting all posts from a Blog given the BlogId: SELECT * FROM dbo.Posts WHERE BlogId...more >>

Need calculation to be column name...
Posted by trint at 4/3/2007 7:49:49 AM
If anyone knows c# with sql server, I need a last column named "Total" from a calculation of another column please. Here's the code I now have without the column name: string name1 = GridView2.SelectedDataKey.Value.ToString(); SqlCommand cmd1 = new SqlCommand(@"Select quantity, prod_name, pri...more >>

Error
Posted by FARRUKH at 4/3/2007 7:36:04 AM
i am getting a stranger error. i dont know the reason. every morning i download the file (text file) into SQL Server and i get this error. when i click ok it works again here is the error [DBNETLIB][ConnectionRead(recv())] General network error. Check ur network documentation. File Manage...more >>

Syntax question SQL server 2K-- SELECT ABS(diff) FROM (SELECT CAST( '-123' as decimal(28,2)) as diff)
Posted by enilmik NO[at]SPAM gmail.com at 4/3/2007 6:29:07 AM
Why does this statement produce an error SELECT ABS(diff) FROM (SELECT CAST( '-123' as decimal(28,2)) as diff) but SELECT ABS(diff) FROM (SELECT CAST( '-123' as decimal(28,2)) as diff) A does not with A or any letter as. Enilmik ...more >>

Need help on CONVERT function in SQL.
Posted by Learner at 4/3/2007 5:41:40 AM
Hello, I have a date filed like "12/30/1899 3:30:00 PM" in SQL server 2000. I would like to display it just "3:30 PM". i.e user doesn't need date to be displayed and the time "3:30:00 PM" needs to be converted to just "3:30 PM". Can some one help me with this? Thanks -L ...more >>

Getting Old Value for Columns
Posted by Fares at 4/3/2007 1:54:03 AM
We are trying to make an audit trail for some selected fileds in a database now we have to store a history of the updated fields using triggers . the problem here how do we know the original value of a column already updated to store that with the new value in the update trigger of some table ...more >>

best way to get a GUID from a table on row insert
Posted by Smokey Grindle at 4/3/2007 12:00:00 AM
What is the best way in SQL Server 2005 to get a GUID that was created upon insert into a table? I have this code right now -- Create new GUID temp table DECLARE @NewID TABLE (AcquiredViaID uniqueidentifier) -- insert record, but specify output for inserted rows to go into the newid tab...more >>

Alter column, set default - what's wrong?
Posted by Josh Carver at 4/3/2007 12:00:00 AM
Hi group, I have this one simple line that I'm executing against SQL 2005, and I can't figure out why on Earth this is causing a problem: --------------------------------------------------- SQL: ALTER TABLE [Employee] ALTER COLUMN [FirstName] SET DEFAULT '' Error: Incorrect syn...more >>

Rows as columns (pivot?)
Posted by Bardo at 4/3/2007 12:00:00 AM
Hi all, I have the following table structure: PartyRoleGroup table - PartyRoleGroupId PartyRole table - PartyRoleGroupId (f key to PartyRoleGroup) - PartyId - PartyRole Party table - PartyId - Name The PartyRole table will contain 2 or 3 records for each ...more >>


DevelopmentNow Blog