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 > january 2005 > threads for thursday january 27

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

Trigger
Posted by souris at 1/27/2005 11:38:51 PM
When I have to choose to use trigger? Are there any document describe this topic? Thanks for the information, Souris ...more >>

Master Detail link
Posted by souris at 1/27/2005 11:29:21 PM
I have an application that needs to download a flat file from mainframe into master detail table relationship in SQL server. I am looking for a method to add a second primary key into my transfer query. It looks something like this "INSERT INTO MYTABLE1 (KEYFIELD1, KEYFIELD2) SELECT MYTA...more >>

Help On query Writting
Posted by kishor at 1/27/2005 11:17:02 PM
Hi all, I have a small query, Instead of writing query in English I am pasting here the expected output from a table. I want to have a single query without any function call. Please let me know whether it is possible getting this type of out put using single query without cursor/function......more >>

Sync data between OLTP data tables and OLAP fact tables.
Posted by Joel Leong at 1/27/2005 11:08:20 PM
I have my data in several data tables, I had built a view to aggregate the data from these data tables. This view is similar to a fact table in OLAP Analysis Services except it has no Fact ID (PKID). My OLTP Database in Server A which hold the several data tables and the view is stored i...more >>

sql query: query on values that are not there
Posted by valley at 1/27/2005 10:09:18 PM
I was wondering if it is possible if you have a table like : id | (other columns) -------------- 1 .... 2 .... 3 .... 5 .... 6 .... 8 .... to query this table and getting the following result Only showing the id numbers that are not there. id ----------------- 4 7 ...more >>

Retrieving database record with the lowest value in field aaa?
Posted by george.dainis NO[at]SPAM bluecorner.com at 1/27/2005 7:50:22 PM
How do I code a SQL SELECT statement so that always only this record is retrieved which matches a certain criteria AND has the lowest ID (= value in key field aaa)? It must me something like SELECT * FROM .... WHERE somefield='somevalue' AND aaa=lowestkey(column(aaa)) As a result either ze...more >>

Error: Contains more than the maximum number of prefixes. The max
Posted by inquisite at 1/27/2005 7:37:03 PM
I am running an update statement in query analyzer to update a database with data from another database on another server. I am running into the error : Error: Contains more than the maximum number of prefixes. Maximum is 3 How do I overcome this error. I am the admin on both servers....more >>

Unable to drop the database after dropping the republication using store procedure!!HELP !! HELP
Posted by victor at 1/27/2005 4:56:11 PM
hi there: i got a big problem here. i call serval store procedures from c# to drop a republication. the code likes following use [databaseName] GO -- Dropping the merge publication exec sp_dropmergepublication @publication = N'database_Publication' GO -- Disabling the replication da...more >>



using variables
Posted by Jason at 1/27/2005 4:41:04 PM
Hello, I was wondering how to use diffent variables in stored procedures for use in select queries. I've created one to look up data, but it doesn't work quite well because i need also to return null values. Can someone check if the following is correctly written? Here's the procedure: ...more >>

POSTED AGAIN- DISTRIBUTED TRANSACTION
Posted by Vijay at 1/27/2005 4:31:23 PM
Hi, I have two sql servers with SQL2000 service pack 3 which are linked by the "Link Server". When i use the "begin tran" (distributed transaction) in stored procedure, i am getting the following error. "Server: Msg 8525, Level 16, State 1, Line 1 Distributed transaction completed. ...more >>

ConCat data
Posted by HoosBruin at 1/27/2005 4:21:35 PM
I need to create a csv file where it's just one giant file. There is only one field I pull from a table called USerID(Char8). Then for every record in the table create a file like this. Receipents-c/n=XXXXX%Receipents-c/n=XXXXXReceipents-c/n=XXXXXReceipents-c/n=XXXXX This will then Impo...more >>

DTS problem: ActiveX Script Task Properties dialog box
Posted by John316 at 1/27/2005 3:07:52 PM
My ActiveX Script Task Properties dialog box has the "functions" window maximized and I can no longer get at my code. I can not find any way to resize it. Please .... If anyone has come across this and can help... it will be much appreciated. I've never had this happen before. Thanks i...more >>

How can I connect to my server over the internet
Posted by Joe at 1/27/2005 2:51:29 PM
I need to make connections from my app to the server in the office ...more >>

backup database
Posted by oeren NO[at]SPAM calcoastcu.org at 1/27/2005 1:51:21 PM
Hi, Below is my script and when I run it I get following error. What is causing this error? Thanks for your help. BACKUP DATABASE IntelSource TO DISK = 'C:\SQL\BACKUP\DIFF_IntelSource.BAK' WITH DIFFERENTIAL GO Error Message: Server: Msg 156, Level 15, State 1, Line 1 Incorrect sy...more >>

DISTRIBUTED TRANSACTION
Posted by Vijay at 1/27/2005 1:07:16 PM
Hi, I have two sql servers with SQL2000 service pack 3 which are linked by = the "Link Server". When i use the "begin tran" (distributed transaction) = in stored procedure, i am getting the following error.=20 "Server: Msg 8525, Level 16, State 1, Line 1=20 Distributed transaction c...more >>

subquery
Posted by js at 1/27/2005 1:06:10 PM
Hi, what is the syntax for subquery select * from (select * from tb1 T1) left join tb2 on T1.f1 = tb2.f1? thx ...more >>

blocking in sysindexes
Posted by Kevin3NF at 1/27/2005 1:01:04 PM
When a user ran this query: set nocount on select top 100 x1.a5plcr, x2.aiplcr from PRODDTA.F0301_vw x1, PRODDTA.F03012_vw x2 where (x1.a5an8 = x2.aian8) and x1.a5plcr <> x2.aiplcr --order by x1.a5an8 option (maxdop 1) We showed both Exclusive and Intent-X locks on sysindexes of the u...more >>

Enterprise Manager list databases
Posted by borko at 1/27/2005 1:00:53 PM
Hi everyone, Is there a possibility to block SQL user using Enterprise Manager from listing other databases on SQL server? Every user can see the list of databases but can change only his database. Is there a way to set it up just his own and nothing else. Suggestions, links, ... apprecia...more >>

Trace problem
Posted by Eric Tishkoff at 1/27/2005 12:15:03 PM
When running a trace, logical reads are not being returned. When the trace runs in Profiler, it shows 0 logical reads for all transactions. Writes also show as 0 (or, very infrequently, a value of 1) on procedures which insert or update. I have tried launching the trace script multiple time...more >>

Problem with regional settings I think
Posted by Lars Netzel at 1/27/2005 12:06:56 PM
I have a developer server (which we run ASP.NEt solutions against) it's an MSDE instance and then we have another "LIVE" server which also has an MSDE instance. We are using Crystal Reports to get Reports out of the Databases and the reports look different when we run them against the serve...more >>

code Sample
Posted by Sathian T at 1/27/2005 12:05:11 PM
Hello, Can someone help me with a SQL code sample to insert a Picture / Documentin image data field? Regards Sathian ...more >>

Searching Document
Posted by Sathian T at 1/27/2005 12:00:00 PM
Hello, I would Like to use SQL Server Programming for searching key words in the Documents in Word/Text files and gives the link to Document as a search result. What is the best method? The Option we thought is : Have the text contents of the files in Text field of the database and do a f...more >>

Query for an expert
Posted by Aleks at 1/27/2005 11:40:10 AM
I have been trying to find someone who can help me with this one and no luck so far. Maybe an expert can do it, here it is: I have a database with three tables, one table has "cases" the other table has "persons" and the other has the "links", There are more fields which are not relevant f...more >>

calling a function that declares a cursor multiple times within qu
Posted by eli silverman at 1/27/2005 10:59:03 AM
I have written a user defined function for the express purpose of concatinating two text fields together into one value. to do this I pass it a few criteria and it creates a cursor to return all rows matching the criteria. it then reads through the cursor saying retval = retval + fieldval t...more >>

Does Yucon support set ansi_nulls?
Posted by prabhakar at 1/27/2005 10:58:30 AM
Hi, I want to compare 2 fields in a table considering the equality of the fields even if NULL. eg:- table1 has fileds field1 and field2 field1 field2 1 abc abc 2 pqr NULL 3 NULL lmn 4 NULL ...more >>

What tools and methods should I use to identify SQL problems.
Posted by Phil at 1/27/2005 10:55:59 AM
Greetings wider SQLServer community. Rather than get a one off answer to my particular SQL problem I am more interested in how my betters would identify the cause. The problem: I have 5 servers running an app .. every 30secs they insert a record into table on a clustered SQL Server. If t...more >>

Can't delete full text catalog on clustered sql serer 2000
Posted by Ian at 1/27/2005 10:30:33 AM
Basically SQL Server has allowed me to create a full text catalog on a drive which is not part of the cluster's shared resources, and I believe doesn't exist either (I not familiar with clustering at all). Now the problem is that it now won't let me remove this full text catalog, giving me ...more >>

T-SQL: Using a variable as a column name gives bad results.
Posted by Dave James at 1/27/2005 10:09:02 AM
If I use a variable as a columname in a select statement I get a result that is different then if I use the column name directiy in the statement. Here's an example query: declare @StrVar as varchar(255) select @StrVar = 'UID' print @StrVar select count(*)as badcount from VERTISPSG wher...more >>

cast a date to string
Posted by js at 1/27/2005 9:27:54 AM
Hi, how to cast a date field to a string: select case(TrxDate, char(20)) & ' Add me' AS newfield from tb?? Thanks. ...more >>

is this Possible
Posted by Peter Newman at 1/27/2005 9:05:04 AM
I want to pass a table name to a query Declare @Tablename ?? Set @TableName = 'MyTable' Select * from @TableName how can i get this to work, if at all possible ...more >>

Arithmic Overlflow on division ?
Posted by deroby at 1/27/2005 8:53:04 AM
Hi there, we are experiencing some very unexptected behaviour here (SQL 2k, latest SPs, different types of hardware). Since our application is doing approximations we are trying to get as much detail as possible from the calculations. However, instead of getting better results with Numer...more >>

DTS Help
Posted by Andre at 1/27/2005 8:35:03 AM
I have a package that contains an Copy Objects Task. I want to have a step to check a value in another table before executing the copy task. Not sure how to accomplish this. Any help would be greatly appreciated. Thanks....more >>

Stored Procedure degraded to much slower than direct query
Posted by BD at 1/27/2005 8:31:06 AM
The problem I have boils down to the following: if I run the stored procedure by "exec sp_MyProc(@P1, @P2, @P3)" in Query Analyzer, it goes on forever (it did finish with half amount of data in about 15 minutes); if I run the statements in it directly after declaring and setting the parameters...more >>

Date Format
Posted by Jim Yurt at 1/27/2005 8:27:02 AM
How can you maintain consistance in generating output for a DATE datatype? example, JAN, when CAST as a varchar it becomes 1, NOT 01...more >>

fancy select needed.Thanks for your help!
Posted by Daniel Walzenbach at 1/27/2005 8:07:05 AM
Hi, I have a table like the following: ID | Name --------------------- 1 | Name 1 1 | Name 2 2 | Name 3 2 | Name 4 2 | Name 5 I now want to do a select which results in the following: ID | Name --------------------- 1 | Name 1, Name 2 2 | Name 3, Name 4, Name 5 Do...more >>

Transactions comtaining triggers
Posted by Wendy at 1/27/2005 8:03:05 AM
Hi, Having an issue with a transaction that has a trigger inside it. The transaction begins, the 1st step is the trigger fires to increment an identity column, then an update is done on the identity value to prefix it with a number. But before this update happens, the transaction is kic...more >>

Connection Broken Error
Posted by mvp at 1/27/2005 7:45:02 AM
Hello everybody, I am running a simple cursor and it has arround 10 thousand rows to loop. But after sometime i am getting connection broken error. Exact error message is as following. [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (WrapperRead()). Server: Msg 11, Level 16, St...more >>

Stored Procedure or what...
Posted by Enrique at 1/27/2005 4:23:02 AM
I do have a table with the following fields: Customer nvarchar 12 Serie nvarchar 3 Number int 4 Date datetime 8 Total real 4 Points real 4 This table records the tickets of a store. It records the serial and the number of the ticket, also the date, amount an points earned with this ti...more >>

Table Def's part two
Posted by Peter Newman at 1/27/2005 2:01:04 AM
Thanks for the help which ahs enabled me to get to this point select table_name , COLUMN_NAME, IS_NULLABLE, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_schema = 'dbo' and table_name = 'My_Table_Name' this produces most of the information i need, howeve...more >>

Index in view
Posted by JJFreds at 1/27/2005 1:55:02 AM
I 've 5 tables not indexed(must). Now i create 5 views for these with indexing. creating index only on views are possible, if so it can increase the performance od query. Can u give me the soln ?...more >>

create relationship between tables in different databases???
Posted by kongsballa at 1/27/2005 1:53:32 AM
Hi! I have two databases. They represent two different systems. Now the two systems will be merged in many ways. This means that there will now be need for relations between tables in the two databases. I have existing database diagrams for both, but is there a way to add tables in a diagram ...more >>

speed up query
Posted by JJFreds at 1/27/2005 1:19:02 AM
i 've one quey joining with 4 inner joins and and one left join and with where clause. query returns 5000 recs in 5 or 6 secs. i should get with in 1 sec. any conditions or jons have to be re arranged. Please tell me....more >>

SQL Tools to parse SQL scripts
Posted by Sanjay Pais at 1/27/2005 12:20:10 AM
Are there any tools out there that I can use to parse my SQL scripts and execute them if they are free from errors? Something along the lines of how query analyzer allows you to parse a script before executing it? Thanks in advance Sanjay ...more >>


DevelopmentNow Blog