Format Of Data - How It Works

Jun 20, 2014

i realized that there is much talk where data will be stored, what are the ways to organize data, but did not see anywhere what format this data. If they are text files they are .txt? All of them? Why Linux in a text file does not necessarily need to have this extension.For example, this forum, every time a thread is created it creates a text file with the contents of the thread inside a folder that represents the board? Is that how it works?

View 1 Replies


ADVERTISEMENT

I Want Ot Convert Xml Data Format Into The General Data Format

Jun 9, 2006

hi siri have table hh .it has two columnsone is hhno is integer datatype another hhdoc is xml data type likehh tablehhno hhdoc---------------------------------------------------------------------------------------------100<suresh>sfjfjfjfjf</suresh>....................................101<ramesh>hhfhfhf</ramesh>..................................how to convert the xml data format into the general data format plshelp me with examples

View 1 Replies View Related

Data Mining :: Deleting Old Data From Adventure Works 2012 With Powershell

May 3, 2015

I am trying to delete tables from data where the ModifiedDates older than 9 years in AdventureWorks2012 database . I get console notified that foreign keys are dropped but the delete statement is throwing errors. I am sure that somewhere the key constraints are not getting altered, but i'm not able to figure it out as i'm a relative beginner to T-SQL. The error and code:

The DELETE statement conflicted with the REFERENCE constraint "FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID". The conflict
occurred in database "AdventureWorks2012", table "Sales.SalesOrderHeader
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
$option_drop = new-object Microsoft.SqlServer.Management.Smo.ScriptingOptions;
$option_drop.ScriptDrops = $true;

[Code] ....

View 3 Replies View Related

Pivoting Data Works In One Db But Not Another

Mar 20, 2008

In the following code examples I got to learn PIVOT, I found an error for SUM. However when this is ran against the AdventureWorks db it works fine. Notice it is using a table variable and not an actual table. What do I need to do to my db to get this to work?

Thanks!




declare @sales table
(
[Year] int,
Quarter char(2),
Amount float
)

insert into @sales values(2001, 'Q1', 70)
insert into @sales values(2001, 'Q1', 150)
insert into @sales values(2002, 'Q1', 20)
insert into @sales values(2001, 'Q2', 15)
insert into @sales values(2002, 'Q2', 25)
insert into @sales values(2001, 'Q3', 50)
insert into @sales values(2002, 'Q3', 20)
insert into @sales values(2001, 'Q4', 90)
insert into @sales values(2001, 'Q4', 80)
insert into @sales values(2002, 'Q4', 35)

select * from @sales
PIVOT (
SUM(Amount)
for Quarter in (Q1, Q2, Q3, Q4)) as p

Yields...
Incorrect syntax near 'SUM'.

View 2 Replies View Related

SQL Insert From Text Box Works, But Can't Display Data After

Jan 4, 2008

Ok so I got my insert statement to work properly from multiple text boxes and a button control.  What I'm looking to do is once the customer hits the button and it creates the new row in the table I want to then display the recently created record.  Currently when I hit submit it creates the record, but the screen then goes back to default.  I can then go to another page that I created to browse the records and it sees that the record was created properly.  I would like for the insert to complete and then for the recently created record to be displayed either with a pop up, on the same page, or on a different page that needs to be created.  I've tried tons of different options, but haven't been able to figure it out.  So what I'll do is show you the working code and if you could give me a little help on what code I need to add to accomplish the task.  Thanks.   <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">    <b />    <table style="width:100%;">        <tr>            <td class="style9">                Enter Bug Title:</td>            <td>    <asp:textbox id="bug_title" runat="server" Width="420px" EnableViewState="False"/>                                </td>        </tr>        <tr>            <td class="style9">                Bug Tester:</td>            <td>                <asp:TextBox ID="tester" runat="server" width="420px" EnableViewState="False"/></td>        </tr>        <tr>            <td class="style12">                Description:</td>            <td class="style13">                <asp:TextBox ID="description" runat="server" Width="420px" Height="473px"                     EnableViewState="False" MaxLength="200" TextMode="MultiLine"></asp:TextBox>                                </td>        </tr>        <tr>            <td class="style9">                Severity:</td>            <td>                <asp:DropDownList ID="severity" runat="server" EnableViewState="False">                    <asp:ListItem>Low</asp:ListItem>                    <asp:ListItem>Medium</asp:ListItem>                    <asp:ListItem>High</asp:ListItem>                </asp:DropDownList>            </td>        </tr>        <tr>            <td class="style9">                Project Group:</td>            <td>                <asp:DropDownList ID="project_group" runat="server"                     DataSourceID="ObjectDataSource1" DataTextField="GroupName"                     DataValueField="GroupName" EnableViewState="False">                </asp:DropDownList>                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"                     OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"                     TypeName="DataSet1TableAdapters.bug_groupsTableAdapter">                </asp:ObjectDataSource>            </td>        </tr>        <tr>            <td class="style9">                &nbsp;</td>            <td>                <asp:button ID="button1" runat="server" text="Submit" OnclientClick="button1_click" />&nbsp;</td>        </tr>    </table> And here is the code behind: Imports System.DataImports System.Data.SqlClientPartial Class Default2    Inherits System.Web.UI.Page    Dim objcon As ConnectionStringSettings = ConfigurationManager.ConnectionStrings("bug_trackerConnectionString")    Dim str As String = objcon.ConnectionString    Dim con As New SqlConnection(Str)    Dim com As New SqlCommand("", con)    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click        con.Open()        com.Parameters.AddWithValue("@bug_title", bug_title.Text)        com.Parameters.AddWithValue("@tester", tester.Text)        com.Parameters.AddWithValue("@description", description.Text)        com.Parameters.AddWithValue("@project_group", project_group.Text)        com.Parameters.AddWithValue("@severity", severity.Text)        com.CommandText = "INSERT INTO bug_tracker (bug_title, tester, description, severity, project_group) VALUES (@bug_title, @tester, @description, @severity, @project_group)"        com.ExecuteNonQuery()        con.Close()    End Sub 

View 1 Replies View Related

How SSIS Works With Data Sources Other Than SQL Server?

Oct 2, 2006

Hi:

I am new to SSIS. I would like to know if I want to transfer data from one Oracle schema to another Oracle schema and also to do scheduling of the packages, can I still use SSIS? If yes, what are the components that need to be installed on the database server and the development environment? I hope I don't need the full SQL Server database installation in order to use SSIS.

Thanks!

MuiSukYuen

View 1 Replies View Related

Accessing Data Connection Works Locally, But Not When Deployed

Nov 15, 2005

Hi all, I hope this is a simple issue that I'm overlooking something or have contradicting permissions set somewhere. I have a fairly basic site with a subfolder containing an aspx page. The user logs in to gain access to the subfolder. That part works fine.On another page(also within a subfolder in the subfolder), they can post form data to a database (SQL Server 2000) which exists on a different server than my web server. This page opens fine, but when submitting the data (only one value to one field for my testing purposes), it bombs and returns the error "Login failed for user"...In my connection string I've specified the username and password which I assigned to the db in Enterprise Manager (not sa, btw). I've also tried letting IIS control the UID/PW, and even specified no UID/PW in either the connection string or the db. Anonymous access enabled in IIS for this virtual directory also returns the error. (?)I should mention that in Visual Studio, the connection string was automatically set to my local development machine's workstation ID. I removed that and have tried replacing it with the server name, blank, etc.(in notepad) - to no avail. dll's are in their proper places, etc. The only thing not working is the database connection.Using: IIS v6, SQL Server 2000, and Visual Studio.NET 2003 (1.1 framework)Anyway - any suggestions? There are so many places to enable/disable permissions, it's getting confusing. I hope it's something I'm overlooking and not a problem with our SQL installation...Thanks!--Donnie

View 2 Replies View Related

Alternative For LEFT() And CHARINDEX() That Works With Text Data Type

Jun 26, 2007

I have a stored procedure that receives a list of ids, to get the emails of each of those ids. The problem that I'm having is that I'm using a char data type that is max length is 8000, but the contact lists are getting bigger and soon they might reach the variable max length. The contact list that I receive will look something like this "1234,67523,67875,789687,", I'm using "," as a separator. Right now what I do is this
@array_value = LEFT(@ContactList, @separator_position - 1)
 
The LEFT function doesn't work with data types text and ntext. But I'm in need of a string data type with a max length bigger than 8000. So I will apreciate if anyone knows of another function that does the same or similar and works with text data type, or any other ideas will be welcome.
 
Thanks,
 Erick

View 8 Replies View Related

Create Date Source View And Data Model That Works Right

Jan 22, 2008

I created a data model for report builder. And since it wont let me use views, i tried to put all the tables im using in one of my already made views, to create a data source view like my sql view. But when i connect everything the same, my report model still doesnt narrow my search. I only want to see Breed information, but since i have a Breeder table,and Customer table, its showing me all customers, and not limiting it to the ones that are breeder customers.

heres the tables:




Code Snippet

FROM dbo.Tbl_Customer INNER JOIN
dbo.Tbl_Customer_Breeder ON dbo.Tbl_Customer.Customer_Code = dbo.Tbl_Customer_Breeder.Customer_Code INNER JOIN
dbo.Tbl_Customer_Detail ON dbo.Tbl_Customer.Customer_Code = dbo.Tbl_Customer_Detail.Customer_Code INNER JOIN
dbo.Tbl_Customer_Category ON dbo.Tbl_Customer.Customer_Category_Id = dbo.Tbl_Customer_Category.Customer_Category_Id INNER JOIN
dbo.Tbl_Customer_Classification ON
dbo.Tbl_Customer.Customer_Classification_Id = dbo.Tbl_Customer_Classification.Customer_Classification_Id INNER JOIN
dbo.Tbl_Customer_In_Breed ON dbo.Tbl_Customer.Customer_Code = dbo.Tbl_Customer_In_Breed.Customer_Code INNER JOIN
dbo.Tbl_Breed ON dbo.Tbl_Customer_In_Breed.Breed_Id = dbo.Tbl_Breed.Breed_Id




What am i doing wrong, and are there any suggestions.

View 6 Replies View Related

DTS Works, Job Fails!(data Source Foxpro And Destination SQL Server 2000

Sep 26, 2006

The DTS works perfectly when I run it manually. However, when I run itas a job it fails. Before you ask if i'm running it under differentsecurity context. I have already made sure of that. I was logged intothe server through remote viewer, when I created and ran the package,as well as scheduling the job. So the accounts they're running underare consistent. They're the same accounts as the SQL Agent is runningunder and it's the sys admin account.The data source is a Fox pro database with a pull of two tables. I amusing Microsoft OLE DB Foxpro driver as my source connection and OLE DBConnection for SQL Server as my destination. I am doing a simple tableto table transformation. The path of my connection is a mapped Drive:E:Main. There are other packages and jobs within my job queue that arepointing to the same database and they seem to run fine using the abovemapped drive. The ONLY difference between this package and otherpackages are that, they're few months old and this one was created lastnight. I have also enabled logging on this package and here is thebelow error when the job fails:Package Steps execution information:Step 'DTSStep_DTSDataPumpTask_1' failedStep Error Source: Microsoft OLE DB Provider for Visual FoxProStep Error Description:Invalid path or file name.Step Error code: 80040E21Step Error Help File:Step Error Help Context ID:0Step Execution Started: 9/23/2006 11:39:17 AMStep Execution Completed: 9/23/2006 11:39:17 AMTotal Step Execution Time: 0.031 secondsProgress count in Step: 0

View 1 Replies View Related

Master Data Services :: How Code Attributes Works In MDS Stage In MDM Model

Apr 21, 2015

Can i have a combination of sources some with Unique Identifiers and some without?

I need to know what happens when I have option “Create Code values automatically” selected for the entity and same time pulling Unique Identifier for other sources in same entity stage table.

When we select option “Create Code values automatically” for the entity we creates, then during load from external source to MDM stage we don’t send any values to MDM stage “Code” field and in next step when we execute the stored procedure to load the data from MDM stage to MDM model, it assigns the Code values to each record in MDM stage and MDM model.

I need to know whether after executing the store procedure, will it assign Code values for only NULL records in MDM stage and not give us any error for the records that already have Code values present in MDM stage.

View 3 Replies View Related

Data Access :: Query Apparently Works Illogically - Getting Null Resultset

Jun 22, 2015

I have this query in a stored procedure.  I will simplify it so that it shows the issue I am having.

I have two tables.  One table has a PK called PRSubLineID.  the other table has that in a foreign key.

I did a query like this using the IN Statement

SELECT PRSubLineID, PRSUBLINENumber, f2, f3,
FROM PRSUBLINES PRSL
WHERE PRSL.PRSUBLINENumber LIKE '%test%'
AND PRSL.PRSubLineID NOT IN
(SELECT CSL.PRSUBLineID FROM CtrSubLines CSL)

This is supposed to select those items from one table with a PRSubLineNumber containing the work Test which has a primary key that has not been used as a foreign key in the other table. However I am getting an empty resultset back.

But when I comment out the "And" and end the query after '%test%', Like this:

SELECT PRSubLineID, PRSUBLINENumber, f2, f3,
FROM PRSUBLINES PRSL
WHERE PRSL.PRSUBLINENumber LIKE '%test%'

I show a resultset containing three records whose PRSubLineID' s are 2384, 2385, 2386.

But when I add this query to the query window:

Select * FROM CtrSubLines CSL WHERE CSL.PRSubLineID in (2384, 2385, 2386)

I also get a null resultset. So hoping to decipher what was going on I changed the initial query to look like this.

SELECT PRSubLineID, PRSUBLINENumber, f2, f3,
FROM PRSUBLINES PRSL
WHERE PRSL.PRSUBLINENumber LIKE '%test%'
AND PRSL.PRSubLineID /*NOT*/ IN
(SELECT CSL.PRSUBLineID FROM CtrSubLines CSL)

And this still returned a null result set.

Basically this is saying that my PRSubLineIDs are neither included nor excluded in the set of all values of PRSubLineID in the CtrSubLines table. But that is simply impossible.

View 5 Replies View Related

Data Fields In Page Header - An Answer That Works ALL The Time (Not Resolved)

Jan 11, 2008

Hi

I need data fields in the page header. The report is multiple pages. I have multiple fields I need in the page header. These fields will change on each page.

I've tried everything I can find suggested on this forum. They all either don't work or work for a while. Then, as is the case today, we get a problem with a report that renders perfectly in the RS browser but when it's output to a PDF, a couple of the page headers become confused.

Why can't Microsoft provide a hack that actually works somewhere (Maybe I just can't find it)? A sticky at the top of the forum?

I'm currently using the answer supplied by NB at AeM here http://forums.microsoft.com/msdn/showpost.aspx?postid=638813&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=1 As I said it works very nicely, thanks , except for when it doesn't export properly to a PDF which is an MS issue I presume not the solutions issue.

I really need to be able to make this work before I start throwing my toys from my pram and so my boss doesn't think I'm a complete idiot. I'm sure he doesn't believe me when I say I can't put data in a report header, after all it's only the most basic of reporting functions.

Can anyone please help with a 100% solution?


Cheers


View 5 Replies View Related

SQL SERVER ACCESS DENIED!! BUT Everything Works On MSDE And Works SHOWING RECORDS ON SQL SERVER!! PLEASE HELP

Jul 26, 2004

I've got a popular problem so i get a message that server acces denied! ..

But that what is different in my error.... When i use same setting same database and connection string (on MSDE server) there is no problem...

On SQL server i have got windwos authentication but i added all accounts as ASPNET and SA.... and when i try to connect by

RETTO - name of my server

server=RETTO;uid=sa;pwd=password;database=db1;
or by
Integrated Security=SSPIserver=RETTO;uid=RETTOASPNET;database=db1;

I CAN BROWSE RECORDS THERE ARE NO PROBLEMS WITH CONNECTION!!! but when i try to update or iinsert or delete something in database there becomame this error that access denied or server does not exist!!!


PLEASE HELP I'm FIGHTING WITH THAT FOR OVER 5 DAYS!!!

I MADE FOR MY ACCOUNTS (SA, ASPNET) ALL THINGS ALLOWED AS EXECUTING stored procedures.. OR ACCESING datatables with insert delete and update query WHERE IS THE PROBLEM!!!??

View 3 Replies View Related

Telnet Connection Works, Sql Cmd Connection Works, SQL Server Managment Studio 2005 Does Not

Jun 20, 2007

I'm having a strange problem with this but I know (and admit) that the problem is on my PC and nowhere else. My firewall was causing a problem because I was unable to PING the database server, switching this off gets a successful PING immediately. The most useful utility to date is running netstat -an in the command window. This illustrates all the connections that are live and ports that are being listed to. I can establish a connection both by running



telnet sql5.hostinguk.net 1433 and

sqlcmd -S sql5.hostinguk.net -U username -P password



See below:



Active Connections

Proto Local Address Foreign Address State

TCP 0.0.0.0:25 0.0.0.0:0 LISTENING

TCP 0.0.0.0:80 0.0.0.0:0 LISTENING

TCP 0.0.0.0:135 0.0.0.0:0 LISTENING

TCP 0.0.0.0:443 0.0.0.0:0 LISTENING

TCP 0.0.0.0:445 0.0.0.0:0 LISTENING

TCP 0.0.0.0:1026 0.0.0.0:0 LISTENING

TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING

TCP 81.105.102.47:1134 217.194.210.169:1433 ESTABLISHED

TCP 81.105.102.47:1135 217.194.210.169:1433 ESTABLISHED

TCP 127.0.0.1:1031 0.0.0.0:0 LISTENING

TCP 127.0.0.1:5354 0.0.0.0:0 LISTENING

TCP 127.0.0.1:51114 0.0.0.0:0 LISTENING

TCP 127.0.0.1:51201 0.0.0.0:0 LISTENING

TCP 127.0.0.1:51202 0.0.0.0:0 LISTENING

TCP 127.0.0.1:51203 0.0.0.0:0 LISTENING

TCP 127.0.0.1:51204 0.0.0.0:0 LISTENING

TCP 127.0.0.1:51206 0.0.0.0:0 LISTENING

UDP 0.0.0.0:445 *:*

UDP 0.0.0.0:500 *:*

UDP 0.0.0.0:1025 *:*

UDP 0.0.0.0:1030 *:*

UDP 0.0.0.0:3456 *:*

UDP 0.0.0.0:4500 *:*

UDP 81.105.102.47:123 *:*

UDP 81.105.102.47:1900 *:*

UDP 81.105.102.47:5353 *:*

UDP 127.0.0.1:123 *:*

UDP 127.0.0.1:1086 *:*

UDP 127.0.0.1:1900 *:*

Both these utilities show as establishing a connection in netstat so I am able to connect the database server every time, this worked throughout yesterday and has continued this morning.

The problem is when I attempt to use SQL Server Management Studio. When I attempt to connect to tcp:sql5.hostinguk.net, 1433 nothing shows in netstat at all. There is an option to encrypt the connection in the connection properties tab in management studio, when I enable this I do get an entry in netstat -an, see below:



TCP 81.105.102.47:1138 217.194.210.169:1433 TIME_WAIT

TCP 81.105.102.47:1139 217.194.210.169:1433 TIME_WAIT

TCP 81.105.102.47:1140 217.194.210.169:1433 TIME_WAIT



Amost as if it's trying the different ports but you get this time_wait thing. The error message is more meaningful and hopefull because I get:

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) (.Net SqlClient Data Provider)

I would expect this as the DNS has not been advised to encrypt the conection.

This is much better than the : Login failed for user 'COX10289'. (.Net SqlClient Data Provider) that I get, irrespective of whether I enter a password or not.


This is on a XP machine trying to connect to the remote webhosting company via the internet.

I can ping the server

I have enabled shared memory and tcp/ip in protocols, named pipes and via are disabled

I do not have any aliases set up

No I do not force encryption

I wonder if you have any further suggestions to this problem?

View 7 Replies View Related

SSIS Package Hangs In Data Flow, Magically Works After Opening And Closing Components

Nov 2, 2006

We're experiencing a problem where intermittently our SSIS packages will hang. There are no log errors or events in the event viewer. It will happen whether the package is executed from the SQL Job Agent or run from BIDs. When running from BIDs it appears to hang inside one of the data flows (several parallel pipes with sorts, merge joins etc...). It appears to hang in multiple pipes within the data flow component. The problem is reproducable, we just kill it and re-run, and it appears to hang in the same places.

Now here's the odd thing: as we simply open and close some of the components in the pipe line after the place it hangs, a subsequent run will go further in the pipeline before hanging. If we open and close all the components after the point it initially hung, the data flow will run fine, from there on out. When I say "open and close" I mean no changes are made, we simply double-click the component, like a merge join, then click 'close.'

To me this does not seem like a memory problem but likely something is wrong with the metadata, where opening a component and closing it somehow alters the metadata to "right it".

This seems to occur intermittently after we make modifications to the package. It's like if you make any mod, even unrelated to the data flow, you then have to go through and open and close every component in your package to ensure it will work. Again, no errors or warnings are fired.

Has anyone seen this type of problem?

View 10 Replies View Related

Data Format Issue While Importing Data From Excel To SQL

Jul 17, 2007

hi



when i m importing data from excel to Sql using DTS the column which has text content was not imported as same in excel sheet. whereas a special character is appearing in between the lines. the text field contains multiple lines but the conetent is imported in single line .

ex:









ARIZONA
ALABAMA
STATE


but i m getting imported

as :
ARIZONA ALABAMA STATE

How to Format a single column while importing?



Regards

Raj

View 1 Replies View Related

I Don't Understand How This Works, However It Works (sometimes)

Sep 26, 2006

I use the code below for updating data from a AS400 Liked server. I dont understend how the WHERE NOT EXISTS( sections work however usualy they do, in this case it does not andt I can't seem to find out why.

Does anyone see the error?

Thanks

--=========================================
--Create a local temporary table that hold
--all the data from the source table
--=========================================

SELECT * INTO #TEMP FROM dbo.LINK_LTTSTOC

--=========================================
--Remove table entries that are no longer
--needed or that have to be updated
--=========================================

DELETE FROM LTTSTOCK

WHERE NOT EXISTS( SELECT * FROM #TEMP

WHERE LTTSTOCK.WarehouseNo = LTWHLO

AND LTTSTOCK.Location = LTWHSL

AND LTTSTOCK.ItemNo = LTITNO

AND LTTSTOCK.NumberAvail = LTAVAL

)

--=========================================

--Insert data that is missing or that

--needed to be updated and was previously

--deleted

--=========================================

INSERT INTO dbo.LTTSTOCK(WarehouseNo,Location,ItemNo,NumberAvail,rowguid)

SELECT DISTINCT LTWHLO,LTWHSL,LTITNO,LTAVAL, NEWID()

FROM #TEMP

WHERE NOT EXISTS( SELECT * FROM LTTSTOCK

WHERE WarehouseNo = LTWHLO

AND Location = LTWHSL

AND ItemNo = LTITNO

AND NumberAvail = LTAVAL

)

--========================================

--Remove local temporary table.

--========================================

DROP TABLE #TEMP

View 2 Replies View Related

SQL Data Into XML Format

Mar 18, 2003

Hi,
how can transfer sql server data into XML format?.
Thanks,
Ravi

View 3 Replies View Related

Data Format

May 13, 2004

How can I display a value as 0.00 from a field of datatype numeric?

View 1 Replies View Related

Format DataSource Data

Oct 14, 2007

I have an SQL database with a number of fields, one of which is for storing the date (datetime).When I insert data into the table, I only supply the date because I don't want or need the time to be listed. However, when I execute a query, the data that shows up in my gridview is (e.g) 13/10/2007 12:00:00 AM.
What I want ti know is, how can I format the datetime when I run the query so that it only shows 13/10/2007?This is how I'm retrieving the data at the moment:
SqlCommand command = new SqlCommand("SELECT * FROM tblMail", sqlConn);conn.Open()SqlDataReader reader = command.ExecuteReader();dataGrid.DataSource = reader;dataGrid.DataBind();conn.close()
In my dataGrid, I have a number of fields that are bound to the data source, such as Date, Name, Address etc etcAnyway, any ideas on how I can format the SQL DateTime so it only shows the date in my datagrid?

View 2 Replies View Related

Exporting Data Into .CSV Format

Jan 17, 2008

Hi
I am trying to export data from SQL which is ok and I can do that part.  However from the result of the query I need to add the values of certain columns.  Because I'm a newbie to SQL I'll explain and try and show images as best as I can as we go....
So far I have written a query
select Stockitem.code, Warehouseitem.ConfirmedQtyInStock, Warehouseitem.UnConfirmedQtyInStock, Warehouseitem.QuantityAllocatedStock, Warehouseitem.QuantityAllocatedBOM, Warehouseitem.QuantityAllocatedSOP, WarehouseItem.WarehouseIDfrom WarehouseItem INNER JOIN StockItem ONWarehouseItem.ItemID = Stockitem.itemidINNER JOIN BinItem ONBinitem.itemid = stockitem.itemidwhere WarehouseItem.WarehouseID = '3403' AND BinItem.BinName LIKE 'S%' AND BinItem.BinName <> 'S' OR BinItem.BinName LIKE 'T%' AND BinItem.BinName <> 'T'order by stockitem.code
 This returns the following results....
 Code             ConfirmedQtyInStock      UnConfirmedQtyInStock      QuantityAllocatedStock        QuantityAllocatedBOM      QuantityAllocatedSOP       WarehouseID
12345             96.00000                        .00000                              .00000                                 3.00000                            13.00000                           3403
Now I am trying to find out the amount of freestock available for everything with the WarehouseID 3403.  Therefore in the example above to be able to workout how many '12345' (Code) we have in stock, the equation used to find out the free stock available is as follows....
 Free Stock = (ConfirmedQtyInStock + UnConfirmedQtyInStock) – (QuantityAllocatedStock+ QuantityAllocatedBOM + QuantityAllocatedSOP)
Therefore if I manually use the equation above the amount of freestock available =
 Free Stock = (96+0) - (0+3+13) = 80 (free stock).
Then once I have the equation to be able to output the 'freestock' quantity, I need to export the results into an excel spreadsheet with the following layout...
 ColumnA
Code,FreeStock
12345,80
Hope I've explained this in a good manner, any help would be gratefully received.
Simba

View 2 Replies View Related

Data Format Transformations

Jun 18, 2008

I am using SQL 2005 SSIS.  I need to do a data conversion for a date field in a txt file.  I used the import wizard to bring my txt file into SQL 2005 but didn't convert the date.  The date is displayed in the flat file as 20070612.  Can someone help me convert the date.  I did add an OLE DB Source to the Data Flow screen and selected command what do I do next and what do I write?

View 9 Replies View Related

Format Column Data

Apr 3, 2006

Hi,
I am entering values from .Net app to a table in Sql 2k. The Identity field needs to be in 'ABC0000012' format (3 fixed letters and 7 digits - incremented by 1). My code MUST BE within a stored_proc. I am trying to format the column to have reqd. number of preceeding zeros. How can I get those ?
Pls help.Sam
 

View 3 Replies View Related

Outputing Data In A Particular Format

May 31, 2006

I wish to extract the data from an SQL database table to a txt file. There are certain integer fields that I want to output as 7 chars long with leading zeroes. So for example if the column January_total contains the value 123 I would want that ouptut as 0000123. Can anyone advise me as to what the best way to go about doing this is - I've looked at how CAST and CONVERT work but they dont seem to to offer the functionality I require.

View 2 Replies View Related

Check Data Format

Jun 18, 2001

1)How would l write sintax to check data format in sql? Eg field customerNo should be 10 characters long and alpha numeric. Date should be etc.

2) How do l reference a value in another cursor?

View 1 Replies View Related

Export Data To XML Format

Jan 7, 2005

Hi,

What's the best way to export data from SQL Server to XML format. I've taken over a VB application written to carry out this task but it seems more complicated than it needs to be. Is it possible to just miss out VB and use say a DTS program instead??

I have been given a schema(XSD) file and as far as I'm aware any xml has to be formatted according to this schema.

Thanks
Matt

View 2 Replies View Related

Export Data From SQL To .PDF Format

Feb 6, 2007

is there a specific command that can do this using the query analyzer?

Please help me on this.

Thank you.

Your future is made by the things you are presently doing.

View 10 Replies View Related

Converting Data Format

Nov 16, 2007

hi guys how can I change this format

date|amount
02/25/07| 00.00
02/26/07| 00.00

To
date|amount
02/25/07| 0.00
02/26/07| 0.00
thanks!

View 3 Replies View Related

Getting Data In Particular Format In View

Jul 20, 2005

I want a report in excel from my SQL database from one table. I wantto create a view and then use DTS package to export it to excelformat.But how can i get the following format in a view?? They should begrouped by date.Date Column 1 column 2 column 329/10/2003 one $30.00 somedatetwo $45.00 somedata2three $67.00 somedata3Total ******** $142.0030/1/2003 blah blah blahblah blah blahand so on . How can i get such a format in a view.Thanks in advance. I can't use SHAPE command in view i guess.

View 1 Replies View Related

Data In Desired Format

May 5, 2008

Query:
Select convert(CHAR(45),surname+','+fname) Name from beneficiary
Output from the above query:
Name
---------------------------------------------
BICKFORD ,ROSA
KOCH ,ERIC

I am desired Results as follows: Please help
Name
---------------
BICKFORD,ROSA
KOCH,ERIC

View 8 Replies View Related

How To Get Week Data As 1-2 And 3-4 Format

Apr 25, 2008

I am doing reports and I am generating reports for weeks data. And I need data in the format of 1-2 week, 3-4 week and etc. So, I have tried to use aggregate functions also but they are not applicble for table and lists where all my report items are present. So. some one who can come up with the solution will be appreciated.

View 8 Replies View Related

Converting The Value To Data Format

Aug 14, 2007

Hello Everyone,
Please guide me in converting the value to date format.
from source i'm getting the value (which is acchally a data value) '20070730'.
I need this value to be in date format '2007/07/30'
Please help me in getting it done.
thank you

View 2 Replies View Related







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