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 2005 > threads for tuesday february 22

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

Help required: Using OLE Automation SPs
Posted by Jamie Thomson at 2/22/2005 9:46:05 PM
Hi, I am using the sp_OACreate, sp_OAMethod, sp_OASetProperty etc... SPs to execute a piece of dynamic SQL. My dynamic SQL needs to return a resultset so I basically did the following: SET @vSQL = 'SELECT * FROM MyTable' EXEC sp_OAMethod @vObject, 'ExecuteWithResults', @vResult OUTPUT...more >>


Bit of help with a small project i have
Posted by Craig G at 2/22/2005 9:28:14 PM
hi, im basically looking some advice here for a small project we have. basically im looking at automating an attendance register in short want i want to do i build a matrix of students attendance on a course. this table of data will then be used to populate a Datagrid. Course Duration can vary...more >>

trigger
Posted by Jason at 2/22/2005 9:18:40 PM
Hi, Can someone provide me a simple trigger where it updates a lastmodified column. It should update the column lastmodified whenever an update occurs on all the other columns. Thnx ...more >>

SQL Server system date?
Posted by John Baima at 2/22/2005 8:57:30 PM
Is there a way to return the system date of the SQL Server? If I use SELECT GETDATE() as Today that returns the date of the client workstation. I would like to know if that date is more than a day before or after the date on the server. Is there a way to get that date?? -John ...more >>

Parsing comma delimited values from ntext field
Posted by Amit Vasant (MS, MCSD, MCAD.Net) at 2/22/2005 8:29:04 PM
I have a long comma delimited string (more than 8000 characters). like this "<SomeXML1>, <SomeXML2>, <SomeXML3>, <SomeXML4>". I need to parse through them and store them in different rows of same column. The only input parameter I can use is text/ntext since there are more than 8000 characters...more >>

How to design SP with variable number of params?
Posted by Brett at 2/22/2005 8:25:23 PM
I have a form that allows a user to update contact info. For example: First name Last name PO Box City State There are actually more fields (up to 50) but I have only used five for simplicity. Sometimes a user will submit an update for all fields. However, for a web service, some one m...more >>

How to concatenate fields from mutiple records
Posted by culam at 2/22/2005 5:43:01 PM
table1 id message 1 abc table2 id message 1 cde 1 fgh 1 ijk Desired result id message 1 abcdefghijk...more >>

Question about SUM and Nulls
Posted by mike at 2/22/2005 5:36:05 PM
I'm doing what I thought was a simple GROUP BY summary of fairly simple data and the my numbers aren't working out Some results are showing up <NULL> when I know the data is in the database I'm no SQL expert, but if I'm summing (SUM) multiple fields and adding them together in my SE...more >>



how to store a word document in sql
Posted by Ricardo Le Roux South Africa at 2/22/2005 4:38:24 PM
I Need help on how to store a word document in sql server.what datatype and how to convert it to store it. Pleas Help Thank you ...more >>

New bie to Trigger ?
Posted by mahesh at 2/22/2005 4:05:49 PM
first of all i like to know how to write trigger ? any reference is greatly welcome. here is my situation. When ever user submit my application for insertion of data, sometimes duplication occurs, i mean same row is inserted twice becoz of user refreshing the page or trying to save once again p...more >>

Problem with accents while executing query through OSQL
Posted by Stijn Verrept at 2/22/2005 4:03:19 PM
I have a text file named query.sql In this text file is the following command: Insert into [FixedText] ([FT_ID], [FT_TextNL], [FT_TextFR], [FT_TextUK]) values(1464, 'Domiciliëringen', NULL, NULL) Then I execute this text file using OSQL -E -i query.sql When I check back in the database ...more >>

sql satements
Posted by tayolad at 2/22/2005 4:03:03 PM
HOW CAN I GET THE FULL LISTING OF ALL THE SQL STATEMENTS?...more >>

Get 1st Value in Group
Posted by David C at 2/22/2005 3:38:57 PM
I have a grouping view and I want to be able to get the 1st value in a column. In Access I would use First(colname) but I couldn't fing anything similar in BOL. Thanks. David ...more >>

Audit Tools?
Posted by Justin at 2/22/2005 3:06:42 PM
I would like to generate a report detailing permissions of users and groups per database on my server. What would be the best way to go about doing this ? (I dont want to do this through enterprise manager). A SQL Script to do this would be PERFECT :) Thanks, Justin ...more >>

I need to join some additional columns from SQL Server into the worksheet ...
Posted by JohnnyAppleseed at 2/22/2005 2:56:42 PM
Accounting has provided me with an Excel worksheet with several columns of data, one of which is AccountID. There is a table in SQL Sever which also has AccountID. I need to join (using AccountID) some additional columns from SQL Server into the worksheet as new columns, save, and then send the ...more >>

Is there an easier way to do this?
Posted by Brandon Lilly at 2/22/2005 2:43:05 PM
I have a table full of several thousand rows. I want to assign a sequence number based on the number of distinct groups of column values... In this case, Critical & Period, where critical is a bit and period is number from 1 to 12. I have a solution, but I was curious if I was making it more...more >>

How to get the result of an Exec (@Sql) into a temp table.
Posted by Geir Holme at 2/22/2005 2:18:05 PM
Hi all. I am working on some crosstab logic and needs to get my result into a temporay table for further use and joins later in the prosedyre. It is dynamic crosstabs so I don't know the number of columns on beforehand. After my logic I can get a result that looks nice in QueryAnalyzer usning...more >>

Order by with specific record on top
Posted by tshad at 2/22/2005 2:15:47 PM
I have a routine that is displays my record in date order. I want to be able to put a specific record from that set of rows on top, with the rest in date order (as it is now, but without the one I moved to the top. For example, I have the following select: Select JobID, jobTitle = (jo...more >>

Regarding indexes (I think)
Posted by Gary at 2/22/2005 2:15:30 PM
I have an issue where i can do the following Select count(*) from table and it returns 181,000 Select count(*) from table where ncolumn is not null and it returns 174,000 Select count(*) from table where ncolumn is null and it returns 153,000 Now, those numbers should at up to the count...more >>

OpenXML XPath question
Posted by Jeremy Chapman at 2/22/2005 2:09:50 PM
I've included the xml and my OpenXML statement below. Using XPath in the WITH portion of the OpenXML statement I can retrieve most values I need, but I am trying to retrieve the values 'Last Name of Client' and 'First Name of Client' from the xml and am not having any luck. I tried using '..' a...more >>

Changing Recovery Type db_option for all Databases on server
Posted by JaneDoe at 2/22/2005 1:49:01 PM
I have about 29 servers that I need to set all db_options for, and they will be the same on all servers. Do you know the syntax for changing all database recovery types to "simple"? Also, I need to change all db_options for AutoShrink to "false". I don't want to go one by one, so I was ho...more >>

query still not solved
Posted by apok at 2/22/2005 1:36:47 PM
yesterday i had requested for q query that was not working and the solution that i got was to concanetate the two fieds to get the distinct count here is DDL create table test( empid int), productid varchar(10)) insert into test values(22,'ABCDEF') insert into test values(22,'ABCD...more >>

Need to add serveral large text fields that will exceed the 8k row size limit
Posted by moondaddy at 2/22/2005 12:36:07 PM
I have a table which has 5 remarks fields which need to be a minimum of 2000 in size each. I have been using varchar(2000) for 3 of them, but need to make 2 more 2000 in size also. Should I be using a different data type for this? How do people get large blobs of text into a table row? T...more >>

Union of two tables in different databases from within a VB6 application
Posted by smeechie NO[at]SPAM yahoo.com at 2/22/2005 12:18:35 PM
>From within SQL Query analyzer, I can create the union of two different tables located in separate databases (on the same server). This works fine. How can I achieve the same result programmatically (using VB6)?? Since the tables are in different databases ... do I need one connection string fo...more >>

object name invalid after ##tabletmp creation
Posted by liyangat at 2/22/2005 11:33:51 AM
I have a VB6 application that use SQL server with ADO 2.5, the connection is established with sa account. The program executes succesfully a command that creates a temporary table: CREATE TABLE ##CC1234 ( IDTmp int NOT NULL IDENTITY (1, 1), AlphaKey varchar(16) Collate database_default NUL...more >>

CAST vs CONVERT
Posted by Mike Hodgson at 2/22/2005 11:09:20 AM
What's your opinion? Should I encourage our developers to use CAST or CONVERT? Personally, I would think CAST should be preferred since it's the ANSI SQL-92 syntax and CONVERT should only be used where you need to specify the datetime conversion "style" when converting to a string. -- *m...more >>

Extended Stored Procedures developed in .NET?
Posted by Jon Pope at 2/22/2005 11:08:04 AM
Is it possible to create an extended sproc for SQL2K using .NET (ie C#, VB.NET, etc)? All of the examples I've found focus on C++. Cheers, Jon ...more >>

Sql Time
Posted by Arne at 2/22/2005 11:03:03 AM
How can I convert SQL datetime to civilian time in a select statement? The statement below gives me only military time SELECT CONVERT(CHAR(12), dtLastAction, 108) FROM OrderedItems...more >>

Combine record?
Posted by Sam at 2/22/2005 10:59:55 AM
I want a string that consist full account number as follow: account_num = 300.111000.10 But table only consist of the following: -gbmcu : 300 -gbobj : 111000 -gbsub : 10 So how to combine gbmcu,gbobj and gbsub into account_num? I had tried this T-SQL but fail : update Bank_Accoun...more >>

Add fields vs. Join new table
Posted by Debbie at 2/22/2005 10:51:39 AM
Is there any sort of rule of thumb for this situation? I have a fairly large table in my database (currently 21 fields with over 800,000 records and growing) that is selected from, inserted to and updated fairly often. I am adding some new features and cant decide if it would be more efficien...more >>

sotred procedure
Posted by Yoshitha at 2/22/2005 10:38:49 AM
Hi i've created one table and one stroed procedure to insert data into that table. i've created table like this table Name=QA_QAuthor EmailId Varchar primarykey. Pwd varchar Comments varchar allows null values paypalacc varchar all...more >>

Collation problem
Posted by Vincent at 2/22/2005 10:26:17 AM
How can I set the database can read english, chinese Traditional and chinese simplified? Thanks ...more >>

Where clause question ?
Posted by Agnes at 2/22/2005 10:16:00 AM
I got a 6 long insert sql statment in one SP. e.g (insert..... select... where issuedate<@date) Now, I need to set another where clause condition..but with the same inser statment e.g (insert..... select... where transdate<@date) I think it is not good that I copy the 6 same statment and t...more >>

what's the logic?
Posted by Ed at 2/22/2005 10:13:03 AM
hi, I have 1 GB Log file, after I backup the log file I issue a CHECKPOINT command and the log file is back to 30MB used and 970 MB Free. Then I want to release part of the MBs back to the Operating system. I issue the DBCC ShrinkFile(2, 100), and it doesn't change anything. Then I backu...more >>

How to cut string into units of 50?
Posted by Brett at 2/22/2005 10:07:39 AM
On a SELECT from a varchar(250) column, I want to insert <br> at every 50 characters. For example, if the string is 151 characters long, it would look like this: ....<br> ....<br> ....<br> .... The text in this column is URLs. I'm inserting line breaks at each 50 characters to keep ...more >>

table data link - "add extra field" vs "new table with a key"
Posted by R Reyes at 2/22/2005 9:33:02 AM
hi, i have to add a photo path field to our database so that we can view/associate client pictures with their personal data. my question is, is there an unwritten rule that says whether or not we should add a new table (TBL_CLIENTPICTURES for example) with the client's ID as the key link to...more >>

using SET in VB code
Posted by G Dean Blake at 2/22/2005 9:27:43 AM
I'm trying to resolve an issue involving the need to SET ARITHABORT ON in vb code. kbid=305333 says that the way it should be coded in VB code is: myconnection.execute SET ARITHABORT ON This does not work, of course, because there is no execute method for the connection object. This is...more >>

sql vs excel
Posted by Nikolami at 2/22/2005 9:24:16 AM
Does anyone know solution for this: if I insert recordset into database, depends on datetime, other record will be change value. Something like this: If I insert new record with datetime other record will change value and the same is when I update some record. 1;Nik;02.19.2005;1000;50 ...more >>

reconcile two tables
Posted by Peter Newman at 2/22/2005 9:17:05 AM
i trying to reconcile a log against files we recieve in from our clients. HeaderRecords contains the file Headers and DayRecLogs is the daytime log I need to show all files recieved that day and check tere is an enrty in the DayRecLogs for that file and if the reports were generated and sen...more >>

Error using MAX() - linked server to Orcl
Posted by lmcphee at 2/22/2005 8:11:02 AM
I have a linked server to an Oracle 9 db using MS OLE DB Provider for Orcl. When I query "select MAX(IntColumn) from ..." I get the error below when IntColumn is NUMBER(5) or NUMBER(38) in Orcl, but not when it is NUMBER(9). No error for simple "select IntColumn from ..." on same tables. The ...more >>

IDENTITY_INSERT
Posted by MOHAMED NASEER at 2/22/2005 6:53:02 AM
dear jeff johnson , thanks for ur response. I have one table name fixtures in client machine .In that table one column is identity type .now i am insert one Row from server database to that client database now i have to on the identity_insert in client machine from server machine give som...more >>

Simple locking question.....
Posted by len at 2/22/2005 6:47:02 AM
Here's a simlple enough question: If somebody is deleting from a table in SQL (with a simple DELETE FROM... TSQL query), will there be a lock on this table such that another process can't - UPDATE that table - DELETE from that table - SELECT from that table (not sure about this one)...more >>

LIKE %another field%
Posted by dhnriverside at 2/22/2005 6:11:02 AM
Hi I have a db field that I need to use to find a selection of records, based on whats in that field. The problem is that this field can contain a string of multiple values... "value&value&value&&" I want to test this against a field in another table.. WHERE table1.field = table2.fie...more >>

CREATE RULE for a Default Type
Posted by Dr. Paul Caesar - CoullByte (UK) Limited at 2/22/2005 5:07:02 AM
Hi all, Using: SQL Server 2000 SP3A Enterprise Edition I have setup a table that holds application information. One of the fields holds the Applications Version Information. I have created a default type called Version of nvarchar and length 43. Version information is made up of 2, 3 or...more >>

Extended Stored Procedure
Posted by mtgoli at 2/22/2005 5:05:03 AM
Dear Mike I've created this sp through Enterprise Manager. and when I execute sp_addextendedProc it show me Error message: Server: Msg 2714, Level 16, State 7, Procedure sp_addextendedproc, Line 26 There is already an object named 'xp_Session' in the database. ...more >>

extended stored procedure
Posted by mtgoli at 2/22/2005 4:43:02 AM
Hi I execute an extended stored procedure in Query Analyzer and it show me this error message: ODBC: Msg 0, Level 16, State 1 Cannot load the DLL C:\WINNT\system32\Project1.dll, or one of the DLLs it references. Reason: 126(error not found). I've copied my dll (Project1.dll) to C:\WINNT\...more >>

Disaster Recovery
Posted by Earnie at 2/22/2005 3:25:04 AM
Whilst importing some procedures, I have left the 'Transfer Dependent Object' checked and the 'Drop Destination Objects' result I have over-written certain tables Can it be undone with the transaction log and if so How ? regards Earnie...more >>

Calling Stored Procedure from a stored procedure on where clause (URGENT!!!)
Posted by ozcankanbur NO[at]SPAM gmail.com at 2/22/2005 3:17:40 AM
I need a stored procedure that include dynamic where clause. so I created these two sp. GetCampaigns calls Checkvalues sp to complete where clauseb but it doesn't work. any idea ? CREATE PROCEDURE GetCampaigns (@CampaignTypeId int,@CardTypeId int) AS SELECT Campaigns.* FROM Campaigns WHE...more >>

Trigger script out problem
Posted by Sammy at 2/22/2005 1:57:02 AM
Hi does any one have a script that can script out all triggers in a database then delete all triggers in a database as I need this for a replication problem I have thanks for any help Sammy...more >>


DevelopmentNow Blog