Search Results

Search found 26283 results on 1052 pages for 'temporary table'.

Page 108/1052 | < Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >

  • SQL Server: Check if table exists

    - by Vincent
    I would like this to be the ultimate discussion on how to check if a table exists in SQL Server 2000/2005 using SQL Statement. When you Google for the answer, you get so many different answers. Is there an official/backward & forward compatible way of doing it? Here are two ways to start discussion: IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME='mytablename') SELECT 1 AS res ELSE SELECT 0 AS res; IF OBJECT_ID (N'".$table_name."', N'U') IS NOT NULL SELECT 1 AS res ELSE SELECT 0 AS res; MySQL provides a nice SHOW TABLES LIKE '%tablename%'; statement. I am looking for something similar.

    Read the article

  • Analysis services with non normalized table

    - by Uwe
    I have a table with several million rows. Each row represents a user session. There is a column called user which is not unique. There can be multiple sessions per user. I want to use Analysis services to get me the additional properties per user. Example: How many users (unique!) had a session longer than x minutes. How is that possible without changing the database. Note: there is no lookup-table and I cannot create one. What I am able of at the moment is to ask how many sessions were longer then x minutes.

    Read the article

  • Exporting SQL Server table to CSV issue commas, tabs and quotes

    - by cyberpine
    After we export to flat file CSV, columns with commas, quotes and tabs cause problems in Excel. The vendor needs to read the file in Excel to make manual changes and then needs it in a flat file format CSV format to load using PL/SQL into an Oracle table. I can remove those characters from the table in SQL Server, but is there a smarter way? Does it make sense to save to CSV when done in Excel and will that cause problems when attempting to load the file into Oracle anyway? Also, we need the first row to have column names.. any SQL way to generate all the files in one swoop (the the tiles in the first row) rather than using export to flat file?

    Read the article

  • Mapping class properties to generic columns in table .NET

    - by Tony_Henrich
    I have have a SQL Server table which has generic names like Text1, Text2.. etc. The table was designed like this because the same structure is used for different projects. I have a class in .NET which has properties. Say a Customer class has a property called FirstName. How can I do the mapping from FirstName to Text1 just once (central place) in the application so that I don't have to remember and hard code the mappings all over the app when I create the different DAL methods? For example, I want the app to know when I want to update, insert a FirstName, the DAL automatically uses Text1. Basically I don't have to remember which property goes to which column. The idea is so the developers do not map the properlies/columns in a wrong way. It's always consistent. Note: Database inserts, updates and deletes are allowed through stored procedures only.

    Read the article

  • How to define a query om a n-m table

    - by user559889
    Hi, I have some troubles defining a query. I have a Product and a Category table. A product can belong to multiple categories and vice versa so there is also a Product-Category table. Now I want to select all products that belong to a certain category. But if the user does not provide a category I want all products. I try to create a query using a join but this results in the product being selected multiple times if it belongs to multiple categories (in the case no specific category is queried). What kind of query do I have to create? Thanks

    Read the article

  • MySQL UNION query from one table + ORDER BY

    - by ilnur777
    I have one table with two queries and I need to sort it with descending type using ORDER BY. Here is my MySQL query that does not work properly: (SELECT `text` FROM `comments` WHERE user_fr='".$user."' && archive='1' ORDER BY `is_new_fr` DESC) UNION (SELECT `text` FROM `message` WHERE user_to='".$user."' && archive='1' ORDER BY `is_new_to` DESC) Description! is_new_fr and is_new_to counts total new messages. Here is my table contant: user_fr | user_to | archive | is_new_fr | is_new_to| text name1 | name2 | 1 | 2 | 0 | testing... name2 | name1 | 1 | 0 | 5 | testing ... I want to make an order that 1st will display note that has more messages to few, or by another words using DESCending type. This is the display on the page I want to do: Open dialog with name2. Messages (5) Open dialog with name1. Messages (2) Thank you!

    Read the article

  • iPhone: error: request for member 'table' in something not a structure or union

    - by Jack Griffiths
    Hi there, When it comes to compiling my application, I get the error mentioned in the title. How would I go about remedying this error? Basically, I want to get from one table to the other. Hierarchy, navigation. NextViewController.m #import "RootViewController.h" #import "NextViewController.h" @implementation NextViewController - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview // Release anything that's not essential, such as cached data } - (void)dealloc { [super dealloc]; } - (IBAction) changeTable:(NSString *)str{ tblCSS.table = str; } The last line contains the error. If you need any more code, just ask. I'll amend this post with it. Cheers, Jack

    Read the article

  • Sql Server copying table information between databases

    - by Andrew
    Hi, I have a script that I am using to copy data from a table in one database to a table in another database on the same Sql Server instance. The script works great when I am connected to the Sql Server instance as myself as I have dbo access to both databases. The problem is that this won't be the case on the client's Sql Server. They have seperate logins for each database (Sql Authentication Logins). Does anyone know if there is a way to run a script under these circumstances. The script would be doing something like. use sourceDB Insert targetDB.dbo.tblTest (id, test_name) Select id, test_name from dbo.tblTest Thanks

    Read the article

  • ms-access: DB engine cannot find input table or query

    - by every_answer_gets_a_point
    here's the query: SELECT * FROM (SELECT [Occurrence Number], [Occurrence Date], [1 0 Preanalytical (Before Testing)], [Cup Type], NULL as [2 0 Analytical (Testing Phase)], [2 0 Area], NULL as [3 0 Postanalytical ( After Testing)],NULL as [4 0 Other], [Practice Code], [Specimen ID #] FROM [Lab Occurrence Form] WHERE NOT ([1 0 Preanalytical (Before Testing)] IS NULL) UNION SELECT [Occurrence Number], [Occurrence Date],NULL, [Cup Type],[2 0 Analytical (Testing Phase)], [2 0 Area], NULL,NULL, [Practice Code], [Specimen ID #] FROM [Lab Occurrence Form] WHERE NOT ([2 0 Analytical (Testing Phase)] IS NULL) UNION SELECT [Occurrence Number], [Occurrence Date],NULL, [Cup Type],NULL, [2 0 Area], [3 0 Postanalytical ( After Testing)],NULL, [Practice Code], [Specimen ID #] FROM [Lab Occurrence Form] WHERE NOT ([3 0 Postanalytical ( After Testing)] IS NULL) UNION SELECT [Occurrence Number], [Occurrence Date],NULL, [Cup Type],NULL, [2 0 Area], NULL, [4 0 Other] FROM [Lab Occurrence Form], [Practice Code], [Specimen ID #] WHERE NOT ([4 0 Other] IS NULL) ) AS mySubQuery ORDER BY mySubQuery.[Occurrence Number]; for some reason it doesnt like [Practice Code]. it's definitely a column in the table so i dont understand the problem. the error is the microsoft office access database engine cannot find the input table or query 'Practice Code'........

    Read the article

  • Get records from Access table

    - by chianta
    On Access 2010 I need to use VBA to get the records in a table, process them and put them in a new table. Could you tell me how can I do? Is there a way similar to C # to put everything into a datatable the result of a query? I found an example on how to get the data. http://pastebin.com/bCtg20jp But it always fails on the first statement "ADODB.Recordset". I went to see the included libraries and library that uses ADODB is already included "Microsoft Access 14.0 Object Library". Thanks

    Read the article

  • MySQL: Blank row in table after LOAD DATA INFILE

    - by Tom
    Hi, I'm uploading a large amount of data from a CSV (I'm doing it via MySQL Workbench): LOAD DATA INFILE 'C:/development/mydoc.csv' INTO TABLE mydatabase.mytable CHARACTER SET utf8 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r'; However, I'm noticing that it keeps adding an empty line full of nulls/zeros after the last record. I'm guessing it's because of the "LINES TERMINATED" command. However, I need that to load the data in correctly. Is there some way around this / some better SQL to avoid the blank row in the table? Thanks

    Read the article

  • How to convert an HTML table to an array in python

    - by user345660
    I have an html document, and I want to pull the tables out of this document and return them as arrays. I'm picturing 2 functions, one that finds all the html tables in a document, and a second one that turns html tables into 2-dimensional arrays. Something like this: htmltables = get_tables(htmldocument) for table in htmltables: array=make_array(table) There's 2 catches: 1. The number tables varies day to day 2. The tables have all kinds of weird extra formatting, like bold and blink tags, randomly thrown in. Thanks!

    Read the article

  • Windows Azure Table Storage LINQ Operators

    - by Ryan Elkins
    Currently Table Storage supports From, Where, Take, and First. Are there plans to support any of the other 29 operators? If we have to code for these ourselves, how much of a performance difference are we looking at to something similar via SQL and SQL Server? Do you see it being somewhat comparable or will it be far far slower if I need to do a Count or Sum or Group By over a gigantic dataset? I like the Azure platform and the idea of cloud based storage. I like Windows Azure for the amount of data it can store and the schema-less nature of table storage. SQL Azure just won't work due to the high cost to storage space.

    Read the article

  • Using set with values from a table

    - by gozzilli
    I'm writing a database of all DVDs I have at home. One of the fields, actors, I would like it to be a set of values from an other table, which is storing actors. So for every film I want to store a list of actors, all of which selected from a list of actors, taken from a different table. Is it possible? How do I do this? It would be a set of foreign keys basically. I'm using a MySQL database for a Django application (python), so any hint in SQL or Python would be much appreciated. I hope the question is clear, many thanks.

    Read the article

  • Fluent NHibernate SchemaExport to SQLite not pluralizing Table Names

    - by weenet
    I am using SQLite as my db during development, and I want to postpone actually creating a final database until my domains are fully mapped. So I have this in my Global.asax.cs file: private void InitializeNHibernateSession() { Configuration cfg = NHibernateSession.Init( webSessionStorage, new [] { Server.MapPath("~/bin/MyNamespace.Data.dll") }, new AutoPersistenceModelGenerator().Generate(), Server.MapPath("~/NHibernate.config")); if (ConfigurationManager.AppSettings["DbGen"] == "true") { var export = new SchemaExport(cfg); export.Execute(true, true, false, NHibernateSession.Current.Connection, File.CreateText(@"DDL.sql")); } } The AutoPersistenceModelGenerator hooks up the various conventions, including a TableNameConvention like so: public void Apply(FluentNHibernate.Conventions.Instances.IClassInstance instance) { instance.Table(Inflector.Net.Inflector.Pluralize(instance.EntityType.Name)); } This is working nicely execpt that the sqlite db generated does not have pluralized table names. Any idea what I'm missing? Thanks.

    Read the article

  • get values from table as key value pairs with jquery

    - by liz
    I have a table: <table class="datatable" id="hosprates"> <caption> hospitalization rates test</caption> <thead> <tr> <th scope="col">Funding Source</th> <th scope="col">Alameda County</th> <th scope="col">California</th> </tr> </thead> <tbody> <tr> <th scope="row">Medi-Cal</th> <td>34.3</td> <td>32.3</td> </tr> <tr> <th scope="row">Private</th> <td>32.2</td> <td>34.2</td> </tr> <tr> <th scope="row">Other</th> <td>22.7</td> <td>21.7</td> </tr> </tbody> </table> i want to retrieve column 1 and column 2 values per row as pairs that end up looking like this [funding,number],[funding,number] i did this so far, but when i alert it, it only shows [object, object]... var myfunding = $('#hosprates tbody tr').each(function(){ var funding = new Object(); funding.name = $('#hosprates tbody tr td:nth-child(1)').map(function() { return $(this).text().match(/\S+/)[0]; }).get(); funding.value= $('#hosprates tbody tr td:nth-child(2)').map(function() { return $(this).text().match(/\S+/)[0]; }).get(); }); alert (myfunding);

    Read the article

  • Select from table by knowing only date without time (ORACLE)

    - by Abdulrhman
    Greeting People,, I'm trying to retrieve records from table by knowing the date in column contains date and time. let me explain my self clearly with this example: suppose i have table called t1 which contains only two column name, date respectively the data stored in column date like this "8/3/2010 12:34:20 PM" i want to retrieve this record by this query for example: Select * from t1 where date="8/3/2010" // notes i don't put the time. this query give me nothing ! SO now my question is how can i retrieve date by knowing only date without the time !

    Read the article

  • Alternative design for a synonyms table?

    - by Majid
    I am working on an app which is to suggest alternative words/phrases for input text. I have doubts about what might be a good design for the synonyms table. Design considerations: number of synonyms is variable, i.e. football has one synonym (soccer), but in particular has two (particularly, specifically) if football is a synonym to soccer, the relation exists in the opposite direction as well. our goal is to query a word and find its synonyms we want to keep the table small and make adding new words easy What comes to my mind is a two column design with col a = word and col b = delimited list of synonyms Is there any better alternative? What about using two tables, one for words and the other for relations?

    Read the article

  • MySQl - update field by counting data in other table

    - by Qiao
    There are two tables. One is users info "users", one is comments info "comments". I need to create new field "comments" in users table, that contains number of comments of that user. Table "comments" has "user" field with user's id of that comment. What is optimal way to count number of comments by every user? With php you should write script that selects every user and than count number of his comments and then update "comments" field. It is not hard for me, but boring. Is it possible to do it without php, only in MySQL?

    Read the article

  • How to Loop & rename MySQL table in Perl

    - by Nano HE
    Hi, Could you plesae teach me how to Loop & rename MySQL table in Perl. Thanks. my code snippet attached use strict; use warnings; use DBI; my $dbh = DBI->connect( 'DBI:mysql:database=dbdev;host=localhost', 'dbdev', 'dbdevpw', { RaiseError => 1, AutoCommit => 1 }, ); my $sql = RENAME TABLE old_table TO new_table; my $sth = $dbh->prepare($sql); while (<DATA>){ chomp; // How to implement the Rename all the old tables with the while loop. $sth->execute(); }

    Read the article

  • Rails CSV import, adding to a related table

    - by Jack
    Hi, I have a csv importing system on my app (used locally only) which parses the csv file line by line and adds the data to the database table. This is based on a tutorial here. require 'csv' def csv_import @parsed_file=CSV::Reader.parse(params[:dump][:file]) n = 0 @parsed_file.each_with_index do |row, i| next if i == 0 #ignore the first row course = Course.new course.title = row[0] course.unit_code = row[1] course.course_type = row[2] course.value = row[3] course.pass_mark = row[4] if course.save n = n+1 GC.start if n%50==0 end flash.now[:message] = "CSV Import Successful, #{n} new courses added to the database." end redirect_to(courses_url) end This is all in the courses controller and works fine. There is a relationship that courses HABTM years and years HABTM courses. In the csv file (effectively in row[5] to row[8]) are the year_id s. Is there a way that I can add this within the method above. I am confused as to how to loop over the 4 items and add them to the courses_years table. Thank you Jack

    Read the article

  • A table that has relation to itself issue

    - by Mostafa
    Hi , I've defined table with this schema : CREATE TABLE [dbo].[Codings]( [Id] [int] IDENTITY(1,1) NOT NULL, [ParentId] [int] NULL, [CodeId] [int] NOT NULL, [Title] [nvarchar](50) COLLATE Arabic_CI_AI NOT NULL, CONSTRAINT [PK_Codings] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] And fill it up with data like this : Id ParentId CodeId Title ----------- ----------- ----------- ---------- 1 NULL 0 Gender 2 1 1 Male 3 1 2 Female 4 NULL 0 Educational Level 5 4 1 BS 6 4 2 MS 7 4 3 PHD Now , I'm looking for a solution , in order , When i delete a record that is parent ( like Id= 1 or 4 ), It delete all child automatically ( all records that their ParentId is 1 or 4 ) . I supposed i can do it via relation between Id and Parent Id ( and set cascade for delete rule ) , But when i do that in MMS , the Delete Rule or Update Rule in Properties is disabled . My question is , What can i do to accomplish this ? Thank you

    Read the article

  • Getting error on inserting tuple values in postgreSQL table using python

    - by rahman.bd
    Hello, I want to keep last.fm's user recent music tracks list to postgresql database table using pylast interface.But when I tried to insert values to the table it shows errors.Code example: for i, artist in enumerate(recent_tracks): for key in sorted(artist): cur.execute(""" INSERT INTO u_recent_track(Playback_date,Time_stamp,Track) VALUES (%s,%s)""", (key, artist[key])) conn.commit() cur.execute("SELECT * FROM u_recent_track;") cur.fetchone() for row in cur: print ' '.join(row[1:]) cur.close() conn.close() Here "recent_tracks" tuple have the values for example: artist 0 - playback_date : 5 May 2010, 11:14 - timestamp : 1273058099 - track : Brian Eno - Web I want to store these value under u_recent_track(Tid,Playback_date,Time_stamp,Track).Can anybody have idea how to sort out this problem? when I tried to run, it shows error: Traceback (most recent call last): File "F:\JavaWorkspace\Test\src\recent_track_database.py", line 50, in <module> VALUES (%s,%s,%s)""", (key, artist[key])) IndexError: tuple index out of range Thanks in advanced!

    Read the article

< Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >