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 2006 > threads for friday december 8

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

Recursive Queries using Common Table Expressions
Posted by zwieback89 via SQLMonster.com at 12/8/2006 11:41:01 PM
Hi, I am experimenting with the Recursive Queries using Common Table Queries. I get an error with the one I made. What is the error with the 1st line that is below (That is where the error is shown). Server: Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'WITH'. If ...more >>


SQL Query help needed
Posted by Pawe³ Zalewski at 12/8/2006 7:09:49 PM
Guys help needed, I have a table X DocNo | InvNo | VAT | Anount ---------------------------------------- 1 | a1 | 7 | 100 1 | a1 | 22 | 200 2 | a2 | 0 | 50 3 | a3 | 22 | ...more >>

Calling "backup database" with sp_executesql.
Posted by Charles at 12/8/2006 6:15:00 PM
Hi, I'm executing a "backup database" query in Java using a CallableStatement object like this: String query = "backup database TestDB to DISK = 'c:\TestDB.bak';"; CallableStatement call = m_dbConnection.prepareCall("{call sp_executesql(@stmt=?)}"); call.setString(1, query); call.execut...more >>

SQL 2005 Maintenance Plan missing some databases..
Posted by Ginger Estherskip at 12/8/2006 4:38:23 PM
This is very odd. I can setup the Back Up Database Task in the Maintenance Plan of SQL 2005 -- and hand select some databases --- yet it doesn't actually generate any backup script for a few of the databases. They are NOT in simple recovery mode and I can backup the tranlog just fine from...more >>

VS Crash
Posted by Kop at 12/8/2006 4:10:01 PM
I'm having trouble with CLR based user-defined functions. When I create a database C# project in Visual Studio 2005, the dialog to pick the database connection doesn't apprear. Except for that, the project seems to be created normally. I am able to write and build my project without a p...more >>

Time Format in SQL Server
Posted by fniles at 12/8/2006 3:04:22 PM
In Access you can do Format$([time],"hhnnss") and it will format 3:02:07 pm to be 150207 and 3:16:19 pm to be 151619. What is the best way to do this in SQL Server ? Thank you. ...more >>

WriteText question
Posted by RSD at 12/8/2006 2:20:00 PM
I am trying to move .doc, .xls, .pdf, .jpg fields to a SQL-Server 2000 image field using writetext. I am using a RichTextBox control to hold the binary data. All examples I have found for writetext are writing 'Hello World' or something else inside of tics. I can't find anything where an ac...more >>

Cleaning Addresses
Posted by Audrey Ng at 12/8/2006 1:42:36 PM
Hi all, I need SQL Server code to clean address fields. Any suggestions? Audrey *** Sent via Developersdex http://www.developersdex.com ***...more >>



Easy (cept for me) select question
Posted by Curious Joe at 12/8/2006 12:09:03 PM
I have an invoice file that contains the item code of a product as well as the date. I also have a historical price sheet that lists the item code, price, begin date of the price, end date of the price. I need to add the price from the price sheet to the invoice file but I could have multiple...more >>

SQL 2005: How to generate INSERT statement for the data within table(s)?
Posted by Maxwell2006 at 12/8/2006 12:04:20 PM
Hi, Using SQL 2005, what would be the best way to generate INSERT statement for all data within one table or all tables within our database? Any help would be appreciated, Max ...more >>

Search
Posted by shapper at 12/8/2006 11:21:59 AM
Hello, I have an SQL database with a table. This table has two fields: [Title] and [Description]. In my web site I have a text box where the user inserts some keywords, as follows: 1 > book english 2 > book AND english 3 > book OR english Is it possible to create an SQL procedure...more >>

P2P with SSB and SQL Express Edition
Posted by mike at 12/8/2006 9:49:56 AM
It's my understanding that SSB can't message P2P between SQL Express Editions on multiple machines. Is this true? Is it possible to put a Q on a non-Express Edition machine that just routes messages between Q's on Express Editions? Thanks, Mike ...more >>

Syntax error converting the varchar value 'selectedCategory4' to a column of data type int
Posted by trint at 12/8/2006 8:58:29 AM
I've tried everything to get rid of this error in this code: SqlConnection cnSQL = new SqlConnection(ConnectionstringCTLG); SqlCommand cmSQL; int intRowsAffected; string strSQL = "Select p.name, " + " pc.sort_order " + ...more >>

Why does it keep telling me to declare #TableVar when I already did
Posted by John Doe at 12/8/2006 7:20:48 AM
I am moving XML into a table variable. I declare the table variable, load the data then load the other part of the xml to another table variable. Then I drop the XML from memory and try an IF EXISTS... it tells me I must declare the variable @Supplier and @TPConfig even though they are already...more >>

Advice
Posted by trullock NO[at]SPAM hotmail.com at 12/8/2006 7:06:48 AM
Hi, I'm looking for a bit of general advice on how best to go about solving this problem: I need to store a list of unique urls. This list will be updated every day by adding 400 or so new urls. Some of these urls (maybe upto about 65%) will be duplicates. Whats my best way of making sur...more >>

Substituting a value from a previous row where a value is NULL
Posted by philipbennett25 at 12/8/2006 5:20:56 AM
Hey can anyone help with this? Below is a table that shows some parts against month and a vendor ID number. I would like to put together a statement, that, where the VENDOR_ID is NULL for a month, looks back at the previous month for the same PART to get the vendor ID. It is possible, as in...more >>

BCP Headers?
Posted by nomad at 12/8/2006 4:36:36 AM
Hi, I have this piece of code which works perfectly but it is not including the Headers. Here is my code. SET @Command = 'bcp ' + '"USE ' + DB_NAME(DB_ID()) + ' SELECT FirstName,Surname,Postcode1,Postcode2,SCRef ' + 'FROM dbo.vw_BestPriceReport_SimpleCover_DailyJob' + '"' + ' qu...more >>

in oracle we have a functionality "cursor" ... do we have some replacement of it in sql server
Posted by manish1.agarwal NO[at]SPAM gmail.com at 12/8/2006 3:31:55 AM
in oracle we have a functionality "cursor" ... do we have some replacement of it in sql server Example of oracle "SELECT 'INVOICES' AS EXT_TABLE_NAME, TRANSACTION_CODE, WAYBILL_NUMBER, CURSOR ( SELECT 'INVOICE_LINES' AS EXT_TABLE_NAME, EXT_REC_ID , UNIT_PRICE FROM INVOICE_LINES ) INVOI...more >>

ROGUE SQL
Posted by AA2e72E at 12/8/2006 12:48:00 AM
I am at a loss to understand why SELECT BASIC,(1+FLOOR(LOG10(BASIC))) as wid FROM SALHIST; works and returns the expected results but SELECT BASIC,(1+FLOOR(LOG10(BASIC))) as wid FROM SALHIST ORDER BY BASIC; returns no results at all, and why SELECT BASIC,(1+FLOOR(LOG10(BASIC))) as wid ...more >>

Stored Procedure Question
Posted by Goofy at 12/8/2006 12:00:00 AM
I have a stored procedure which has a WHERE clause in it, there are two parameters WHERE n=@n AND o=@o I want to pass a parameter which will form the remainder of the selection. AND MarketSpace = @MarketSpace. BUT, I want to be able to select ALL market spaces if the @MarketSpac...more >>

Help with grouping and selection
Posted by Goofy at 12/8/2006 12:00:00 AM
I have a record set of 25,000 records ( which is growing ). For the sake of the example, the view looks like this. pyear( int ) week_no( int ) marketSpace( string ) project_no( string ) cost( double) I want to group by market space , project_no and then sum the cost. So far, so good ....more >>


DevelopmentNow Blog