Viewing 15 posts - 121 through 135 (of 172 total)
It is a good bit of work to include all of the columns.
However sql2005 allows you to right click the table and script insert. Then use the...
February 19, 2007 at 3:37 pm
Short and sweet, however SQL considers characters like . to be numeric.
create table #tmp( tc char(2))
insert into #tmp
select '11' union all
select '1a' union all
select 'a1' union all
select '1 ' union...
February 19, 2007 at 10:50 am
If your only working on char(2) the idea below is fairly straight-forward.
create table #tmp( tc char(2))
insert into #tmp
select '11' union all
select '1a' union all
select 'a1' union all
select '1 '...
February 16, 2007 at 1:28 pm
For product1 you have a total of 998.02
When you divide that by 5 you get 199.604 ~ average.
When it converts 199.604 to dec(15,2) you get 199.60.
When you multiply 199.60...
February 14, 2007 at 2:19 pm
I had the job of creating alpha-numeric barcodes for my current job. I controlled the data and used an identity column to feed the function below.
It is...
February 14, 2007 at 10:44 am
My 2 cents would to be remove the queries from the select and instead but them into derived tables
select ap.id, ap.descrip. ap.suggestedJobQty
, apr.yada
, aps.yada
FROM @ap
INNER JOIN
( select...
February 6, 2007 at 3:18 pm
MDAC MDAC MDAC...
Person onsite updated the MDAC to the latest version and viola!.
Daryl
January 29, 2007 at 12:17 pm
SELECT v.Description, b.branchName
FROM branchAssignmentTable bat
INNER JOIN Vehicle v ON v.uid = bat.VehicleID
INNER JOIN Branch b on b.uid = bat.BranchID
January 23, 2007 at 4:34 pm
I went in to db_datareader and db_datawriter and VIOLA! Got to get out of my box more often. It never occurred to me to add the new role...
November 21, 2006 at 1:34 pm
Steps:
create database role, add db_datareader and db_datawriter
Security (not under database)
create new SQL Server Authentication Login Name:'logintest'
Under UserMapping select target_database and created role.
[ok]
In the target_database I can find the new user/login...
November 17, 2006 at 3:56 pm
create table #tmp (id int identity, mydate datetime)
insert into #tmp (mydate) values (getDate())
select datepart(hh, mydate), count(*)
FROM #tmp
group by datepart(hh, mydate)
November 10, 2006 at 1:01 pm
If you need to have dynamic sql...
The code below should give you the results you are looking for.
create table tmp2004 (descID int, amt numeric, share numeric(4,2)
create table tmp2005 (descID int,...
November 8, 2006 at 12:58 pm
In the past I created a nightly process that kicked off jobs from a table schedule.
I wanted the sproc scheduler to kick off individual threads. I solved the problem...
November 7, 2006 at 2:06 pm
This should return a list of 'other' by listname and latest date.
create table #myLists
(id int identity, other varchar(20), listName varchar(20), insertDate datetime)
select listName, other, insertDate
from #myLists ml
INNER JOIN
(select...
November 7, 2006 at 10:46 am
Sorry about the double post, stupid firewall.
I like Sergiy's additional where comment i.status d.status
November 6, 2006 at 4:02 pm
Viewing 15 posts - 121 through 135 (of 172 total)