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 > february 2007

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

Date Time format for Latvian Settings
Posted by SM at 2/28/2007 11:21:19 PM
I am trying to fire a query having the WHERE clause on Date Time field. But with Latvian Regional settings the date value comes as 'yyyy.mm.dd.'. The last dot (.) in the string creates problem. Does anyone knows how to tackle this?...more >>

Getting Varbinary in C#.
Posted by Archana at 2/28/2007 11:07:52 PM
Hi all, I want to return text datatype from stored procedure. So what i did is used varbinary as output paramter to stored procedure. My Store procedure is CREATE proc test_text @outtext varbinary(16) output AS begin declare @ptr varbinary(16) select @ptr = TEXTPTR(addr) from emp ...more >>

Assigning Execute Permissions to All My Stored Procedures
Posted by Simon Harvey at 2/28/2007 8:59:18 PM
Hi All, I have a database with about 250 stored procedures. I need to give some users execute permissions on all of these procedures. Can anyone tell me if there is an easy way to select a group and grant execute permissions to it for all 250? I basically need the group to be able to exe...more >>

Dynamically specify server and database in Stored Procedure
Posted by Jared at 2/28/2007 7:15:00 PM
I am writing Stored Procedures on our SQL 2005 server that will link with data from an external SQL 2000 server. I have the linked server set up properly, and I have the Stored Procedures working properly. My problem is that to get this to work I am hardcoding the server.database names. I ...more >>

DEALLOCATE statement hanging
Posted by Nigel A at 2/28/2007 7:02:12 PM
I have a stored procedure which goes like the code below but with real database field names and so forth. It all goes swimmingly until it reaches the DEALLOCATE statement to deallocate the cursor where it stops. I know this because that's what Activity Monitor is telling me. It's a SQL2k dat...more >>

Error handling SQL 2000
Posted by Terri at 2/28/2007 6:27:20 PM
Given 3 INSERT statements in a stored procedure where: The first INSERT runs without errors. The second gives an error like "Error converting data type varchar to float.". The third procedure has no errors and could be executed. Is it possible to ignore the error in the second statement and ...more >>

SQL2000: Difference Developer/Enterprise Edition
Posted by news.microsoft.com at 2/28/2007 5:22:06 PM
Ha all, As I understand there should be no difference in SQL 2000 Developer edition and the SQL 2000 Enterprise edition (except for the License). On my workstation (XP) I have the Developer one and on the production server (W2K3) the Enterprise one. Both are version 8.00.2039 with SP4 applie...more >>

SQL Server Moblie 2005 Update Problem
Posted by Arlyn_L at 2/28/2007 5:19:02 PM
I am attempting to use SQL Server Mobile 2005 in a Windows Forms application. I have used the wizards to define a table structure and the connections test was successful. I have attached a DataGridView to the table. I try to add rows to the table from another dataset. The 24,500 rows added...more >>



Unique Combinations Query
Posted by stjulian at 2/28/2007 3:54:10 PM
I have a list of values Customer Item ---------- ----- 1 A 1 C 2 A 2 B 3 A 3 C 4 A And would like to end up with A B C Count -- -- -- ----- x ...more >>

Counting total bytes used in SQL Server database
Posted by Stimp at 2/28/2007 2:51:04 PM
Just starting a new thread here because the original one may have gotten lost in the myriad of threads :) Is it possible to count the total bytes of actual data in a database without reindexing or using "sp_spaceused" ? Cheers, Peter -- fiddlewidawiddum...more >>

Help using CURSOR
Posted by Monik at 2/28/2007 1:25:22 PM
Hello all, I have two tables, table1: Customers, table2: Orders. In table 1 as the name says I have a list of all of our customers, table 2 cotains the order all the orders that each customer has places. What I need to do is go thru everyrecord in the customer table and find the last order r...more >>

IDENTITY_INSERT
Posted by Pat at 2/28/2007 1:07:53 PM
Hi Friends, SQL2005 I am trying to insert into a table with identity column: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[BulkMailExportJobLog]( [jobID] [int] IDENTITY(1,1) NOT NULL, [BulkMailTypeID] [int] NOT NULL, [startdate] [datet...more >>

OpenXml BINARY BASE64 Problem
Posted by Kevin Blakeley at 2/28/2007 12:56:20 PM
I have a stored procedure which returns some xml data using the FOR XML AUTO, TYPE, BINARY BASE64 syntax. One of the fields is an image field, and gets sent back correctly. I have another procedure that is trying to insert that data back into a table, but when I perform the insert, it does...more >>

Don't display results in Query Analyser
Posted by Arbi at 2/28/2007 11:35:05 AM
Hi, I have a statement like that, but every time that i run this statement it shows records that are in that specific cursor, How it is possible to do not display that records.Is there any thing like "set nocount on" or "echo off" while @@fetch_status = 0 begin fetch next from acur...more >>

SQL 2005 won't insert Linked Server data into temp table
Posted by MarcB - CommunispaceIT at 2/28/2007 11:10:25 AM
I have 2 SQL 2005 servers in the following configuration: - SQL2005-1 includes a linked server to SQL2005-2 (using SQL Native Client provider) - SQL2005-2 has a database named 'filesearch' (with stored procedure named 'app_filesearch') and an index linked server named 'qasite1' From SQL20...more >>

Incremental update of a table from a view
Posted by Leo Demarce at 2/28/2007 10:42:21 AM
I want to create a package that will use the view of one database to insert data into the table of another database. I would normally empty the destination table, then insert the entire data from the source to the destination. Is there any way to simply update the destination with the data ...more >>

query
Posted by someone NO[at]SPAM js.com at 2/28/2007 10:42:07 AM
Hi, If I have Chinese data in SQLServer database, do you know how the sql should be? I tried the following: SELECT * FROM Customer WHERE NameChinese='$B@.gP3$L#(B' Please help. ...more >>

CLR stored proc ececution, missing Libraries
Posted by Panos Stavroulis. at 2/28/2007 10:01:00 AM
Hi, I've developed a small .net application library. Now I am trying to call the library from within a CLR stored proc. I've managed to make the stored proc working OK. However,I can't call the my ..NET component. To do this I need access to library Microsoft.VisualStudio.SourceSafe.Int...more >>

What should I see in execution plan
Posted by Tim at 2/28/2007 9:30:15 AM
I ran the SQL script and looking at the execution plan. I am not very clear what to see and diagnose for better performance. Please give me some suggestion/advise on this. Thanks, Tim ...more >>

Convert date
Posted by doug at 2/28/2007 7:56:21 AM
What is the best way to select a date field that returns 2007-02-28 00:00:00.000 as formatted as mmddyyyy or mmddyy? Thanks in advance....more >>

Installing SQL Express from command prompt
Posted by Si at 2/28/2007 7:48:48 AM
I'm attempted to run an installation of SQL Express 2005 from the command prompt. I've downloaded the redistributable SQLEXPR32.EXE and now want to get my hands on setup.exe, template.ini, etc.. that I will run from the command prompt. I can see them being created in a temporary folder when I ...more >>

Need Some Guidance
Posted by RON at 2/28/2007 7:47:17 AM
A SQL Server 2005 database has 4 tables - 'Products', 'OrderCart', 'CustomerDetails' & 'Basket'. The 'Products' table has the following columns: ProductID varchar(50) PRIMARY KEY ProductName varchar(50) Description varchar(200) UnitPrice money The 'Basket' table contains these columns: ...more >>

Job Activity Monitor tool
Posted by Tom at 2/28/2007 7:24:14 AM
can someone tell me what table or stored procedure that the Job Activity tool uses to show the activity for the jobs on the db server? I'm asking because I'm creating a web form that list all db servers on the network and all the jobs under SQL Server Agent, and I need to show the status of th...more >>

getting ACTUAL amount of space being used
Posted by Stimp at 2/28/2007 6:44:19 AM
Hi, I recently removed a considerable number of rows from my MS SQL Server database because I was getting quota warnings from my ISP. I'm aware that running the stored procedure: sp_spaceused gives me the total amount of space that is used by the database and index. The problem is th...more >>

Cascaded delete
Posted by Geert at 2/28/2007 2:38:27 AM
It's only a couple of weeks that I'm using Sql Server, and I have problems with the database integrity. This is our database situation : Dossier : PK SysId Config : PK SysId FK DossierSysId ConfigDescription : PK SysId FK ConfigSysId...more >>

ADODB 2.7: Problem with recordset timeout
Posted by Bodo at 2/28/2007 2:35:25 AM
Hi, I encounter a problem when I attempt to open a recordset against a SQL Server 2005 connection (Trusted connection) I run the following VBA code from an Access adp project with reference to Microsoft ActiveX DataObjects 2.7 Library. Dim rst As ADODB.Recordset, SQLStatementDetail As S...more >>

Invalid length parameter passed to the SUBSTRING function. Again :o)
Posted by onerror at 2/28/2007 12:33:25 AM
Hello I have a script that copies all eventlogs from servers to my sql2005. Now I want to extract some info. I want to get the Printername from the message column (varchar 1024). I use this query: select charindex(' was printed on ',Message)+ 16 as startpos, (charindex(' via port ', Messa...more >>

Same code in script as udf but udf is slower
Posted by Jeff at 2/28/2007 12:07:40 AM
Does anyone know why all of a sudden a udf is slower than just running the same code as a script? My problem is I have some code that when run as a script it take less than 1 second, but when I wrap the same code into a udf it take atleast 4 seconds. The udf is a scalar function and the server...more >>

SP1 before SP2?
Posted by Smokey Grindel at 2/28/2007 12:00:00 AM
do you have to install SP1 before SP2? We installed a new cluster and went straight to SP2 now auto updates is telling me to install SP1?! ...more >>

Convert mySQL file to MSSQL2005
Posted by Robert Bravery at 2/28/2007 12:00:00 AM
HI all, I have been given a myssql script file, that creates tables and does inserts. I need to run thi on our server, a rudementry import. Is there a quick and easier way of correcting the syntax so that this sql file could be run in MSSQL Thanks Robert here's a small example of the...more >>

select in like confused
Posted by Robert Bravery at 2/28/2007 12:00:00 AM
Hi all, I have the following query which works as expected select * from division where cast(divkey AS varchar(5)) in ('1327','1342','1411') or divkey = 1345 ORDER BY depth desc only problem is that the in predicate should look like '|1327|1342|1411|', which is a value in a particular fiel...more >>

placing an end of line char
Posted by Yan at 2/28/2007 12:00:00 AM
sql server 2005 sp1 I need to retreive the definition of routines stored in syscoments's text column and then ALTER the routine in an automataed way. The problem I face is that definition of routines come out in a sinle line which poses the following issue; the first commnet in the routine...more >>

Users & Column Access
Posted by hufaunder NO[at]SPAM yahoo.com at 2/27/2007 11:43:58 PM
I have a server/client application that has multiple users with different access rights to the data in a database. Access is granted on a column level. First I was planning on writing my own autorization/ authentication layer. Then I was told that the right way to do this is by creating views th...more >>

SQL Compare Alternative?
Posted by clintonG at 2/27/2007 10:18:11 PM
Do you know of any applications such as RedGate's SQL Compare that are less expensive or free? <%= Clinton Gallagher NET csgallagher AT metromilwaukee.com URL http://clintongallagher.metromilwaukee.com/ MAP http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=...more >>

FIFO type Queue in SQL Table?
Posted by Spam Catcher at 2/27/2007 10:11:37 PM
Hi all, I have a SQL table which needs to act as a "queue". Multiple threads/connections will be requesting the next record from the table. What is the best way to structure the table so that unique records dequeued to users (i.e. 2 users never have access to the same record). Would run...more >>

udf converting to char() and back
Posted by Carl Perkins at 2/27/2007 9:51:08 PM
I am having a conversion problem. See below: Code snippet from encryption routine: case @tvByteUnencrypted when 'a' then char(157) when 'A' then char(144) Code snippet from decryption routine: case @tvByteUnencrypted when char(157) then 'a' when char(144) then 'A' When executing ...more >>

manipulating employees punchtimes
Posted by ngorbunov via SQLMonster.com at 2/27/2007 9:32:48 PM
I have a table that keps tracks of employees punch ins and outs. [code] CREATE TABLE [EmployeePunch] ( [scalldate] [varchar] (20) NULL , [sEmployeeId] [varchar] (20) NULL , [TotalHr] [numeric] (10,4) NULL , [sLogin] [varchar] (20) NULL , [sLogout] [varchar] (20) NULL ) INSERT [Em...more >>

I could also do with some help with a SQL statement :o)
Posted by Rob Meade at 2/27/2007 9:12:31 PM
Hi all, I'm trying to construct a sql statement in my stored procedure. My application calls the stored procedure and will pass it a concatenated string containing guids.... These should 'not' be returned in the results of the query, the problem I'm having is the conversion between the ...more >>

Sophos Databases flagged as Suspect
Posted by Jon Rowlan at 2/27/2007 7:49:00 PM
I have a sophos (Antivirus) database installed by the Sophos software. The databases are flagged as suspect I do not seem to be able to run a "dbcc checkdb" .... the database cannot be accessed because it is suspect so I can't fix the corruption ??? It must be a 2000 MSDE install I guess...more >>

identify duplicate rows
Posted by FARRUKH at 2/27/2007 6:42:03 PM
we recently migrated the database. we have a huge tables rows and some of them have many duplicate records Is there any query to identify duplicate rows? thanks...more >>

2005 DTS
Posted by shank at 2/27/2007 6:32:08 PM
I have SQL 2000 and use Enterprise Manager - no problem! I just gained access to SQL 2005 for testing. Cannot connect to SQL 2005 With EM. I installed SQL Server Management Studio Express, connected, but I don't see where I can create DTS packages. I don't see any of the Wizards that were...more >>

how to dictate a query to use other index
Posted by loufuki NO[at]SPAM gmail.com at 2/27/2007 5:22:19 PM
Hi, I have a table with two non-clustered indexes. by default, the query use the first index. How do I dictate the query to use the other index? Thanks ...more >>

Serialization
Posted by shapper at 2/27/2007 5:05:47 PM
Hello, I have a class in my ASP.NET project. I made this class Serializable. I now need to Serialize it and sent it to an SQL 2005 database table. Does anyone knows such examples? And what data type should I use in SQL 2005 to hold this? Image? Thanks, Miguel ...more >>

parsing string >8000 char in MSSQL 2005?
Posted by alonzo at 2/27/2007 4:37:56 PM
Hi. I need to parse/replace/manipulate strings > 8000 characters. I understand you really can't accomplish this w/o breaking up the string into smaller pieces, but all the references i found in this group are for MSSQL 2000 or older; are there any new ways to deal with this in 2005? ...more >>

Problem with stored procedure
Posted by Ragnar Midtskogen at 2/27/2007 4:33:09 PM
Hello, I am having a problem with a user procedure in an SQL Server 2000 DB. The procedure should update some columns in a table for the record that matches the WHERE statement. When I run the proc I just get the message '0 records affected'. The proc is run from an Access 2000 DB by using ...more >>

after the upgrade to sql server 2005
Posted by JJ at 2/27/2007 3:29:13 PM
After upgrading from sql server 2000, I read that i need to update statistics and rebuild indexes. Are there commands that do this for all tables? Are there anything that I need to do after the upgrade that I am forgetting? Thanks ...more >>

Sytem SP for finding indexes in a database?
Posted by Claudia at 2/27/2007 3:27:13 PM
I have searched BOL & must not be using the correct verbage.. How can I search a database for all indexes in a database? I am confident it is a system sp or some kind of call to the system tables.. Thanks in advance, Claudia....more >>

platform independent sql
Posted by bringmewater NO[at]SPAM gmail.com at 2/27/2007 3:25:49 PM
Is it possible to write sql that is able to work on MS SQL 2005, Postgres and MySQL without translation or modification? ...more >>

Service Broker messages stuck in sys.transmission_queue
Posted by Terry at 2/27/2007 2:42:08 PM
Hello, I'm testing service broker on two machines in the same domain. I'm using windows authentication. When I begin a dialog on serverA the message is immediately put into the sys.transmission_queue with a blank transmission_status, and is_conversation_error = 0. Also, I specified the br...more >>

Column Description in Metadata
Posted by Tim at 2/27/2007 2:26:11 PM
I'm trying to create an end-user style data dictionary. In the Table Designer you can enter a description for a column. How can you get it back? I can get extended properties for tables but can you do the same for columns, (I don't think columns have extended properties, but I've been wrong...more >>


DevelopmentNow Blog