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 > june 2007 > threads for wednesday june 6

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

Modify a function that creates Line Item numbers
Posted by jonefer at 6/6/2007 11:31:00 PM
I have a function that adds line item numbers for courses grouped by Identification number (NUID) Right now it returns the following: NUID | CourseIndex 12345 1 12345 2 12346 1 12347 1 12348 1 But it actually needs to take into consideration one more item RequiredDate: so ...more >>


Graphics from SQLCLR
Posted by Mike C# at 6/6/2007 11:02:18 PM
Is there a relatively painless way to manipulate graphic images from within SQLCLR? ...more >>

Using the EXCEPT keyword in Jet queries
Posted by Nathan Sokalski at 6/6/2007 10:42:24 PM
I have an SQL query that is as follows: SELECT headline,url,summary,updated FROM worldnews EXCEPT (SELECT headline,url,summary,updated FROM worldnews WHERE newssection='Archives' UNION SELECT TOP 5 headline,url,summary,updated FROM worldnews WHERE newssection='Archives' UNION SELECT TOP 5 h...more >>

Backup
Posted by Anders at 6/6/2007 10:35:00 PM
Hi everyone From within an application I execute the command BACKUP DATABASE MyDatabase TO DISK = 'C:\MyBackups\MyDatabase.bak' WITH INIT This backup runs smoothly without problems as long as the TO DISK clause points to a local drime. But as soon as it points to a network mapped drive, ...more >>

Order By special list, possible?
Posted by Bruce Schwartz at 6/6/2007 10:10:00 PM
Hi, I have a column with the values of 'Enabled', 'Paused' or 'Paused'. Is it possible to sort it so that the 'Enabled' shows first, then 'Paused', and then 'Disabled', and NOT alphabetically? Thank you ...more >>

Dynamic Column Name
Posted by Truc H. at 6/6/2007 7:30:00 PM
Hi all, I'm have a query which return a value from a dynamic column name . Declare @amount numeric(25,0) Declare @ColumnName varchar(20) Set @ColumnName= 'SaleCol1' SELECT @amount = SaleCol1 FROM Sale WHERE year=1998 --- is running fine SELECT @amount = @ColumnName FROM Sale WHERE yea...more >>

BINARY_CHECKSUM uniqueness
Posted by Joey at 6/6/2007 6:40:32 PM
hi, is it safe to assume that BINARY_CHECKSUM will return the same result ONLY if the parameters passed to it are the same? i.e. if i have a table Contact with the following columns ( Firstname varchar(50), lastname varchar(50), email varchar(80) ) Should i assume that BINARY_CHECKSUM( Fi...more >>

Get Quick results using "Row Locator"s (fileid+pageid+rowid)
Posted by Manasvin at 6/6/2007 6:23:54 PM
Hi. I've posted this to the SQL wish center (Connect/sqlserver/feedback) as a suggested new feature. (https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=281531). Would appreciate your comments and thoughts towards feasibility and usability. Suggested feature ...more >>



parameter input and output
Posted by Smokey Grindle at 6/6/2007 4:53:26 PM
How do you make a t-sql parameter an input and output (bidirectional) parameter? thanks! ...more >>

DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER
Posted by antonio at 6/6/2007 4:43:41 PM
After deploying my SSIS package into our production server running what I think is a 64 bit version of SQL Server Integration Services, I am unable to execute the package. During validation I get the error: Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER .....etc....more >>

Find last entries in groups, eliminating duplicates
Posted by Ian Boyd at 6/6/2007 4:37:41 PM
/* Subject: How to get last value from a group, eliminating duplicates i know this question has been posted before, but i can't find one that deals with the problem case of non-unique "last" entries NOTE: This can all be pasted into QA i want the information about the last entry from gro...more >>

time in SQL
Posted by Big D at 6/6/2007 2:47:14 PM
I wrote a query that works and does as expected. One of pieces of information I have is the date/time in the table. I want to find out how many times during the hour the event occurs. The format in the table for date/time is: 2007-06-01 16:15:18.000 2007-06-01 16:32:00.000 2007-06-01 17:...more >>

CREATE VIEW and permissions
Posted by Michael Tissington at 6/6/2007 2:24:45 PM
I'd like all users to be able to create views that are owned by dbo. I have already granted them CREATE VIEW ... but what permissions do they need so they can create them so they are owned by dbo ? ...more >>

Need help with the SELECT statement please.
Posted by Lam Nguyen at 6/6/2007 1:14:05 PM
Hi all, I am try to write a query and get the result show below but get stock. Any help would greatly appreciate. drop table #temp go CREATE TABLE #temp ( Agent_nb INT NULL, LastName VARCHAR(15) NULL, FirstName VARCHAR(15) NULL, Auto_nb INT NULL,...more >>

Need help with the SELECT statement please.
Posted by Lam Nguyen at 6/6/2007 11:34:03 AM
Hi all, I am try to write a query and get the result show below but get stock. Any help would greatly appreciate. drop table #temp go CREATE TABLE #temp ( Agent_nb INT NULL, LastName VARCHAR(15) NULL, FirstName VARCHAR(15) NULL, Auto_nb INT NULL,...more >>

Query combine column from 2 tables
Posted by Flomo Togba Kwele at 6/6/2007 11:28:27 AM
I have 2 tables, both of which contain a zipcode. Table A Table B ZipCode char(5) ZipCode char(5) I would like to generate something like this: select distinct(distinct(a.ZipCode) + distinct(b.ZipCode)) ZipCode but I don't have a clue how to do this. I want a...more >>

Backup database
Posted by Anders at 6/6/2007 10:54:00 AM
I can - from within an application - execute the SQL Command: BACKUP DATABASE MyDatabase TO DISK 'C:\MyBackup\MyDatabase.bak' WITH INIT This works fine as along as the "to disk" clause points to a local drive However, If it points to a network drive, the backup fails Any hint? Regards An...more >>

Search or Find function?
Posted by David Billigmeier at 6/6/2007 10:05:01 AM
Is there a function I can use to search for a text string within another text string? For example: search("-","1234-5678") Would return 5 because "-" is found in the 5th position of "1234-5678" Thanks, -- Regards, Dave...more >>

Find or Search funtion?
Posted by David Billigmeier at 6/6/2007 9:53:01 AM
Is there a function I can use to search for a certain string within some text? For example, something like: search("-","1234-5678") would return 5, because the "-" shows up in the 5th position of "1234-5678". Thanks, -- Regards, Dave...more >>

backup to network
Posted by Andre Gibson at 6/6/2007 9:49:02 AM
I am using sql server 2000 with the default instance (if that matters), and I would like to save backups to a network drive however I can't see anything more than the local disks from Enterprise Manager. How can I get around this? thanks Andre...more >>

Select statement
Posted by ITDUDE27 at 6/6/2007 9:39:02 AM
Hello everyone. I'm having trouble with this select statement I need help with. sample table: date1 order_no p_amt 8/11/06 123 800 3/27/07 123 800 3/28/06 123 800 9/11/07 123 0 I want the output of min date with p_amt <=0. Whe...more >>

format date calculation
Posted by doug at 6/6/2007 8:42:01 AM
SQL Server 2000 I have 2 date columns formatted as yyyy-mm-dd hh:mm:sec. What is the best way to calculate the difference between the 2 columns and have the result fomatted in hh:mm - even if the difference is greater than 24 hours? Thanks in advance. ...more >>

Back up SQL database to Access
Posted by KoDell at 6/6/2007 8:07:11 AM
I have a small SQL database running on my web site. I want to back it up on a weekly basis to an Access file and then download that file. I can write code to open both the SQL connection and the Access file and copy data in a loop, but someone told me there is a more efficient way to do it. ...more >>

Deadlock
Posted by Rahul at 6/6/2007 7:27:30 AM
Hi, How we can detect deadlock from a database. Rahul ...more >>

Generate Different Plans for Estimated & Actual
Posted by grantedd NO[at]SPAM gmail.com at 6/6/2007 6:18:51 AM
Hello, Does anyone have a method where by I can set up the situation where I will get one execution plan using estimated and a different plan from the actual execution? I need to make it repeatable for demonstration purposes. I just haven't been able to come up with one on my own. Thanks, ...more >>

Create view
Posted by ITDUDE27 at 6/6/2007 5:44:00 AM
Hi. I created a view and I compiled, changed from Create to Alter. Every time close it and re-open it opens as Create instead of Alter. Any thoughts?...more >>

Select with variable containing a Column name
Posted by Truc H. at 6/6/2007 5:42:01 AM
Hi , I would like to use a column name in a variable as follows: Declare @amount numeric(25,0) Declare @ColumnName varchar(20) Set @ColumnName= 'Amount1' SELECT @amount = @ColumnName FROM Sale WHERE year=1998 ---error: convertion from varchar to numeric SELECT @amount = Amount1 FROM Sale ...more >>

Parallel I/O for partitioned table
Posted by Leila at 6/6/2007 12:41:06 AM
Hi, Imagine that I have a partitioned table, half of rows on one disk and the other half on other disk. when I query like this: SELECT * FROM MyTable Can I expect to get the result faster comparing with the situation that whole of table resides on one disk? Will these two partitions be s...more >>

Import Exchange Contacts
Posted by David C at 6/6/2007 12:00:00 AM
Is there any way to import a users Exchange contacts into an SQL Server 2005 database? I looked at the Import Data option but I didn't see anything there. Thanks. David ...more >>

Encrypt columns, Size question in SQL2005
Posted by Brian Simmons at 6/6/2007 12:00:00 AM
Hello all, I've been doing a lot of research on column encrypting/decryping in SQL Server 2005. I definitely understand it a lot better than I did, but I'm still hazy on some issues. If I have a column which is normally char(9) (say for storing an SSN), with encryption, I need this colu...more >>

Where is sys.dm_tran_session_transactions in SQL2000?
Posted by mku at 6/6/2007 12:00:00 AM
Hi, Can anyone tell me where I can get information [in SQL2000] about transactionId started in particular session? In MSSQL 2005 there is nice system view sys.dm_tran_session_transactions, which I can use. I can get this information from locks table, if session put some locks, but this...more >>

Whats wrong with this statement?
Posted by Smokey Grindle at 6/6/2007 12:00:00 AM
DECLARE @TempPersonID uniqueidentifier -- Insert statements for procedure here INSERT INTO People (FirstName,LastName,MiddleInitial,Prefix,Suffix,Birthdate,Gender,SSN,WebsiteURL,Email1,Email2,EMail3) OUTPUT INSERTED.PersonID INTO @TempPersonID VALUES (@FirstName,@LastName,@MiddleInitial,...more >>

HELP: MFC ODBC SQL Server problems
Posted by Andrew Wan at 6/6/2007 12:00:00 AM
I got a problem where in SQL Server a table has a column of type REAL & size (precision) 4. It's meant to store double types for C++ variable values. In SQL Server, the value 1E+10 translates to 10000000000 in C++ fine, via MFC's CRecordset class (DBCORE.CPP). However any numbers above this v...more >>

The .LDF file
Posted by Andrew Chalk at 6/6/2007 12:00:00 AM
How can I safely reduce the size of the .LDF file that SQL Server 2005 Express creates for a database? Many thanks. ...more >>

Stuck with query to check two tables with date ranges
Posted by Lee Clements at 6/6/2007 12:00:00 AM
I am hoping that somebody may be able to assist me with a query I am trying to construct but not really getting anywhere. I have 3 tables in the query, one holds staff details, the other a list of jobs and the third a list of exlusions (e.g. holidays). I am building a wizard that will walk ...more >>

Need help for a Select-Statement
Posted by Jan Lorenz at 6/6/2007 12:00:00 AM
Hi, I have for example following table: ID Col1 Col2 --------------------------- 1 A Date1 2 A Date2 3 B Date3 4 B Date4 5 B Date5 i want select every Col1 wit...more >>

Select and Update in one
Posted by MattC at 6/6/2007 12:00:00 AM
Is it possible to do the following in one statement: SELECT ID INTO #ProcessList FROM MyTable WHERE Processed = 0 UPDATE MyTable SET Processed = 1 WHERE FeedID IN ( SELECT ID FROM #ProcessList ) SELECT ID #ProcessList DROP TABLE #ProcessList TIA MattC ...more >>

Detect Application User Machine ID on Sql Server
Posted by Rahul at 6/6/2007 12:00:00 AM
Friend, Today i have new issue, I want to track, Which 'Application User' has make some changes in database. Here i have a user table, contain userid and there password information for an application. for any updation i have also loged in a log table. Now I also want to trace, that changes...more >>

To get row in XML
Posted by Andrei Zakharov at 6/6/2007 12:00:00 AM
Hi, I do use SQLOLEDB provider V 2.82 to connect to MSSQL Server 2005. I try to get row data in XML form. The code is the following CCommand<CXMLAccessor> cXMLCmd; CStringW so,sot; cXMLCmd.Create(session, "select * from tmp for XML RAW('item'), root('records')") ; cXMLCmd.Open(); cXM...more >>


DevelopmentNow Blog