Viewing 15 posts - 31 through 45 (of 66 total)
You are quite right. I am learning something small or big everyday. I was in the middle of inventing SQL crosstab reports tools. And I came up with the lengthy solution....
February 26, 2007 at 2:26 pm
As I do not have your full detail and sample data of the tables, I have to guess.
select PinPackages.PackageName [Package],
CONVERT(VARCHAR(25),TransactionDate,101) As [SaleDate],
datepart(hh,TransactionDate) As [MilitaryTime],
Count(*) As [Count] --
February 26, 2007 at 2:15 pm
You need cross-tab query and a temp table as follows:
SET NOCOUNT ON
-- Drop tables if alraedy exist
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Table1]') and OBJECTPROPERTY(id, N'IsUserTable') =...
February 25, 2007 at 8:11 pm
You already have the clue in your SQL:
select PinPackages.PackageName,
datepart(hh,TransactionDate) As [MilitaryTime],
Count(*) As [Count]
FROM dbo.Suppliers INNER JOIN
dbo.Batches ON dbo.Suppliers.SupplierID = dbo.Batches.SupplierID INNER JOIN
dbo.PinPackages ON dbo.Suppliers.SupplierID = dbo.PinPackages.SupplierID INNER JOIN
dbo.Pins...
February 25, 2007 at 6:57 pm
Check if you have UPDATE permission on myTable. I cannot think of anything else.
February 25, 2007 at 6:39 pm
Sorry, I missed count.
Use this script to include count:
SET NOCOUNT ON
-- Drop tables if alraedy exist
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Course]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop...
February 25, 2007 at 6:27 pm
You need cross-tab query which SQL does not provide yet. You need to create script as below:
SET NOCOUNT ON
-- Drop tables if alraedy exist
if exists (select * from dbo.sysobjects where...
February 25, 2007 at 6:16 pm
I understand now clearly. You may save the package at the end of the package execution by adding an ActiveX Script Task as below.
Function Main()
Dim oPkg
Set oPkg = DTSGlobalVariables.Parent
oPkg.SaveToSQLServer "Server",...
February 25, 2007 at 4:54 pm
This is 3 step process as follows:
Function Main()
' Initialise variables first
DTSGlobalVariables("FilePath").Value = "\\Server\Directory\FileName." & CStr(Year(Date)) & Right("0" & CStr(Month(Date)),...
February 25, 2007 at 3:52 pm
I thought I could replace the Excel table name dynamically using Global Variable but Excel syntax is different from SQL syntax. So I failed to deliver which could have been...
February 25, 2007 at 3:05 pm
Sorry, you need this script for table and data population:
-- Create table [TestItem]
if exists (select * from dbo.sysobjects where id = object_id(N'[TestItem]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [TestItem]
Create Table...
February 22, 2007 at 10:10 pm
This is something like cross-tab report technique. Do try script below:
DECLARE @Col1 Varchar(50)
DECLARE @sql Varchar(5000)
DECLARE @Num INT
DECLARE Fields CURSOR FAST_FORWARD FOR
SELECT Col1 FROM TestItem
GROUP BY Col1
ORDER BY Col1
SET...
February 22, 2007 at 10:05 pm
Hi, I am not too certain if I understand when you say "when I run it from the designer and save the package, the value saves".
Do you mean the value is...
February 22, 2007 at 5:41 pm
You must provide more information which will include
February 22, 2007 at 4:54 pm
Try this:
--
SET NOCOUNT ON
-- Create Temp Tables
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Detail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Detail]
Create Table [dbo].Detail
(PATIENT varchar(50) NULL, WARDNAME varchar(50) NULL,...
February 22, 2007 at 4:42 pm
Viewing 15 posts - 31 through 45 (of 66 total)