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 tuesday june 26

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

Save a table as a file from SQL2005 on the SQL-server
Posted by Xavier at 6/26/2007 11:58:01 PM
In a table T1 whith the fields: id-autonumber (1,2,3....100) MyFile-ntext i want to save the content of the field MyFile in a file with the name id on the SQL2005 server for example on drive c:\1.txt ,c:\2.txt ... Thanks, ...more >>


get stored procedures name
Posted by Xavier at 6/26/2007 11:52:00 PM
hi, in a stored procedures i want to use the name of it. How can this be done? Example: In the stored procedures "MyStoredProcedures" i want to set a variable with the name of it. SET @ActualSpName=??? Is there any system variable which contain this? After the variable was set it should hav...more >>

how best to use logins
Posted by garyrg9work NO[at]SPAM gmail.com at 6/26/2007 11:34:41 PM
Hi If you have a website with thousands or millions of login users is it best to create a sql login for each user? Or to use a common login and a separate login that is stored in the db that allows access to the sql login name. Gary ...more >>

Stored proc with result set
Posted by Larry Killen at 6/26/2007 9:39:55 PM
I have a stored proc to retrieve a dataset. I have tested the logic in a queary and know it shoudl return ~17,000 records. When I test the Stored Proc in the Man. Studio, I get one record. Obviously I am missing something. Thanks MS SQL 2005 Express USE [GaincoBS] GO /****** Objec...more >>

Retrieveing database names and cube names
Posted by emily s at 6/26/2007 7:18:03 PM
Hi group, iam new to this group, iam posting my problem in this group so that some could help me... My problem is that, i need 2 drop downs to be created one for initial catalog and the other for the cube names. The first drop down should contain all the initial catalogs from SQL Se...more >>

SQL 2005 Express vs SQL 2005: AutoIncrement propertiy
Posted by Alexander Gorbylev at 6/26/2007 6:19:18 PM
Dear Sirs, I work with SQL 2005 Express. And I think this theme periodically emerged: "AutoIncrementing UniqueIdentifier column in SQL database table giving NoNullAllowedException". Is this a "feature" only of SQL 2005 Express? I found on forum that ...."back to the original problem, I ha...more >>

Bulk Inserting UTF-8 files in SQL Server 2005
Posted by kenn.nguyen NO[at]SPAM gmail.com at 6/26/2007 6:12:09 PM
Hi, I'm trying to bulk insert a UTF 8 file that has some Greek characters in it. Here is an example line: 1332|iliopoulos@4-e.gr|=CE=91=CE=BB=CE=AD=CE=BE=CE=B1=CE=BD=CE=B4=CF=81=CE= =BF=CF=82 =CE=97=CE=BB=CE=B9=CF=8C=CF=80=CE=BF=CF=85=CE=BB=CE=BF=CF=82|=CE= =91=CF=86=CE=BF=CE=B9 =CE=A0=CE=B...more >>

Creating refernces between tables
Posted by Roy Goldhammer at 6/26/2007 5:37:11 PM
Hello there I have two tables that i need to add reference between them The foreign table exist at the same server but on diffrent database. Is there a way to force references between two tables on diffrent database? ...more >>



assign result of select to a variable
Posted by .nLL at 6/26/2007 5:20:10 PM
i 've got following sp to count online users. ------------------------------------------------------- create PROCEDURE [dbo].[sp_onlines] @siteid nvarchar(50) As SELECT Count(sessions.siteid) as totalonlines from dbo.sessions where sessions.siteid=@siteid; -----------------------------...more >>

Question about db filenames from SQL Server 2000 to 2005.
Posted by Ken Varn at 6/26/2007 5:02:03 PM
I have encountered a bit of a compatibility problem with my code ever since I have migrated to SQL Server 2005 Express from MSDE 2000. I have depended on the filenames for data file and log file to consist of DBName_Data.mdf and DBName_log.ldf. When calling sp_attach_single_file_db, my cod...more >>

Using SmoApplication.EnumAvailableSqlServers don't obtain all instances in local computer
Posted by tiempotecnologia NO[at]SPAM newsgroup.nospam at 6/26/2007 4:53:07 PM
Hi I'm trying to obtain all instances of sql server in local computer, but SmoApplication.EnumAvailableSqlServers only obtain some of the installed instances. If I use WMI I can't see another instances? Any suggestions? TIA Rodrigo Juarez ...more >>

SQL Agent Jobs hanging - SSIS packages
Posted by Rocco at 6/26/2007 3:56:02 PM
I'm having an issue in SQL Server 2005 with jobs that execute SSIS packages. The jobs run fine for a week or so, then I'll come to find that four or five (of the ten or so jobs) are hung in "executing" status. They seem to hang indefinitely (as some have been "executing" for hours with no en...more >>

SQL Server 2000 to 2005 optimization
Posted by Smokey Grindle at 6/26/2007 3:17:01 PM
At one point we ran a command cant remember if it was a dbcc one or not, but it was supose to help optimize databases that where converted from sql server 2000 to 2005... anyone remember what this is? I think its some type of optimization command... wanted to do some research on exactly what i...more >>

sql server 2000
Posted by Wendy Elizabeth at 6/26/2007 2:31:01 PM
I would like to know how to automate the following two processes with excel: 1. I would like to take data that is obtained from 9 to 15 sql server 2000 queries results and load the detail data onto excel spreadsheets. Each query would be a different tab (worksheet) in the excel spreadsheet...more >>

Database modeling question
Posted by TheDoor at 6/26/2007 2:09:55 PM
Hey all I have an assignment where I have to model a simple database with pupils. Each pupil must in turn have a 1-n relationship to other pupils (the friends table). So far I have this model: ********** * pupils * ********** * id * * other fields omitted... ********** ********...more >>

string comparison equality
Posted by dba at 6/26/2007 1:34:56 PM
Hello All, I have a rejections table that I need to compare to another table to show which field changed and why it was rejected. With integer columns this is easy, I can just select (a.field1 - b.field1) as DiffField1 but I also have a BatchID and bunch of strings I need to do the same ty...more >>

Concatenation
Posted by Susan R at 6/26/2007 1:15:02 PM
HI, I am trying to take this statement from a Cobol program that takes a date in a number format of CYYMMDD and converts it to a date format so that date calculations can be done on it. I am trying to do this in SQL on the SQL tool supplied with RS. How do I write this in an SQL statement to ...more >>

Using Multiple Case branches in a Where statement
Posted by Kirk at 6/26/2007 11:53:39 AM
This SP will be passed a value called "pSearchField", which I want to use to determine what field to search by. If this field is not something I expected in my Case statement, it will search all fields. @pSearchVal as nvarchar(40) = Null, @pSearchField as nvarchar(40) = Null ) AS SELECT ...more >>

Trigger does not appear in Triggers node. Where is it?
Posted by K. Abit at 6/26/2007 10:17:49 AM
I have a working trigger that acts on update. It has been there since ver 2000 and I upgraded to 2005. In the 2005 Management Studio, there is a node called "Database Triggers". When I expand that node, there is nothing there. Where is my trigger? I need to modify it but I can't even reme...more >>

ALTER TABLE
Posted by Brett Wesoloski at 6/26/2007 9:52:52 AM
I need to alter a table adding a couple columns. Not a problem I know how to do that. But I need these columns to go in between other columns. Is this possible? Or do I have to dump the data into a temp table delete the table and re-create the table the way I want it to look and then put...more >>

Problems with PERMISSION_SET = EXTERNAL_ACCESS
Posted by jitsu NO[at]SPAM post.cz at 6/26/2007 8:51:04 AM
Hi all, I have a function for communication between SQL server and an application server of another database via HttpWebRequest. I aslo have to use a certificate for this communication. This function works when an ASSEMBLY with PERMISSION_SET = UNSAFE is created in MS SQL Server 2005, but wh...more >>

Concatenate values from two tables, one using count(*)
Posted by Rob at 6/26/2007 8:46:01 AM
I am trying the concatenate the values from two tables in a single output. Something like this (incorrect syntax): SELECT CONVERT(VARCHAR(10),MAX(H.BATCH))+CONVERT(VARCHAR(10),COUNT (D.*) FROM HEADER H, DETAILS D From The first table, HEADER, I'm trying to fetch the MAX batch number, whi...more >>

If - Then - Else construct in Where clause - how to apply?
Posted by Rich at 6/26/2007 8:37:02 AM
Select * from tblx Where ... If (middleInitial is not null or middleInitial <> '') then fullName = FirstName + ' ' + middleInitial + ' ' + LastName Else fullName = FirstName + ' ' + LastName How to build/use If Then Else construct in Where clause? Can I use Case When in a Where clause ...more >>

Relative sequence problem
Posted by J. M. De Moor at 6/26/2007 8:28:46 AM
Hi Simplified version of the table in question looks like this: CREATE Templates ( template_id INT NOT NULL PRIMARY KEY ,descrip VARCHAR(20) NOT NULL ,class_code CHAR(1) NOT NULL ); INSERT INTO Templates VALUES (1, 'AAAA', 'C'); INSERT INTO Templates VALUES (2, 'AAAB', 'D'); INSER...more >>

return performance
Posted by cris at 6/26/2007 7:58:00 AM
hello, i'm trying to create a query that will return a recordset as quickly as possible. my table is structured in this fashion. the only parameter the user selects is the date. id1 id2 date $ 001 901 2007/01/15 100 001 902 ...more >>

Aggregate and concatenate varchar columns
Posted by joker197cinque NO[at]SPAM gmail.com at 6/26/2007 7:13:39 AM
Sql server 2000 Is there a way to execute a simple group by for single field AND obtain also for other column a list of concatenated values? I mean in this query: use northwind go SELECT [CategoryID], <some_concat_function_for_product_name> as CONCAT_COL FROM [Products] GROUP BY [Catego...more >>

Excel crashes when VBA window is closed
Posted by j.dambrauskaite NO[at]SPAM gmail.com at 6/26/2007 7:01:56 AM
I am facing a quite strange problem. I have written a VBA code which is called using Command Button. It opens the SQL database and retrieves some numbers which are entered into excel cells. Surprisingly, the code works if the VBA window is open. If it is closed, the code returns empty cells. All...more >>

order
Posted by farshad at 6/26/2007 5:19:02 AM
Hi, There is a field called contractMonth in a table called table1. The datatype of this field is varchar(50). The data is something like: Apr 2007 June 2008 Sep 2007 .... How is it possible to order this field. For example I would like to retrieve something like the following: Apr 200...more >>

Running a Batch File in Query Analyzer
Posted by IT Developer at 6/26/2007 4:54:03 AM
Hi, I have to run a batch file in query analyzer. How do I do that. I don't want to use 'xp_cmdshell' Please advise (An example would be great) Regards IT Dev...more >>

Dynamic SQL and a cursor
Posted by Jaco at 6/26/2007 4:16:01 AM
Hi I wrote a cursor for the part of the dynamic SQL that is too long for varchar(8000). It all works fine but I have to put this into a stored procedure. When I run the code below with the print statements it give me what I want ie. CREATE VIEW DBO.auditEVENT_Deleted AS SELECT Col.*...more >>

sql profiler trace file
Posted by ofirmgr at 6/26/2007 3:27:32 AM
im trying to understand how the profiler works. so i started 2 profilers,one listen to another and I saw the profiler is running: exec sp_trace_create @P1 output, 1, NULL, NULL, NULL which means @tracefile = NULL so where from the profiler read the results?! ...more >>

Database Design
Posted by Jeremy Martin at 6/26/2007 3:10:30 AM
Hi, Just looking for some advise design principles... If I have a detail table that just keeps getting bigger (order of 500000 records every 6 mths) and that table is also queried the most should I a) Archive to different tables ie (Detail2007,Detail2008) etc b) Create a view that shows ...more >>

SQL 2000 date format problem after server migration from W2k to W2
Posted by Maciej07 at 6/26/2007 1:38:01 AM
Hello, We are using SQL server 2000 on W2k Server and MS Access 2000 ADP (like front-end). Now we try to change operating system for SQL Server 2000 from W2k to W2k3 and we found problem with date format – we receive error: “Cannot convert date type varchar to datetime”. Datetime u...more >>

Get total seconds from DateTime field
Posted by Adrian at 6/26/2007 12:00:00 AM
SQL Server 2000 How may I get the total seconds (or minutes and seconds) from a DateTime field containing values such as: 000:03:01 000:00:55 000:00:59 000:01:02 Thanks for any help. Adrian. ...more >>

UDF - your comments please
Posted by Gerard at 6/26/2007 12:00:00 AM
Hi, Because I'm using sp_add_jobschedule in some of my code (stored proc) I came up with the function below so that a user who wants to add a job schedule for a given date & time does not have to do the conversion from date or time to an int. It may all sound a bit superfluous but not all o...more >>

problem with Alter database
Posted by Roy Goldhammer at 6/26/2007 12:00:00 AM
Hello there I have a process that alter database in order to load and unload service broker. To the current database there are some processes that run as sleeping. If i do alter database the processes will be killed and error will be sent to users at event viewer. What mean that i ha...more >>

How IN clause is working...
Posted by -pb- at 6/26/2007 12:00:00 AM
Hi, Can anyone explain how IN and NOT IN claue is working if the data for the clause is passed from the stored procedure? I got a table e.g. table1 with 2 columns e.g. Col1 and Col2 both of type varchar(100) Col1 Col2 AC1 AC2 BC1 BC2 CC1 CC2 ... ,, I got a SP which selects t...more >>

Stored Procedure: Make temp-table with "dynamic" columns?
Posted by Øyvind Isaksen at 6/26/2007 12:00:00 AM
-------------- Info: -------------- I am making a CMS solution and need help to get out an article list. The reason why this is a bit tricky is because articles does not have the same fields stored in one static article-table. In tblArticle all standard information about each article is s...more >>


DevelopmentNow Blog