How To Dynamic Create Bit Field On Sql

Apr 10, 2008



Hi

In Sqlserve we can create dynmic field on sql like:

Select '' as Name from Employee.

It creates a string field.

I want to how to create a Bit field in this way.

Regards
Deepak

View 1 Replies


ADVERTISEMENT

Dynamic Create Table, Create Index Based Upon A Given Database

Jul 20, 2005

Can I dynamically (from a stored procedure) generatea create table script of all tables in a given database (with defaults etc)a create view script of all viewsa create function script of all functionsa create index script of all indexes.(The result will be 4 scripts)Arno de Jong,The Netherlands.

View 1 Replies View Related

Create Date Field From Substring Of Text Field

Jul 20, 2005

I am trying to populate a field in a SQL table based on the valuesreturned from using substring on a text field.Example:Field Name = RecNumField Value = 024071023The 7th and 8th character of this number is the year. I am able toget those digits by saying substring(recnum,7,2) and I get '02'. Nowwhat I need to do is determine if this is >= 50 then concatenate a'19' to the front of it or if it is less that '50' concatenate a '20'.This particular example should return '2002'. Then I want to take theresult of this and populate a field called TaxYear.Any help would be greatly apprecaietd.Mark

View 2 Replies View Related

WHERE-Clause With Dynamic Field?

May 21, 2007

Hi,
i have a stored procedure like this:
 CREATE PROCEDURE dbo.spQuery1

@dynamicField nvarchar(10)

AS

SELECT id, productName, productDescription

FROM products

WHERE @dynamicField = 'True'

RETURN   
The products table has id, productName, productDescription, property1, property2, property3 fields
So my query variable should be, for example, "property1" and the result should be every row with "property1" set to true... but it doesnt work with the sql like this...
 any help?

View 8 Replies View Related

Dynamic Meta Tag With SQL Field

May 31, 2006

Hello all, I use Asp.net 1.1 vb script and MS SQL server 2000.  I'm wondering if there's a way to put a database field into the title meta tag.  For example if I have a detail page for cars which pulls the text info from the SQL data base and I want the field "name" in the title tag
details.aspx?name=Hummer  would have the Title meta tag as Cars..."Hummer"
and
details.aspx?name=Corvette      would have the Title meta tag as Cars..."Corvette"
  so that for each car showing in details.aspx page it wouldn't have to have the same title tag for search engines

View 7 Replies View Related

Dynamic Field Of Database

Dec 9, 2014

I'm having some troubles with a dynamic field of mine db. The field can change in the length. But I need to change the way it come from the db.

Today it comes like this:
Cod OU | Name OU
10000 Alabama
10100 Olivence
10001 Wraith

I need to change the Code to be like this:

Cod OU* | Name OU
1.00.00 Alabama
1.01.00 Olivence
1.00.01 Wraith

Is it possible?

View 1 Replies View Related

Dynamic Field Question

Jul 20, 2005

Can someone point me in the right direction to solve the following(basic) SQL problem below using SQL Server:Let's say I have a table like this that lists people's likes:CREATE TABLE likes (myname VARCHAR (60),travel BIT,eatingout BIT,disco BIT,swimming BIT);Let's say I put the following data inside this table:INSERT INTO likes VALUES ('Darren', 1,0,0,1)INSERT INTO likes VALUES ('John',1,1,0,1)INSERT INTO likes VALUES ('Peter',0,0,0,0)INSERT INTO likes VALUES ('Jill',0,0,0,1)Then what I want is to create a (view? Or function? – I am not sure),called ‘likes_details' that when I send this query:SELECT myname, likes FROM likes_detailsReturns the following:Myname likesDarrenTraveling and swimmingJohnTraveling, eating out and swimmingPeterDone not like anythingJillSwimming onlyPlease! Can anyone help!!Thank you in advance.

View 1 Replies View Related

Dynamic Field DB Schema Brainstorming

Sep 6, 2005

Hello - Have a project where we are going to build a form creation application.  (ASP.NET).  This will allow an administrator to build a form on the fly - this form will appear on the front end of the site.This is a fairly common thing.  Are there any resources out there as to where to start designing the DB schema?  I'm not looking to reinvent the wheel.  Here's the basic objects I'm seeing:TablesFormsFormFieldNamesFormFieldTypesFormFieldJSAny tips on the right direction to go?ThanksRob

View 4 Replies View Related

Crosstab Qry With Dynamic Field Names

Jul 20, 2005

Hi,I am trying to create a stored procedures (SQL 7.0), to provide dataina crosstab format.(I'm using Crystal Reports 8.5, but the Crosstab capabilities areterrible, so I have to do as much as possible on the SQL side)I have a table [Occurrences] with the following fields:Year (int)Month (int)Occurs (int)Claims (int)I need a query to give me the following format:Acct_Month 2001 2002 2003Occurs Claims Occurs Claims Occurs ClaimsJanuary 120 180 132 196 110 140February 154 210 165 202 144 178March etc.......Catch! I need the Year field name to be the contents of the fieldYear in the Table (2001, 2002, 2003...). Not the usual Year_1, Year_2approach.I got the month name ok...Acct_Month = DATENAME(month, Convert(Varchar(2), Month) + '/01/'+Convert(Char(4),Year))Is it possible to do this easely, without the use of cursors?Any help would be much appreciated.Luis Pinto

View 1 Replies View Related

Dynamic SQL- Create Table

Sep 26, 2001

Is it possible to create a temp table using exec. e.g

exec('create table #temp1 (xyz int, abc int)')

when I run the above statement, I dont get an error but nothing happens.

The reason I need to create it dynamically is that in my stored proc, I am passed a number. This number determines how many columns my temp table should have.
thanks
Zoey

View 2 Replies View Related

Dynamic SQL Create Table

Oct 13, 2005

The following dynamic SQL script works for creating a table on the fly but if I change the select @tmpTblNm = 'tmpABC' to select @tmpTblNm = '#tmpABC'
it will not create the temp table. Can anyone help on creating a temp table dynamiclly?

declare @tmpTblNm varchar(40),
@str varchar(1000)

select @tmpTblNm = 'tmpABC'
select @str = ''

-- Create a temp table to hold the current page of data
-- Add an ID column to track the current row
select @str = 'Create Table '+ @tmpTblNm +
' ( row_id int IDENTITY PRIMARY KEY,
customerID int,
customerName varchar(40),
address1 varchar(40),
city varchar(25) )'

exec (@str)

View 1 Replies View Related

Dynamic Create Table

Apr 2, 2007

Hi guru !!

I want to create a table that can created dynamicly based on front end application.table should handle insertion and edit also. please help me to get out of this situation.

thanks
shekhar

View 2 Replies View Related

How To Create Dynamic Controls In Wpf + C#

Nov 5, 2007

Hi,

i want to create dynamic controls using wpf and c#.

can any body send me some code snippet.

for example:-

one of my window page have 100s of fields like textbox, checkbox and date controls in a group inside different grid and panel.

now if admin has made that amoung 100 fields user should be able to see only 20 or 30 fields.

how will i do so, just making the fileds invisible won't work, coz all the fields should be visible from top of the form,

means i want to push all the visible fields at the top.

what are the best way to do so.

need it urgent

thanx a lot


View 3 Replies View Related

Create Dynamic Table From CSV

Apr 3, 2007

Hi,

I'm trying to import a csv file directly to my database every month. The contents of the file stays the same, however the format of the columns may vary. For example, 1 month I can have the following:

Time, Probe1, Probe2, Probe3, Probe4

Whereas the next month I can have something like this

Time, Probe2, Probe3, Probe1, Probe4



The "Time" column will always be on the left side, but the probes may vary in their placement.

I'm importing this csv to a temp table, where I then run a query to select any new data and enter that in my main tables. The problem is that when i import the csv, if the placement of the columns has changed, the data gets entered in the wrong locations.

Is there any way to create this temp table dynamically, based on what the header columns of the csv file are?

Any help appreciated!

View 11 Replies View Related

How To Create Dynamic T-SQL Clause

May 6, 2008

Hi,


I have a project which is need dynamically t-sql clause...I've created interface for the create dynamic t-sql clause.
But the clause should get data from relational database. It needs inner join...so it's very hard to do it..

for example


lkpProduct

id product
1 Mouse
2 Keyboard

3 Modem
4 Monitor


main

id productid

1 4
2 1
3 2
4 3
5 4

You can get this table with 2 ways like this..

1. Select main.id, lkpProduct.product from main,lkpProduct where main.productid = lkpProduct.id
2. Select id, case productid when 1 then 'Mouse'.....end as product from main

mytable

id product
1 Monitor
2 Mouse
3 Keyboard
4 Modem
5 Monitor


My question is; how can i use CASE function dynamically ?? Mouse should get from lkpProduct....I do not want to write long table manually..

I hope it is clear for you..

Regards.

View 4 Replies View Related

Dynamic Create Table

Oct 30, 2006

Hi,

I need to create a table....whose column names should be dynamic...I wouldnt know in advance what the column names would be...These coulmn names are availabe in another table as rows...

Ex: TABLE_A Data

Column Names

Col1

Col2

Col3

Col4...

Some column Names are known already...I need help in writinf the Create table statement..

I need to write something like

Create table Table1

(SerialNo int,Name nvarchar(50)+ AS select * from TABLE_A +

Address nvarchar(500))....



Now the Table1 should look like

Serial No Name Col1 Col2 Col3 Col4 Address



Can some one please let me know how can i accomplish this...I know i need to write a Dynamic Query but dont exactly know ho to write it and execute it....

Thanks

View 7 Replies View Related

How To Create Dynamic Columns In Sql Database

May 3, 2008

hi,
in the front end i have two fields one is dropdown list another is checboxlist say dropdownlist consist of title name and checkbox list consists of sub title name.on selecting title name from dropdownlist i will be getting respective title name in checkboxlist. here when i select checkboxlist(suppose if there are 6 items in checkboxlist n if i select only 3)then my databse column should generate one dropdownlist selected item and 3 checkboxlist selected item.

Eg: if dropdownlist contains( title1,title2,title3) and checkboxlist contains(chk1,chk2,chk3,chk4,chk5,chk6). if i select title1 from dropdownlist i will be geeting 6 item in checkbox list) if i select only 3 items of checkbox list. then i should be able to create column name by title1,chk1,chk2,chk3


help is appreciated

View 1 Replies View Related

Best Way To Create Dynamic Update Statement

Jul 23, 2005

In general, What is the best approach in creating a dynamic updatestored procedure, that can handle recieving varying input paramters andupdate the approporiate columns.

View 6 Replies View Related

Can You Create A Subscription With A Dynamic Date

May 15, 2007

Hello,



I am curious if you can create a subscription for a report that resides on reports manager with a dynamic date? We have a couple of reports on reports manager that require a date value and I tried to use getdate() for the value but it will not except it. Is there a way to have a subscription do something like this so the end user doesn't have to change the date parameter each time? Thanks in advance.



John

View 4 Replies View Related

How To Create A Dynamic SQL Command For OLE DB Source

Mar 21, 2008

Hi All,

I have a requirement to create a dynamic SQL Command in an OLE DB Source due to the fact that I need to read data from another database based on a date range. For example, the SQL command would look like

SELECT * FROM Table1 WHERE DateField BETWEEN '17/03/2008' and '21/03/2008'

and I need to change the dates - '17/03/2008' and '21/03/2008' to different dates when the package is deployed in production, how do I do that ?

Regards
Ash

View 12 Replies View Related

HOW TO: Create Dynamic Excel Destinations

Jun 22, 2006

I have a ForEach Loop Container that is running from a Foreach ADO Enumerator with records telling me which companies have records to export. As I loop through I use a data flow task to export the records to Excel, I want to create separate Excel files using some of the parameters from my recordset as parts of the name.

I have DelayValidation=True for my DFT and my Excel Connection Manager, ValidateExternalMetaData=False for my Excel Destination Adapter, and an expression setting the ExcelFilePath and ServerName properties to the dynamic path & file name from variables.

The layout will be the same (i.e. metadata) for each file. The files are just getting broken up by company and service type and I want to use that in naming the files.

I am currently getting the following errors:

[EX_DST New Enrollments File [238]] Error: An OLE DB error has occurred. Error code: 0x80040E37.

[EX_DST New Enrollments File [238]] Error: Opening a rowset for "NewEnrollments$" failed. Check that the object exists in the database.

[DTS.Pipeline] Error: component "EX_DST New Enrollments File" (238) failed the pre-execute phase and returned error code 0xC02020E8.

What do I have to do to create the new Excel File? I thought it would do it when the properties were set. Do I have to create the "table" for the worksheet named "NewEnrollments"? If so, how do I accomplish it.

Thanks in advance.

sk

View 1 Replies View Related

Can I Create Dynamic Report Parameters?

Apr 4, 2007

Hi all,

Is it possible to create a report with dynamic parameters or parameters dependant on other ones? I have the following scenario -



Parameter 1 - 'Select an Application' - List of applications that are available

Parameter 2 - 'Select a module' - This is a list of modules that needs to depend on Parameter 1. As a user selects different applications, the appropriate module list will be loaded.

Is this possible to do in SSRS?



Thanks,

Brian

View 3 Replies View Related

Impossible? Sort On Dynamic Field (in Combination With Row_number)

Aug 17, 2007

I have images on which users may comment. Now I want to sort those images on the amount of comments each image has.I use custom paging in combination with ROW_NUMBERSo I want to sort items in one table based on the number of occurences of that item in another table...I have the following query (which doesnt work):SELECT *FROM(select ROW_NUMBER() OVER (ORDER BY mediaComments DESC) as RowNum,m.title,m.usercode,m.mediaid,mediaComments=(select count(*) from tblMediaComments where mediaid=m.mediaid)FROM tblAlbums a inner join tblMedia m on am.mediaid=m.mediaidleft join tblMediaComments mc on mc.mediaid=m.mediaidWHERE a.showTo=1group by  m.title,m.usercode,m.mediaid) as InfoWHERE RowNum between @startRowIndex AND (@startRowIndex + @maximumRows-1) 

View 9 Replies View Related

Has Any One Know How To Create Temporary Tables Inside Dynamic SQL?.

Jul 28, 2000

it seems like i am able to create it. But when i try to access that
temporary table, i get an error "Invalid object".
this is happening only when i try to create local temporary table.
Global temporary table works fine inside the dynamic SQL.

Any Help appreciated.

View 1 Replies View Related

Dynamic CREATE TABLE Or SELECT INTO Statement

Jul 27, 2004

In SQL Server you can do a SELECT INTO to create a new table, much like CREAT TABLE AS in Oracle. I'm putting together a dynamic script that will create a table with the number of columns being the dynamic part of my script. Got any suggestions that come to mind?

Example:

I need to count the number of weeks between two dates, my columns in the table need to be at least one for every week returned in my query.

I'm thinking of getting a count of the number of weeks then building my column string comma separated then do my CREATE TABLE statement rather then the SELECT INTO... But I'm not sure I'll be able to do that using a variable that holds the string of column names. I'm guess the only way I can do this is via either VBScript or VB rather then from within the database.

BTW - this would be a stored procedure...

Any suggestions would be greatly appreciated.

View 1 Replies View Related

Is It Possible To Create Dynamic Reports Using Reporting Services

Jun 29, 2007

I have a requirement to create dynamic reports for my client.



once i create these reports then the user will choose columns of there choice.



so the columns may belong to multiple tables.



Now the report should get generated with the layout etc. is it possible.



since our project is totally on the webserver(webbased.)



please if you can provide me with any links with dynamic report creation wizards.



and also we only use Stored procedures via database.

which is best is writing the entire queries right behind the layouit or calling the entire logic via Stored procedure. i am a bit confused. this is my first project working on reports itself.



Thank you all for the helpful information.





View 1 Replies View Related

How To Create Dynamic Columns In A Temporary Table

Sep 5, 2007

Hi there,
i have a requirement that a temporary table contains dynamic columns depending on where condition.

my actual table is like





Key
Value


X1
x

X3
x

X5
x

Y1
y

Y2
y
when user select x, the input variable passed to stored proc and the result is shown like

column names
X1 X3 X5 as column headers.

the select query is from temporary table.

these out put is based on the user selection. so the temporary table created with columns dynamically.

please help me out.
please let me know if you didn't understand.

thanks
Praveen.

View 7 Replies View Related

Is Possible To Create Dynamic Reports Based On Cubes?

Sep 5, 2007



Hi,



I would like to know if is possible to create dynamic reports based on cubes. What i mean is,after creating a cube with a couple of dimensions and measure if is there any way to give the normal users on the report manager or report builder the freedom to choose their own dimensions/measure so they can output the report with the choosen criteria.

Thanks.

View 3 Replies View Related

Problem With Using Dynamic SQL To CREATE XML SCHEMA COLLECTION In SQL 2005

Apr 8, 2008

This works in SQL Server 2005:CREATE XML SCHEMA COLLECTION Version2_1 AS'<xs:schema xmlns="http://www.icpsr.umich.edu/DDI"     xmlns:xs="http://www.w3.org/2001/XMLSchema"    xmlns:doc="http://www.icpsr.umich.edu/doc"     targetNamespace="http://www.icpsr.umich.edu/DDI"    elementFormDefault="qualified" attributeFormDefault="unqualified">    <xs:annotation>        <xs:documentation>            This is a w3c Schema "Technical Implementation" of the DDI Conceptual Specification.             This schema is intended for use in producing electronic versions of codebooks for quantitative social science data.            CVS Revision information: $Header: /cvsroot/ddi-alliance/ddi/w3c/Version2-1.xsd,v 1.10 2007/07/31 19:03:54 mdiggory Exp $         </xs:documentation>    </xs:annotation></xs:schema>'  This version, however, gives errors: DECLARE @sql VARCHAR(max)SET @sql ='CREATE XML SCHEMA COLLECTION Version2_1 AS <xs:schema xmlns="http://www.icpsr.umich.edu/DDI" xmlns:xs="http://www.w3.org/2001/XMLSchema"xmlns:doc="http://www.icpsr.umich.edu/doc" targetNamespace="http://www.icpsr.umich.edu/DDI"elementFormDefault="qualified" attributeFormDefault="unqualified"><xs:annotation>    <xs:documentation>        This is a w3c Schema "Technical Implementation" of the DDI Conceptual Specification.         This schema is intended for use in producing electronic versions of codebooks for quantitative social science data.        CVS Revision information: $Header: /cvsroot/ddi-alliance/ddi/w3c/Version2-1.xsd,v 1.10 2007/07/31 19:03:54 mdiggory Exp $     </xs:documentation></xs:annotation></xs:schema>'EXEC (@sql)Ultimately, I am trying to create a stored procedure that will take as parameters the name of the new schema and the .xsd file it comes from, so that I can use it in code.  I am a novice, so all explanations would be greatly appreciated.Thanks,Ed Graham 

View 3 Replies View Related

Execute Big Dynamic SQL In Stored Procedure To Create View

Jul 20, 2005

I am trying to create a dynamic SQL statement to create a view.I have a stored procedure, which based on the parameters passed callsdifferent stored procedures. Each of this sub stored procedure createsa string of custom SQL statement and returns this string back to themain stored procedure.This SQL statements work fine on there own. The SQL returned from thesub stored procedure are returned fine. The datatype of the variablethat this sql is stored in Varchar(I have tried using nvarchar alsosame problem).If I have more that 6 SQL statements concated then the main SQL getscut off. It doesnt matter in what sequence I create the main SQL.Here is the Stored procedure/**********************************************//*Main Stored Procedure *//**********************************************/CREATE PROC sp_generate_invoice1 @prev_date NVarchar(1000) ,@prev_month NVarchar(32)ASDECLARE invoice_driver_cur CURSOR FORSelect driversid From Invoice_driversOpen invoice_driver_curDeclare@C VARCHAR(8000),@L_args Varchar(8000),@@sqlstmt Varchar(8000),@L_driverid Int,@L_rowcount IntSET QUOTED_IDENTIFIER ONSET TEXTSIZE 32768Set @L_rowcount = 0-- Drop the previous ViewIF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWSWHERE TABLE_NAME = 'custom_invoice')DROP VIEW custom_invoiceFetch Next From invoice_driver_curInto @L_driverid-- Create the new ViewSet @L_args = N'Create View custom_invoice As'--Select @L_driveridWHILE( @@FETCH_STATUS = 0)BEGINSet @L_rowcount = @L_rowcount + 1select @L_driveridIf @L_driverid = 2BeginExec sp_invoice_driver2 @prev_date, @prev_month, @@sqlstmt OutputIf @L_rowcount > 1BeginSet @C = @L_args + ' Union ' + @@sqlstmtEndElseBeginSet @C = @L_args + @@sqlstmtEndEndIf @L_driverid = 3BeginExec sp_invoice_driver3 @prev_date, @prev_month, @@sqlstmt OutputIf @L_rowcount > 1BeginSet @C = @C + ' Union ' + @@sqlstmtEndElseBeginSet @C = @L_args + @@sqlstmtEndEndIf @L_driverid = 4BeginExec sp_invoice_driver4 @prev_date, @prev_month, @@sqlstmt OutputIf @L_rowcount > 1BeginSet @C = @C + ' Union ' + @@sqlstmtEndElseBeginSet @C = @L_args + @@sqlstmtEndEndIf @L_driverid = 5BeginExec sp_invoice_driver5 @prev_date, @prev_month, @@sqlstmt OutputIf @L_rowcount > 1BeginSet @C = @C + ' Union ' + @@sqlstmtEndElseBeginSet @C = @L_args + @@sqlstmtEndEndIf @L_driverid = 6BeginExec sp_invoice_driver6 @prev_date, @prev_month, @@sqlstmt OutputIf @L_rowcount > 1BeginSet @C = @C + ' Union ' + @@sqlstmtEndElseBeginSet @C = @L_args + @@sqlstmtEndEndIf @L_driverid = 7BeginExec sp_invoice_driver7 @prev_date, @prev_month, @@sqlstmt OutputIf @L_rowcount > 1BeginSet @C = @C + ' Union ' + @@sqlstmtEndElseBeginSet @C = @L_args + @@sqlstmtEndEndIf @L_driverid = 8BeginExec sp_invoice_driver8 @prev_date, @prev_month, @@sqlstmt OutputIf @L_rowcount > 1BeginSet @C = @C + ' Union ' + @@sqlstmtEndElseBeginSet @C = @L_args + @@sqlstmtEndEndIf @L_driverid = 10BeginExec sp_invoice_driver_niku @prev_date, @prev_month, @L_driverid,@@sqlstmt OutputIf @L_rowcount > 1BeginSet @C = @C + ' Union ' + @@sqlstmtEndElseBeginSet @C = @L_args + @@sqlstmtEndEndPrint @CFetch Next From invoice_driver_curInto @L_driveridContinueEndClose invoice_driver_curDeAllocate invoice_driver_curExec (@C)--EXEC sp_executesql @CGO/**********************************************//*Sub Procedure sp_invoice_driver2 *//**********************************************/CREATE PROC sp_invoice_driver2 @args NVarchar(1000), @prev_monthNVarchar(100),@sqlstmt Varchar(8000) OutputASSET QUOTED_IDENTIFIER ONSET @sqlstmt = ' Select 1 SortOrder ,( SELECT Drivers.Description) Description,(BillingReport.Active_Accounts * Cast(Fee.fee_rate As decimal(4,2))) / 12 Amount,Drivers.CurrencyFROM BillingReport, Drivers, FeeWHERE ( Fee.Driverid = Drivers.Driversid ) andDrivers.Driversid = 2 andbillingreport.fromdate = ''' + Cast(@args As NVARCHAR(20)) + '''andfee.currentmonth = ''' + Cast(@prev_month As NVARCHAR(12)) +' '''GO/**********************************************/This is what the Print Statement give:/**********************************************/Create View custom_invoice As Select 1 SortOrder ,( SELECT Drivers.Description) Description,(BillingReport.Active_Accounts * Cast(Fee.fee_rate As decimal(4,2))) / 12 Amount,Drivers.CurrencyFROM BillingReport, Drivers, FeeWHERE ( Fee.Driverid = Drivers.Driversid ) andDrivers.Driversid = 2 andbillingreport.fromdate = '9/1/2004' andfee.currentmonth = 'September ' Union Select 2,(SELECT Drivers.Description),(BillingReport.Zero_Balance * Cast(Fee.fee_rate As decimal(9,2) ))/ 12 Amount,Drivers.CurrencyFROM BillingReport, Drivers, FeeWHERE ( Fee.Driverid = Drivers.Driversid ) andbillingreport.fromdate = '9/1/2004' andfee.currentmonth = 'September' andDrivers.Driversid = 3 Union Select 3,(Select Drivers.Description From Drivers Where DriversID = 4),Count(*) * Cast((select fee.fee_ratefrom fee, driverswhere Fee.Driverid = Drivers.Driversid andfee.currentmonth = 'September' andDrivers.Driversid = 4 )As decimal(6,2)) / 12,(Select Drivers.CurrencyFrom Drivers Where DriversID = 4)From Fund Union Select 4,(Select Drivers.Description From Drivers Where DriversID = 5),(((Sum(BillingReport.Man_Reg_Purch + BillingReport.Man_Reg_Red +BillingReport.Man_Reg_Transexch +BillingReport.Man_Allo_Purch +BillingReport.Man_Allo_Red +BillingReport.Man_Allo_Transexch +BillingReport.Man_Allo_Adj_Purch +BillingReport.Man_Allo_Adj_Red +BillingReport.Man_Allo_Adj_Transexch +BillingReport.Man_Adj_Purch +BillingReport.Man_Adj_Red +BillingReport.Man_Adj_Transexch ) ) +(Select Sum(Cast(satuscnt As int ))From Awd_stubWhere CurrentMonth = 'September'))) *(Cast((select fee.fee_ratefrom fee, driverswhere Fee.Driverid = Drivers.Driversid andfee.currentmonth = 'September' andDrivers.Driversid = 5 )As decimal(6,2))),(Select Drivers.Currency From Drivers Where DriversID = 5)FROM BillingReportWhere billingreport.fromdate = '9/1/2004' Union Select 5,(Select Drivers.Description From Drivers Where DriversID = 6),( Sum( BillingReport.Auto_Reg_Purch +BillingReport.Auto_Reg_Red +BillingReport.Auto_Reg_TRansexch +BillingReport.Auto_Allo_Purch+BillingReport.Auto_Allo_Red +BillingReport.Auto_Allo_Transexch+BillingReport.Auto_Allo_Adj_Purch+BillingReport.Auto_Allo_Adj_Red+BillingReport.Auto_Allo_Adj_transexch+BillingReport.Auto_Adj_Purch+BillingReport.Auto_Adj_Red+BillingReport.Auto_Adj_Transexch )+(Select Sum(Cast(Processed_msg As Int))From XML_messagingWhere CurrentMonth = 'September'))*(Cast((select fee.fee_ratefrom fee, driverswhere Fee.Driverid = Drivers.Driversid andfee.currentmonth = 'September' andDrivers.Driversid = 6 )As decimal(6,2))),(Select Drivers.Currency From Drivers Where DriversID = 6)FROM BillingReportWhere billingreport.fromdate = '9/1/2004' Union Select 6,(Select Drivers.Description From Drivers Where DriversID = 7),( ( a.Accountholder_Active_Accounts -(select accountholder_active_accounts from billingreport whereMonth(fromdate) = Month('9/1/2004')-1 ) )+( a.Accountholder_Zero_Balance -(select accountholder_zero_balance from billingreport whereMonth(fromdate) = Month('9/1/2004')-1 ))) *(Cast((select fee.fee_ratefrom fee, driverswhere Fee.Driverid = Drivers.Driversid andfee.currentmonth = 'September' andDrivers.Driversid = 7 )As decimal(6,2))),(Select Drivers.Currency From Drivers Where DriversID = 7)FROM BillingReport a Where a.fromdate = '9/1/2004' Union Select 7,(Select Drivers.Description From Drivers Where DriversID = 8),( Select telephone From cfxbill Where currentmonth = 'September') *(Cast((select feThanks for any helpMD

View 4 Replies View Related

Transact SQL :: Cursor To Create Multiple Dynamic Procedures

Jun 29, 2015

The requirement is create a sql script(1 proc or cursor) which will create multiple procedures dynamically.

Table A
Col1 
Col2

A
Alpha

For Example: If table A has 3 rows(distinct) so 3 procedures will be created dynamically.

Result: 
1 PROC_A_ALPHA
2 PROC_B_BETA
3 PROC_C_charlie

View 6 Replies View Related

How To Create Dynamic Folder Which Contains All The Files Which Are Used By All The Packages In A Project

Mar 19, 2008

Hi,
My Problem goes Like this....

I have a folder which contains all the flat files which are used by all the packages(ex--flat file connection managers) in my project.
If we want to change the name of the folder,have to change in every package( in all connection managers) manually.It looks hardcoding and timetaking.

Is there any way to change in one place(xml,file,variable) so that it should be affected in all the packages.

one more doubt is..

If we configure the flat file connection manager in package configurations,configuration file (ex-xml)will be created (we can make changes in that file regarding that connecion mgr only.)

But i want one configuration file (ex--xml) so that i should configure the details of all the connection managers used in all packages.

View 5 Replies View Related

USING BI Studio How To Create Dynamic Connection String In SSIS Package

Jun 19, 2006

Hi



I need help for Connection string:



Requirement: When we create SSIS Pacakge using Businessinteligence studio.Each Source and Destination or whatever we using the Control required DB Connection.

we connect theDB server and Database Table through manaully .Instead of Manual i need dynamic Global varible for Connection String .How to achieve this connection string.

because suppose we create SSIS Package in Developement Server Latter We change the Server from Developement to Another Testing Server . at that time we dont requierd for changing manulay.any one pls reply me.



Same as in Dotnet we give configiration XML file .we gave the Connection strng. how to in SSIS we do?



Thanks & Regards

M.Jeyakumar







View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved