all groups > sql server programming > march 2007 > threads for tuesday march 6
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
Adding Column in middle of a table
Posted by Jami at 3/6/2007 11:22:30 PM
Dear All
is it possible to add a column in middle of the table if yes then how
thanx
Jami
*** Sent via Developersdex http://www.developersdex.com ***... more >>
Using a SQL table as a work list for distributed clients
Posted by Mark Ingalls at 3/6/2007 10:06:04 PM
I'd like to use a single SQL table as a centralized queue for a set of
distributed clients. Each client will run a sproc that would return the
top X rows from the table that have not already been sent to another
client for processing. the sproc would also update that same set of
records ... more >>
what's wrong with my stored procedure
Posted by junior at 3/6/2007 9:41:40 PM
Hello,
Please tell me what's wrong with my stored procedure, it does not show
me any result, there may be some syntax problem
DECLARE @RC int
DECLARE @TerminalName varchar(1)
SELECT @TerminalName = '''"Terminal Manager'',''Real Termianl"'''
EXEC @RC = [HTMS].[dbo].[dt_SearchTerminalinfo_By... more >>
Pseudo Pivot Table with a twist
Posted by stumpy_uk via SQLMonster.com at 3/6/2007 8:12:45 PM
I have a table which is shows below as such.
Fields
----------
Counter_pk Primary Key
vchr_input
vchr_output
blah
blah...loads of other crap fields..
example
======
"1", "Brown, Blue, Black", "apple"
"2". "Brown", "Bannana"
"3", "Blue", "apple, Pear"
"4", "Black,... more >>
date compare
Posted by led at 3/6/2007 7:23:39 PM
hi
i have a this field [inicio] char type with mm/dd/yyyy date format and i
want to compare it with the today date
this sql statement ("UPDATE precos SET livre = 0 WHERE inicio <
convert(nchar,GETDATE(),101) ")doesn´t work .
thanks
... more >>
Constrains in SQL Server 2005
Posted by RickSean at 3/6/2007 5:42:03 PM
I have a table named Categoties. The following T-SQL creates a table having
identical structure as Categoties but named as New_Categoties.
CREATE TABLE [dbo].[New_Categoties](
[CATID] [nvarchar](16) NOT NULL,
[CATNAME] [nvarchar](20) NULL,
[CATTYPE] [nvarchar](2) NULL
CONSTRAINT [Categ... more >>
Consistency of row when reading with READ UNCOMMITTED
Posted by Eli Tucker at 3/6/2007 3:37:00 PM
Hello.
I have a question about the internal consistency of a single row during an
update statement when another connection is reading the data with a READ
UNCOMMITTED (also known as WITH(NOLOCK) ) isolation level.
Let me give a small example to illustrate my question.
Say I have a table... more >>
Cross-database user defined function
Posted by DWalker at 3/6/2007 2:34:33 PM
SQL 2000:
Database instance "Instance1" on server "Server1" has a table-valued UDF
called "UDF1". I can sign on to Query Analyzer, connect to Server1
\Instance1, using database Database1, and do this:
Select * From UDF1('12/31/2006')
And I get the results table. Good.
Opening a new ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
summing rows of a field in a SQL Server 2005 view
Posted by childofthe1980s at 3/6/2007 2:24:30 PM
Hello:
I have successfully created a view in SQL Server 2005. But, I found out
here on the Newsgroups board that views are not allowed to have "COMPUTE" as
a means of addings rows of a field (column) together.
I need to have the view have the ability to sum. You see, an application
th... more >>
How to force table lock error?
Posted by LineVoltageHalogen at 3/6/2007 2:10:29 PM
Greetings All, I want to know if it is possible to construct a
scenario using SQL such that:
thread 1 selects from table1 with the tablockx hint
thread 2 selects from table1 with the tablockx hint
but instead of having thread 2 wait for thread 1 to commit or rollback
I want thread 2 to thro... more >>
Please help with domain data
Posted by Al at 3/6/2007 1:03:05 PM
Can some one tell me what is "domain data". I am applying for a job and the
job description states that applicants must have domain data knowledge. I
understand that in a table, a domain includes not only the concept of
enforcing data types, but also the values allowed in the column. Or across... more >>
Error handling in SQL 2005 .. is this right?
Posted by SqlBeginner at 3/6/2007 1:00:12 PM
Hi,
I am using SQL Server 2005 as my application backend. As a thumb rule, I
have included error handling code in all my stored procedures. For ex: have a
look at an sample below.
Now I just want to know whether this is the right way of doing or is there
any better way of doing it?
L... more >>
sp_rename error on SQL Server 2005
Posted by RickSean at 3/6/2007 12:54:30 PM
EXEC sp_rename MyTable, MyNewTable;
The above script gives me the followin error; how do i get it to work?
Caution: Changing any part of an object name could break scripts and stored
procedures.... more >>
Mirroring server restore
Posted by kulkarni.ninad NO[at]SPAM gmail.com at 3/6/2007 12:40:27 PM
Consider this scenario i have 2 database servers both have sql 2005
installed and one of them is mirror and other one is principal. Now my
principal server goes down and mirror server comes back online. I
start doing my things up and starts applying the transactions to
mirror server. By that t... more >>
Try and Catch
Posted by Ken at 3/6/2007 12:36:14 PM
I used Try and Catch.
However it doesn't catch when error like this.
Msg 208, Level 16, State 1, Line 6
Invalid object name 'tblbackpodfpulatemcna'.
Isn't The Try block supposed to catch this kind of error alos?
If it is not then, what should I use to get this code work in case of
erro... more >>
Parse in SQL Server 2005 CREATE VIEW
Posted by childofthe1980s at 3/6/2007 11:42:36 AM
Hello:
I was able to successfully parse a query in SQL 2005. But, when I copy this
query into the CREATE VIEW statement in order to create a new view, I get an
error saying that SQL is unable to parse it.
Why is that? How can I get this view created?
Below is my query. Any help would... more >>
cleaning out non numbers from a field
Posted by Jeffrey42 at 3/6/2007 11:26:31 AM
I have a varchar that is supposed to be a phone number, the field
sometimes contains things other than numbers. I would like to clean
this up for a report I have to generate and was hoping there is some
way to do this without using a bunch of nested replace() statements,
also I don't have the a... more >>
DateAdd and DST
Posted by Mike M at 3/6/2007 11:07:18 AM
Hello,
What is the expected behavior of the following T-SQL:
declare @t datetime
set @t = '03/11/2007 01:59:00'
select @t as BeforeDST, dateadd(mi, 1, @t) AfterDST
My expectation was that the time would account for daylight savings time and
would have yielded an AfterDST of 3 AM.
U... more >>
Find file creation date
Posted by T Morris at 3/6/2007 10:51:25 AM
My T-SQL imports a text file. In the operations log table I want to record
the creation date of the imported file.
With T-SQL can I find the creation date of a text file?
Thanks,
Tom... more >>
Performance issue - Disk Queue
Posted by Moshe Rosenberg at 3/6/2007 10:46:14 AM
Hi,
I have been having performance trouble over the last few days with our SQL
server 2005. Queries are timing out. We made some changes a few days ago by
adding additional indexes to some tables and that seems to correlate to the
time the performance issues started. I checked counters and ... more >>
Maint plan delete not working
Posted by Mitch at 3/6/2007 10:16:17 AM
I've set up maintenance plans, and they are working fine until it comes time
to delete the old files. That does not work for .trn, .bak, or for .txt
files. Am I missing something in the setup? Even when I run the
xp_delete_file command manually, it says it runs successfully, but I look and ... more >>
Disk Defragment on SQL Drives
Posted by Nitin at 3/6/2007 10:12:02 AM
Is it a good practice to run DIsk Defragmenter on SQL User Database Drives
where lots of data gets added/deleted? ... more >>
How to change the format of my data?
Posted by MIB at 3/6/2007 10:01:05 AM
Hi,
My sources files are sending data with the following format 12.345.678,12-.
And I want to use this information as a decimal. What can i do if i want to
transform this value to -12345678,12.
Thanks... more >>
Change Management - Straw Poll
Posted by Chris W at 3/6/2007 9:43:13 AM
Hello, we are just getting started with creating/modifying database objects
(tables, indexes, stored procedures etc) and SSIS packages in SS2005. What
tools/products are people using with respect to change management and version
control? We are a relatively small development group with fewer t... more >>
DBREINDEX on SQL 2005
Posted by Nitin at 3/6/2007 9:16:08 AM
One of the large tables in SQL 2005 (100 GB), DBREINDEX operation bloated the
total database size from 537 GB to 800 GB. Any suggestions as to why would
this happen? Where can I look at the space allocated. I tried looking in
sys.allocation_units but still no clue after adding the number I saw... more >>
Raid 1+0 or 0+1?
Posted by Nitin at 3/6/2007 9:11:48 AM
For a very high reads and writes (Random - Since user db) on SQL 2005, Raid
0+1 better or 1+0 in performance?
-Nitin ... more >>
ORDER BY problem
Posted by MittyKom at 3/6/2007 8:56:08 AM
Hi All
I have a table Tab1 with column Col1 varchar (20) and with records as below:
Col1
B
E
F
G
I
S
I would like to select and order the records in the table in a way that the
record 'G' comes on top of the resultset as below:
Col1
G
B
E
F
I
S
--select col1 from tab1 ord... more >>
Query - Help
Posted by Karthik at 3/6/2007 8:56:03 AM
Hi,
I am quite new to SQL. I need a help with this query.
How can I get the top 3 salaries paid department wise? Sample data and table
structure below -
-- Sample Data
Create Table Emp
(
eid tinyint,
sal smallint,
dept tinyint
)
insert into emp values (1, 10, 1)
insert into em... more >>
XML Load in SQL SERVER 2005
Posted by mvp at 3/6/2007 8:53:22 AM
Hello Everybody,
I want to load XML file into sql server table from specific folder using sql
server 2005 database. Every day i will get XML file into that folder and i
want to truncate and load into same table.
Sample xml is
<?xml version="1.0" encoding="UTF-8" ?>
- <ROWSET xmlns:xsi=... more >>
nested SELECT CASE (if, then)
Posted by childofthe1980s at 3/6/2007 8:51:21 AM
Hello:
In the following script and specifically in the SELECT statement, I'm trying
to place an if,then statement to say "if UPR30300.PAYROLCD = 'HOUR' then
UPR30300.UNTSTOPY else if UPR30300.PAYROLCD = 'VACN' then UPR30300.UNTSTOPY
else 0".
I have tried working with placing a nested SEL... more >>
sysobjects name field padded w/ _'s
Posted by JayKon at 3/6/2007 8:44:16 AM
Sometimes when testing for temp tables, or stored procedures from sysobjects
I sometimes see the name of the object right padded with _'s, other times not.
for example (not sure if there are other examples):
create table #foo (col int)
select name from tempdb..sysobjects where name like '#f... more >>
smalldatetime format problem
Posted by Jon at 3/6/2007 8:09:31 AM
hello all,
I have a column of type smalldatetype in table a.
Viewing this table in Enterprise Manager you see the values in DD/MM/YYYY
(UK) format, however, if you do a SELECT dateColumn from TABLE A using Query
Analyser the results come back in YYYY/MM/DD (USA) format. Now, I've tried
C... more >>
–
Posted by iweb at 3/6/2007 6:30:20 AM
Use Case:
Say, the same crystal report can be used to show the records from three
different
databases. How to use the same crystal report (not 3 different crystal
reports) for
fetching and displaying the records from these three databases depending upon
different business validations… ... more >>
How to handle more than one SQL Queries in Crystal Report? - in AS
Posted by iweb at 3/6/2007 6:26:45 AM
Use Case:
Suppose a Quotation is to be printed where the details of the Quotation are
to be filled by fetching the records from different tables based on different
business validations. Can we use more than one SQL Queries for the same
crystal report to fetch different values from different t... more >>
urgent
Posted by tazeena farheen at 3/6/2007 6:06:57 AM
i need the query for converting the integer into float or vice versa
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com... more >>
Counting total workdays
Posted by StvJston at 3/6/2007 5:53:45 AM
I have a reporting requirement that I show the total number of workdays on a
project..
I can do a select Distinct and get the actual rows needed but haven't been
able to figure out how to total the rows with an aggregate function and
grouping
SQLServer 2000 and Attached DDL.
Thanks for... more >>
Case statement in sql server 2000
Posted by Archana at 3/6/2007 1:56:13 AM
Hi all,
I want to write case statement in sql server 2000.
What i want is in stored procedure i am passing one value. and this
value i have to compared means i have to put in case statement.
How will i do this? something like as below:--
declare @casefield varchar(800)
select case
... more >>
insert into linked server problem
Posted by kuNDze at 3/6/2007 12:30:22 AM
hi,
on localServer i execute this query
INSERT INTO table (A, B, C)
SELECT A, B, C FROM LinkedServer.myDB.dbo.table
everything is fine. But if i execute this one
INSERT INTO LinkedServer.myDB.dbo.table (A, B, C)
SELECT A, B, C FROM table
it is very slow. Is there any solution to... more >>
indexing columns used in where clauses
Posted by LeAnne at 3/6/2007 12:00:00 AM
I've created an application to process some documents in a file with the
following structure:
DocumentMailer (DocId Int (Identity), DocName varchar(20), DocDetails
VarChar(200), DocReceived datetime, DocSent datetime)
I need some suggestions on creating indexes:
- DocId column id an Identit... more >>
Copy Database Wizard : Where is it?
Posted by Oscar at 3/6/2007 12:00:00 AM
I own an MSDN subscription. After I installed SQL server 2005 I've noticed
that it shows SQL Server 2005 Express.
For a reason that I don't know it doesn't show a Copy Database context menu
right after right clicking at a database. I also don't see any wizard in
management. Do I need to install ... more >>
Integrated security
Posted by JJ at 3/6/2007 12:00:00 AM
I have 2 servers (named A and B and they are not part of the domain).
Server A hosts asp.net application (open to the Internet) and server B hosts
sql server 2005. Right now, I use connectionstring
"server=xxxxx;database=xxxxx;user id=xxxxxxxx;password=xxxxxxxx" to connect
to the sql server... more >>
MS Access / SQL Query
Posted by Sandy Nuts at 3/6/2007 12:00:00 AM
Hi,
I have a small, incredibly simple Access database that I'm using to keep
track of asset numbers of branch computer systems. The table tblBranchAssets
has the following fields:
branch_id[pk] - Branch number
server_asset: Server asset number
terminal1_asset: Terminal 1 asset
....
ter... more >>
|