all groups > sql server programming > september 2006 > threads for monday september 25
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
Whats the right approach for getting a job
Posted by suraj at 9/25/2006 9:29:05 PM
Hi All,
I am sorry if am cross posting but just wanted to get the right answer
for this. I have a experiece of 15 years yes i am a old man now. Most
of exp is in electrical field. After 15 years for various reasons i
want to swithc to Softwares.
After consulting many of my freinds who ar... more >>
need query
Posted by pradee at 9/25/2006 8:21:10 PM
can anybody help to give query
table which consists of emp.eno,sal fields
the query which returns top 2nd sal of emp
... more >>
creating triggers (when columns updated or deleting too many rows)
Posted by ryan332211 NO[at]SPAM hotmail.com at 9/25/2006 5:00:43 PM
I have a database with 300K rows, each row has 80 columns. I would
like to:
1. update one of the columns "LastUpdateColumn" whenever one of 10
specific columns have changed. This column would have a timestamp
field. This will give me a representation of the last time one of the
10 critica... more >>
SQL Server 2005 bug re: Temporary tables in insert trigger?
Posted by Don MacKenzie at 9/25/2006 4:36:17 PM
Is there a known bug with using temporary tables in triggers? The following
works on SQL 2000, but in 2005 it returns a "severe error":
CREATE TABLE [dbo].[Test](
[Code_Id] [int] IDENTITY(1,1) NOT NULL,
[Test_Text] [varchar](1024) NULL,
CONSTRAINT [PK_Test] PRIMARY KEY CLUSTERED ([Code_... more >>
Outlook Express Spell Checker
Posted by Mike Labosh at 9/25/2006 4:18:24 PM
You might all be amused that in a reply to 'Edit - Validation function',
Outlook Express picked up 'sp_OACreate' and auto-suggested 'Lacerate'.
Are you feeling the irony? Or perhaps the lack thereof? Now I have to wipe
coffee off my screen.
--
Peace & happy computing,
Mike Labos... more >>
CASE Statement (SQL 2005)
Posted by Brian VanDyke at 9/25/2006 2:50:52 PM
I know I'm doing something trivial, but I'm having difficulty performing
this CASE statement. If I format it this way...
CASE Expr1
WHEN 300 THEN 'A'
WHEN 200 THEN 'B'
WHEN 100 THEN 'C'
WHEN 0 THEN 'D'
ELSE NULL
END
However, I want to get a range h... more >>
Shrinking Logs
Posted by CLM at 9/25/2006 2:32:01 PM
I know that, in general, you don't want to mess with shrinking logs when the
database is in FULL mode. However, I've noticed that a few of my databases
(in SS 2000) get a bloated log probably from an excessively long transaction
or the like. So in those cases, I'd like to shrink the logs dow... more >>
Most Recent Numbers
Posted by gavin.walters NO[at]SPAM gmail.com at 9/25/2006 2:28:10 PM
In one of our SQL tables, we have a column for cost, and through the
year there have been several updates made to this cost number and there
are now multiple cost numbers for various products.
I need to do a query that only returns the most recent cost numbers for
the year. I have periods and... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
SQL INSERT problem with AS returns unknown field name
Posted by brief4niels NO[at]SPAM hotmail.com at 9/25/2006 1:23:51 PM
Hello All,
I have a table (called tblExport03) with the fields: ID, Title, Name,
Address, BusinessEmailAddress, PrivateEmailAddress, NoMassMailing and
some other fields which are of no importance...
Then I created this awesome SQL query (took me about 2 day's ;-) which
selects all Unique Bu... more >>
Edit - Validation function
Posted by iano at 9/25/2006 12:38:09 PM
I hope someone has already written the function I need. Have you ever
been so bored filling out a form that you just held down a letter and
let it fill every field on the form? I expect that we all have. So I
found some data today with a few rows where all fields were filled with
all 'f's.
N... more >>
Returning Rows as Columns from a Query
Posted by kenkhanh NO[at]SPAM gmail.com at 9/25/2006 11:41:57 AM
Hi,
I tried but can't think of a way to have the queried data appear the
way I wanted. My skills are limited to creating two-column queries.
Please help me w/ this one. My mind is in a confuse loop right now.
Below is the basic version of the problem I'm facing.
Let's say the joined table... more >>
Help with get record with Max date or null
Posted by Rick Shaw at 9/25/2006 11:38:25 AM
Hi. I need some help. I need to get the records of employees with a null
Termination date or if there is no null termination date, get the Max
termination date.
EmpNo Name TermDate etc...
-------- ------- ---------- ---------
1001 ... more >>
SQL Query Question
Posted by Bahman at 9/25/2006 11:30:02 AM
Hello!
I need a join between two tables. On two columns, the match is exact, e.g.,
a.field1 = b.field1 and a.field2 = b.field2
on the third field, the string value in a is either an exact match of b, or
b is a substring of a, so a.field3 = b.field3 would work but it would omit
all subs... more >>
SS2005: Truncating the log file
Posted by Craig HB at 9/25/2006 11:03:02 AM
In SS2000 I used this to truncate the log:
dbcc shrinkfile ('MyDatabase_Log', 2)
At 1st that worked in SS2005, but not anymore. It runs, but doesn't reduce
the file size. When I first installed SS2005, Shrink File in Management
Studio reduced the log file, but now that doesn't reduce it eit... more >>
how to add auto row count column to a Select statement on the fly?
Posted by Rich at 9/25/2006 11:03:02 AM
Hello,
I want to
Select col1, col2, col3 Into #temp from tbl1
but I need to add an auto row count column to the Select statement so I can
uniquely identify the rows and use #temp in a Not Exists clause. Say that my
Select statement returns 1000 rows -- I need the auto row count colu... more >>
Convert to DateTime format
Posted by shil at 9/25/2006 10:47:39 AM
Hi,
I have a value like 'Mon, 25 Sep 2006 10:00:00' saved in a varchar
field. How can I convert this to datetime format? I want the above
value to be converted to '10/25/2006 10:00:00 AM' format.
Thanks in advance.
... more >>
SELECT Triggers
Posted by Paul Keister at 9/25/2006 10:46:02 AM
I recently got caught on one of the limitations of SQL Server: no select
triggers. I tried to find a workaround using views and table valued
functions, but at this point I get it: there's no data manipulation allowed
as a side effect of a SELECT statement, period. (By the way, there is some... more >>
Create a temporary table within a view
Posted by srinivas.pasala NO[at]SPAM gmail.com at 9/25/2006 10:11:12 AM
Is there a way to create a temporary table within a view. Using a view
I should list the months between a date range and display the Month and
Year. I have a table with a start date and end date. I need to create
a view and display the table data with the months and year as rows. I
do not ha... more >>
Help with a query that turns columns to rows
Posted by Jim Abel at 9/25/2006 9:25:01 AM
I need help wit a query that is based on a flat file that I receive that has
all the data in a single row with many columns that will return 2 columns
Name and Number.
Can something like this be done with a single query or do I need to solve it
a different way?
The table script is scaled ... more >>
Alter Table - Adding column to large table
Posted by zomer at 9/25/2006 9:21:40 AM
Hi,
I have to add column to quite large table (10 mil rows... 2.5 gig).
When I try adding it thru the management studio.... i get this error.
- Unable to modify table.
Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Why I a... more >>
Create Table + OSQL Return Value
Posted by gopal at 9/25/2006 9:18:20 AM
Hi
Thanks, but the problme is we cannot/not allowed to update the SQL file
I need handle from OSQL arguments i am giving, i am giving the
following arguments to OSQL from my console application
string osqlArgs = String.Format(" /S {0} /D {1} /U {2} /P {3} /i
{4} /n /b", "local",... more >>
SQL Server Locking in Busy Periods
Posted by KerryC at 9/25/2006 9:10:02 AM
Hi
I have been having some issues with our website for the last few weeks. The
site runs well for the majority of the day but around lunch time when we have
more visitors to the site the speed of the site deteriorates dramatically.
For most of the day our stored procedure completes in under 3... more >>
Custom Active X script for Transform Data Task
Posted by GAMBIT_UK at 9/25/2006 8:55:06 AM
Hi guys,
Bit of a mission here, I have a table featuring a field name
called KEY we need to copy across from our staging environment to our
development environment. This is a reserved word though and bombs out
on us.
I use a custom made DTS package which interates throug... more >>
help writing query
Posted by dotnet dude at 9/25/2006 8:42:06 AM
I have a mapping table that I need to query to generate my report. The
table structure of the mapping table is as below:
Mapping table
m_id m_table m_dept org dept id table
1 1 1 1 2 1 2
1 1 1 ... more >>
End of Month function
Posted by Jay Bukstein at 9/25/2006 7:51:02 AM
Is there a Transact SQL that will return the last day of any given month?
Must be callable for Store Procedure, That all i do is supply the date.
Example if I call theprocedure like exec endofmonthfunction '042006' it will
return april 28. 2006.
... more >>
pass database name as parameter in stored procedure
Posted by sonny_ug at 9/25/2006 6:41:53 AM
I am new to stored proceedures, and am just beginning to get the hang
of them..I've written on that uses OPENXML to to a bulk insert into SQL
server 2000, and it works fine. My only problem now is how to specify
the database name at run-time. I have to create a new database and
tables dyanamical... more >>
Turning query results into a numeric value?
Posted by zashah NO[at]SPAM gmail.com at 9/25/2006 4:10:39 AM
Hi
We have a SQLConfig database that holds information centrally about all
the SQL Server machines globally (host name, IP add, databases,
clustered, version info etc.).
I've been asked to get the number of non-system db's for each SQL
Server. I can get a list of all the databases on each m... more >>
Generate SQL Script
Posted by Ramesh Subramaniyan at 9/25/2006 3:43:02 AM
hi to all,
i want to generate/save datas as sql
Ex
Sample -Table
SampleID SampleName
1 Bill
2 mercy
insert into sample( SampleID , SampleName)
Values(1,'Bill')
insert into sample( SampleID , SampleName... more >>
Transaction deadlocked
Posted by Cyril at 9/25/2006 3:40:02 AM
Hello.
Here is my problem (C# in Visual Studio 2005):
Inside the same transaction, I delete some lines in a table using a store
procedure.Then I use a SqlBulkCopy.WriteToServer() to write down new lines to
replace the deleted ones.
This works out fine on my test SQL Server 2000 but not on... more >>
Performance Tips Needed Please
Posted by S Chapman at 9/25/2006 2:47:06 AM
Our application allows the user to import data from various sources
into a SqlServer 2005 database. The application parses the source data
and writes to normalised tables. Typically one row of input data will
give rise to rows in three (related) tables.
1) At the moment I am using bog-standa... more >>
Question regarding sp_executeSQL.
Posted by Archana at 9/25/2006 2:32:40 AM
Hi all,
I am facing one problem regarding sp_executeSQL.
I have three variables say @c1,@c2 and @c3. I want to do similary kind
of processing for these three variable. So what i want is to do the
processing in while loop.
So i want to store value of these variables in one temporary variab... more >>
INSERT INTO from a text file
Posted by Susan S at 9/25/2006 2:10:47 AM
I have a text file that was created from some MySQL utility. Its
purpose is to build the whole database from that text file if something
happens to the database. I have no control on the way the text file is
built.
I have to take a section out of the text file and insert that
information into... more >>
Replication and IO question
Posted by betbubble NO[at]SPAM gmail.com at 9/25/2006 1:22:14 AM
We have two Sql servers that are in a local area network. Server A is
the publisher and distributor, server B is the subscriber.
We execute the same SP on A and B, the SP on A costs just 1 or 2
seconds, but the same SP on B costs 40 to 100 seconds. I executed
Select * from master..sysprocesses... more >>
Create Table - return value
Posted by gopal at 9/25/2006 12:42:16 AM
Hi,
I am running OSQL from my console application and i am using OSQL to
create tables/procedures.i have a problem,
when the OSQL is run first when a table is successfully created it is
not resturning any values
But i would like to check the return value.
If the table already exists re... more >>
|