[SQL Server 2008 issues] pre requisities to install cluster |
- pre requisities to install cluster
- Help using like operator
- Automatically connect to new data source in SSRS 2008
- What is pivoting
- LOB and OLTP
- Combine data from 2 tables and insert in another table
pre requisities to install cluster Posted: 14 Apr 2013 06:14 PM PDT What are the pre requisites to install cluster in sql 2008 |
Posted: 14 Apr 2013 04:06 PM PDT I have a tablecreate table accounts(accname varchar(100),recstatus bit)and records are as follows:Insert into accounts values ('Pepsi Co',0)Insert into accounts values ('Pepsi Co',0)Insert into accounts values ('Prudential',1)Insert into accounts values ('Lennox International',1)Insert into accounts values ('Eurosystems (Harveynash Inc) [OLD]',0)Insert into accounts values ('ETJ Holdings, inc. [OLD]',0)Insert into accounts values ('I-nnovate [OLD]',1)Insert into accounts values ('Iflowsoft, LLC [OLD]',1)Insert into accounts values ('1st OBJECT Inc [OLD]',0)Insert into accounts values ('Jet Aviation Holdings, Inc [OLD]',0)Now i want to get the values of the table whose accname contains [old].So please help me |
Automatically connect to new data source in SSRS 2008 Posted: 14 Apr 2013 07:10 AM PDT Hi,I have lots of reports created using the version SSRS 2008 and the Data Source is ORACLE. All the reports are connected to one DB server. But soon db sever is going to change. So whenever there is a change in the db server I want all the reports to be automatically connected to that new server. So I don't need to individually change the data source of all the reports manually. Please help me to find a solution to this problem.Thanks in advance! |
Posted: 14 Apr 2013 04:11 AM PDT What is pivoting?Por example:"An attribute of a dimension is not a good candidate for a nonclustered index key. Attributes are used fro pivoting and typpicaly contain ony a few distict values"" |
Posted: 14 Apr 2013 01:30 AM PDT Hi Guys,I have see people talking about relational databases as OLTP but now I have started to ear people talk about LOB database.Are they exactly the same thing?Thanks |
Combine data from 2 tables and insert in another table Posted: 14 Apr 2013 01:52 AM PDT I have following 3 table definition with data[code="sql"]SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE TABLE [voucherDr]( [srno] [int] IDENTITY(1,1) NOT NULL, [vouchertype] [nvarchar](50) NULL, [voucherprefix] [nvarchar](50) NULL, [voucherno] [int] NULL, [drparty] [int] NULL, [dramount] [float] NULL, [invoicetype] [nvarchar](50) NULL, CONSTRAINT [PK_voucherDr] PRIMARY KEY CLUSTERED ( [srno] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GOSET IDENTITY_INSERT [voucherDr] ONINSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (1, N'PURCHASE', N'P1213', 1, 5, 8114.4, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (2, N'PURCHASE', N'P1213', 1, 3, 324.58, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (3, N'PURCHASE', N'P1213', 1, 4, 81.14, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (4, N'PURCHASE', N'P1213', 2, 5, 21904.8, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (5, N'PURCHASE', N'P1213', 2, 3, 876.19, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (6, N'PURCHASE', N'P1213', 2, 4, 219.05, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (7, N'PURCHASE', N'P1213', 2, 5, 5595.25, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (8, N'PURCHASE', N'P1213', 2, 3, 223.81, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (9, N'PURCHASE', N'P1213', 2, 4, 55.95, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (10, N'PURCHASE', N'P1213', 2, 5, 12087, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (11, N'PURCHASE', N'P1213', 2, 3, 483.48, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (12, N'PURCHASE', N'P1213', 2, 4, 120.87, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (13, N'PURCHASE', N'P1213', 3, 5, 7800, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (14, N'PURCHASE', N'P1213', 3, 3, 312, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (15, N'PURCHASE', N'P1213', 3, 4, 78, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (16, N'PURCHASE', N'P1213', 4, 5, 102900, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (17, N'PURCHASE', N'P1213', 4, 3, 4116, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (18, N'PURCHASE', N'P1213', 4, 4, 1029, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (19, N'PURCHASE', N'P1213', 5, 5, 10714.3, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (20, N'PURCHASE', N'P1213', 5, 3, 428.57, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (21, N'PURCHASE', N'P1213', 5, 4, 107.14, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (22, N'PURCHASE', N'P1213', 5, 5, 10476.2, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (23, N'PURCHASE', N'P1213', 5, 3, 419.05, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (24, N'PURCHASE', N'P1213', 5, 4, 104.76, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (25, N'PURCHASE', N'P1213', 5, 5, 1408.08, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (26, N'PURCHASE', N'P1213', 5, 3, 56.32, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (27, N'PURCHASE', N'P1213', 5, 4, 14.08, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (28, N'PURCHASE', N'P1213', 5, 5, 3714.3, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (29, N'PURCHASE', N'P1213', 5, 3, 148.57, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (30, N'PURCHASE', N'P1213', 5, 4, 37.14, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (31, N'PURCHASE', N'P1213', 5, 5, 5500, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (32, N'PURCHASE', N'P1213', 5, 3, 220, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (33, N'PURCHASE', N'P1213', 5, 4, 55, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (34, N'JOURNAL', N'J1213', 1, 1, 10000, NULL)INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (35, N'PAYMENT', N'PY1213', 1, 2, 8520.12, NULL)INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (36, N'SALES', N'S1213', 1, 25, 3900.01, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (39, N'RECEIPT', N'R1213', 1, 1, 3900, NULL)INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (40, N'RECEIPT', N'R1213', 1, 9, 0.01, NULL)INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (49, N'SALES', N'S1213', 2, 25, 5906.25, N'TAX INVOICE')INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (62, N'SALES RETURN', N'SR1213', 1, 31, 5625, NULL)INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (63, N'SALES RETURN', N'SR1213', 1, 6, 225, NULL)INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (64, N'SALES RETURN', N'SR1213', 1, 7, 56.25, NULL)INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (65, N'CASH MEMO', N'CM1213', 1, 1, 71, NULL)INSERT [voucherDr] ([srno], [vouchertype], [voucherprefix], [voucherno], [drparty], [dramount], [invoicetype]) VALUES (66, N'SALES', N'S1213', 3, 25, 15750, N'TAX INVOICE')SET IDENTITY_INSERT [voucherDr] OFFSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE TABLE [voucherCr]( [srno] [int] IDENTITY(1,1) NOT NULL, [vouchertype] [nvarchar](50) NULL, [voucherprefix] [nvarchar](50) NULL, [voucherno] [int] NULL, [crparty] [int] NULL, [cramount] [float] NULL, [invoicetype] [nvarchar](50) NULL, CONSTRAINT [PK_voucherCr] PRIMARY KEY CLUSTERED ( [srno] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GOSET IDENTITY_INSERT [voucherCr] ONINSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (1, N'PURCHASE', N'P1213', 1, 2, 8520.12, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (2, N'PURCHASE', N'P1213', 2, 11, 41566.4, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (3, N'PURCHASE', N'P1213', 3, 12, 8190, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (4, N'PURCHASE', N'P1213', 4, 13, 108045, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (5, N'PURCHASE', N'P1213', 5, 14, 33403.51, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (6, N'JOURNAL', N'J1213', 1, 26, 10000, NULL)INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (7, N'PAYMENT', N'PY1213', 1, 1, 8520.12, NULL)INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (8, N'SALES', N'S1213', 1, 8, 3714.3, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (9, N'SALES', N'S1213', 1, 6, 148.57, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (10, N'SALES', N'S1213', 1, 7, 37.14, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (12, N'RECEIPT', N'R1213', 1, 25, 3900.01, NULL)INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (36, N'SALES', N'S1213', 2, 8, 5625, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (37, N'SALES', N'S1213', 2, 6, 225, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (38, N'SALES', N'S1213', 2, 7, 56.25, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (51, N'SALES RETURN', N'SR1213', 1, 25, 5906.25, NULL)INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (52, N'CASH MEMO', N'CM1213', 1, 8, 67.62, NULL)INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (53, N'CASH MEMO', N'CM1213', 1, 6, 2.7, NULL)INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (54, N'CASH MEMO', N'CM1213', 1, 7, 0.68, NULL)INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (55, N'SALES', N'S1213', 3, 8, 15000, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (56, N'SALES', N'S1213', 3, 6, 600, N'TAX INVOICE')INSERT [voucherCr] ([srno], [vouchertype], [voucherprefix], [voucherno], [crparty], [cramount], [invoicetype]) VALUES (57, N'SALES', N'S1213', 3, 7, 150, N'TAX INVOICE')SET IDENTITY_INSERT [voucherCr] OFFSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE TABLE [ledgerBalance]( [srno] [int] IDENTITY(1,1) NOT NULL, [party] [int] NULL, [openingbalance] [float] NULL, [closingbalance] [float] NULL, CONSTRAINT [PK_ledgerBalance] PRIMARY KEY CLUSTERED ( [srno] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GO[/code]I have data about party no being credited and debited in two respective tables voucherCr,voucherDrI want to combine these two tables, party wise. and insert that data in ledgerBalance tables in party and closingBalance column.Socombined data example will bePartyno Amount(Debit-Credit)1 4000011 35002 3450and so on. the amount data is just for example.party no in both tables can be joined and then get data of dramount and cramount and then subtract it, and then store that two column data in ledgerbalance(party,closingbalance). Openingbalance column will be blankfrom voucherCr, crparty and cramount column is important voucherDr, drparty and dramount column needs to be considered |
You are subscribed to email updates from SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment