all groups > sql server programming > august 2007 > threads for thursday august 16
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
table transformation hint
Posted by GB at 8/16/2007 11:28:44 PM
Hello,
I have the table:
INSERT INTABLE(DATADATE,K1,K2,K3,IND) VALUES(convert(datetime,'2000-01-01
00:00:00.000',121),'33','21','45','A ')
INSERT INTABLE(DATADATE,K1,K2,K3,IND) VALUES(convert(datetime,'2000-02-01
00:00:00.000',121),'28','28','41','A ')
INSERT INTABLE(DATADATE... more >>
Calling an MS ACCESS report from TSQL
Posted by Harry at 8/16/2007 10:34:00 PM
Hi all
Can any please advise if this can be done and if so were do i start to look.
We have an inventory system that is a MS Access 2003 ADP front end and
SQL Server 2000 Back End we also use scanning software for some business
processes which uses SQL Replication to Push Pull the data between ... more >>
Wierd performance problem.
Posted by Griff at 8/16/2007 9:39:36 PM
I have a stored procedure that takes in several arguments. I don't think
that the following is relevant, but the internal workings of this stored
procedure are to perform some logic based upon the value of the input
arguments. This logic then dictates which "daughter" stored procedure to
c... more >>
HELP! Need to find info on AccPac databases! (OT)
Posted by Rico at 8/16/2007 8:24:13 PM
Hello,
Can anyone here tell me where I can find a database diagram and
documentation on the AccPac database? I'm trying to find budget information
and can't seem to find it! Any help would be greatly appreciated.
Thanks!
Rick
... more >>
Trancate data in all tables
Posted by qjlee at 8/16/2007 8:16:13 PM
Hi, I need to truncate the data in all tables (80 of them altogether) in a
database called test. Any simpler way than just trancate one table by one
table.
Thanks,... more >>
Split Column
Posted by d4 at 8/16/2007 6:29:28 PM
I have a table with values:
Id Value
1 10;11;12;14
2 20;31;42;54
3 30;61
I need to split this out so it becomes:
Id Value
1 10
1 11
1 12
1 14
2 20 ... and so on
Any ideas?
CREATE TABLE T1 (Id int,Value varchar(... more >>
how to convert string to datetime datatype
Posted by mitra at 8/16/2007 6:22:03 PM
Earlier today I posted a question about how to convert a string containing
weekday date, and time like: 'Tue, 19 Sep 2006 13:13:15 -0500'
to a datetime data type like, ' 2006-09-19 13:13:15'.
I figured using an editor to get rid of the weekday before importing the
data into a temp table. No... more >>
how to convert HEXA into Float in SQLSERVER
Posted by Sushil Badyal at 8/16/2007 6:22:01 PM
Any one has idea how to convert HEXA into Float in SQLSERVER
Like:
declare @a float
set @a=4
select convert(varbinary,@a)
Result: 0x4011333333333333
But I want to convert This Hexa(0x4011333333333333) value into Float
select convert(float, 0x4011333333333333)
but th... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Incorrect syntax in try catch
Posted by wdudek at 8/16/2007 6:21:20 PM
Iv'e been attempting to use a try catch block in my procedure but am getting
an erorr "Incorrect syntax near", can anyone see what I'm doing wrong? I've
posted a sample of the code below. Also I am on 2005, here is the @@version
info.
Microsoft SQL Server 2005 - 9.00.3054.00 (Intel X86) ... more >>
Growth Issues
Posted by CLM at 8/16/2007 6:19:52 PM
I noticed that my predecessors have a file growth of 1G on a 1.5 terabyte
database! I know that the rule of thumb is that file growth (for small or
medium sized databases) should be about a tenth of the database size and of
course it's best if you can size it so you don't need growth.
But ... more >>
runtime error messages
Posted by edger at 8/16/2007 6:14:39 PM
Is there an accessible explanatory listing of runtime error messages for SQL
Server?
My current problem is that (in SQL Server Mgmt Studio), when I execute
sproc1 which executes sproc2, I get error 8144: "Procedure or function sproc2
has too many arguments specified." I don't think that ref... more >>
having a defined constant in a script
Posted by Brian at 8/16/2007 6:10:00 PM
I want to be able to abstract out statements like the following without doing
exec's.
For example I want to do something like this:
declare @dbname varchar(30);
set @dbname = '[MyDatabase]';
delete from @dbname.[dbo].MyTable
I don't want to do this:
exec ('delete from ' + @dbname + '... more >>
SELECT TOP(@n) vs SET ROWCOUNT @n
Posted by BGL at 8/16/2007 6:05:46 PM
I'm on Microsoft SQL Server 2005 - 9.00.3042.00 (X64).
I read on a blog that 'SELECT TOP' is more efficient than 'SET ROWCOUNT'.
http://blogs.vertigo.com/personal/alexark/Blog/Lists/Posts/Post.aspx?ID=7
"TOP is more efficient than SET ROWCOUNT because the query will stop after
it has
the f... more >>
Slow inital results from result set in 2005
Posted by Geoff at 8/16/2007 6:00:37 PM
We are trying to port over a legacy application to 2005 from 2000. We don't
have control over how the selects are generated from this program (coded in
the binaries) and we have noted a huge performance loss when running the
application on 2005 as compared to 2000 [same hardware and data].
... more >>
how to parse a delimited text string into segments
Posted by Stephanie at 8/16/2007 5:58:33 PM
I have a text column that is a concatenation of values separated by bars (|).
For example: 7899D4328578J7B|798733|CGE070109|024
I would like to be able to pick out each segment by number. For example,
the first one would be 7899D4328578J7B, the second one would be 798733, etc.
I may have... more >>
How to convert string containing weekday name to datetime
Posted by mitra at 8/16/2007 5:43:48 PM
Hi All,
I need help converting a string that contains the weekday name 'Tue, 19 Sep
2006 13:13:15 -0500' to a datetime data type, ' 2006-09-19 13:13:15'.
The statement below works when the string does not contain the weekday name:
SELECT CONVERT(datetime,(CONVERT (varchar(20), '19 Sep 200... more >>
Help needed!!!!! SQL server 2005 configuration
Posted by Anup.Haryani NO[at]SPAM gmail.com at 8/16/2007 4:56:09 PM
Hello friends,
I am extremely pissed off with the SQL server 2005 configurations..
I am not able to connect to the Server and its giving me following
error,
An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by t... more >>
dynamic sql
Posted by prasad.may NO[at]SPAM gmail.com at 8/16/2007 3:45:43 PM
i have a procedure which generates an sql dynamically.
the procedure accepts a number as parameter and based on that reads
the metadata table and generates a sql
here is the sql:
INSERT INTO DELTA_INV.dbo.T (journal_id, change_type, SNO, EMPID,
EMPNAME) (
select 78 as journal_id, 1 as chan... more >>
When to (or not to) create index on Temp Table
Posted by at 8/16/2007 10:34:37 AM
I found that when I index my temp table it runs faster. However, my
application architect told me that if I do a merge then I don't need
to but it help when I have a hast join.
Just want to verify this with some experts.
Thanks
... more >>
Trigger
Posted by sweetpotatop NO[at]SPAM yahoo.com at 8/16/2007 9:31:36 AM
Hi,
I am new to trigger, may I ask what do I have to do when a row is
added or updated to a table (table1) then
the trigger will update/add a new record of another table (table2)
which add say 4 to table2's field, f1
something like
if this is a new record
INSERT INTO table2
(f1, f2, ... more >>
Converting Oracle NEXTVAL to SQL Server
Posted by KSheehan at 8/16/2007 8:48:49 AM
I have to convert an Oracle script to MS SQL Server 2000 and found
that the following INSERT statement is causing issues in Query
manager, specifically with the 'NEXTVAL' call:
INSERT INTO plusdsplan
(plusdsplanID, revisionnum, hasld, langcode, DSPLANNUM,
DESCRIPTION, ORGID, SITEID, CHANGE... more >>
Sorting different in Union
Posted by tshad at 8/16/2007 8:32:22 AM
How do you order by a different direction in different selects that are put
together with a union. I realize this select is incorrect, but what I am
trying to do is order the first select by date in desc order and in the
second select order by date in asc order. Something like:
Select nam... more >>
how to lock table for certain period for exclusive use
Posted by Rajesh at 8/16/2007 7:28:35 AM
how to lock table for certain period for exclusive use. I have a
stored procedure where a lot of table are updated. while in progress
no other user or procedure should write to those files. They must wait
till the tables are unlocked.
Rajesh
... more >>
Passing a columns value to a stored procedure
Posted by Jacko at 8/16/2007 7:11:52 AM
Hi,
I quite new to stored procedures and I have a trigger that calls one,
I must pass the value of a column to the stored procedure. The stored
procedure allows a string parameter in, but using this code.
EXECUTE sp_settriggerdecked @doc = "tpn.dbo.scans.docket"
passes the text tpn.dbo.s... more >>
Must declare the variable in SQL
Posted by sweetpotatop NO[at]SPAM yahoo.com at 8/16/2007 6:51:04 AM
Hi,
I got
"Must declare the variable '@ct_table'." error when I try to run the
following the SQL Server Analyzer, so what goes wrong?
Declare @ct_table VARCHAR(20)
Set @ct_table = 'ct_ameob02'
select * from @ct_table
Thanks in advance.
... more >>
Find max(integer) type
Posted by ganesh at 8/16/2007 4:40:38 AM
Hi There,
Is there anyway to find out maximum of integer type without hard
coded.
I need something like Max(datatype)
drop table #t
go
create table #t (val varchar(10));
insert into #t values ('35');
insert into #t values ('65.99');
insert into #t values ('099');
insert into #t v... more >>
Newbie: Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Posted by Dan Bridgland at 8/16/2007 3:30:35 AM
When I run the following sql statement I receive this message "Only
one expression can be specified in the select list when the subquery
is not introduced with EXISTS."
I'm sure this is a common error that Newbie's like myself post about
all the time, However I've read posts and user guides re... more >>
SP_CONFIGURE - 'awe enabled'
Posted by Yan at 8/16/2007 12:00:00 AM
Hi,
SQL Server 2005 Standard Edition sp2
I have a 12GB server which I have changed the server wide configuration
settings to allow AWE.
Using the Perfmon Memory Manager object I can see that the server now
consumes over 4GB of memory and in addition the Memory object's Avalable
Byte... more >>
stored procedure question
Posted by Mike at 8/16/2007 12:00:00 AM
I'm helping out on a .NET web application and the lead developer is also =
creating the stored procedures to get the data, inserts, etc. I'm =
looking at some of the procs to make some changes and I noticed all of =
the stored procedures are using Temp Tables. Doesn't using temp tables =
cause '... more >>
Remove trailing chr(160)
Posted by Morten Snedker at 8/16/2007 12:00:00 AM
In a field called productname I have trailing spaces. However these
spaces have char value 160 and a RTRIM won't do.
How do I remove these trails?
Regards /Snedker... more >>
Database Mail sql 2005
Posted by Antonio at 8/16/2007 12:00:00 AM
I have a DB named Contacts. The users I have made originated from the
Security tab of the server. The user now shows up under the DB
contact as well as all the others. However, I do not want the user to
be in all of the DB's. Database mail works under these conditions but
it is not what I wa... more >>
Passing a list of names, and a where clause
Posted by New Bee at 8/16/2007 12:00:00 AM
OK, heres the scenario.
I have to write a Stored Procedure to check for records against a list of
usernames. The usernames are without spaces, like ABCDE5.
1.) How do I check multiple names in one statement
I know this sounds simple, but if I pass a string of comma seperated valued
for e... more >>
|