How Do I Make SQL Database Tables?

Nov 28, 2005

No, I don't need a step-by-step (necessarily). I've been looking at W3Schools tutorial and it says to:


Code:


CREATE TABLE Person
(
LastName varchar,
FirstName varchar,
Address varchar,
Age int
)



But what is that? A text file saved with a .sql extension. Something typed at a command prompt? Is there an SQL interface?

--William

View 5 Replies


ADVERTISEMENT

Make A Join In Between 2 Tables?

Jan 17, 2012

I am trying to make a join in between 2 tables. One table which we can called func has 2 columns a and column b.

The other table which is called export has 16 columns. I will like to make a join in these tables and insert the result of the join into another table i have.

The table that is going to have the information has 4 columns, so I will get 1 column information from table export, and the other 2 column from table func, the other column shall be left in blank for the time being.

The problem is also that when i make a select from table export, there are only some values i want to get, this are values from a period where there is only the periods 11.

Select Company, A and B

FROM FUNC, EXPORT where period = '1101', '1102', '1103'

insert into new table?

View 7 Replies View Related

How To Make Comparison Between Two Tables

Jun 20, 2014

This is my scenario. I have two tables

1)FM_SHARE_RO_MOVED (5 COLUMNS)
2)PARSE_FILE INSTANCE (16 COLUMN)

column in FM_SHARE_RO_MOVED
File_name
FG00E3PK.csv

column in PARSE_FILE INSTANCE
File_Location
D:ToParseFLEXSTARPNGFLEXSTAR12FG00E3PK.csv

I want to check if the values in file name in FM_SHARE_RO_MOVED is available in PARSE_FILE_INSTANCE. And if it is available the update a column in FM_SHARE_RO_MOVED

Status
OK

View 5 Replies View Related

Erroon Trying Take Make A Relation Between 2 Tables

Jun 27, 2007

I want a PK-FK relation between my tables:
Products (PK = ProductID)Orders = (FK = ProductID)
How can I do this in SQL 2005?
 
 

View 1 Replies View Related

Failing To Make Relationship Between To Tables Of SQL Server DB

Apr 27, 2004

Hi,

I'm trying to make relationship between two tables "reservation" and "charges". The column is "booking_ticket". Its giving me following error :


'reservations (akr)' table saved successfully
'charges (akr)' table
- Unable to create relationship 'FK_charges_reservations'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE statement conflicted with COLUMN FOREIGN KEY constraint 'FK_charges_reservations'. The conflict occurred in database 'limp', table 'reservations', column 'booking_ticket'.


I used to make relationship before , but never found this problem.


Kindly guide me to solve it.

Regards,

View 1 Replies View Related

How To Make Tables && Stored Procedures In MSDE?

Nov 18, 2005

Hello, I am a beginner using MSDE & Visual Basic.NET standard version (not Visual Studio.NET) . MSDE was downloaded from microsoft.com yesterday, which is sql2ksp3.exe.

View 15 Replies View Related

Any Suggestions On How To Make 1 Flow Do Many Dimensional Tables

Mar 4, 2008

OK looking for anyone out there that may have already tackled this and what they may have learned
I have multiple flat files providing dimensional data to multiple tables. The source files and destination tables are very similiar in structure, the columns are named differently in each table

ID - surrogate key
Code - match for lookup
Desc - updated column

flow options I have considered or might work are:
source (flat file) - this is easy to make dynamic

lookup against existing Table -

1. I can make this dynamic on the advanced tab by restricting memory. have not really tried this option yet. Seems like it might be a performance issue for large tables but so far it seems all these dimensional tables will be small.
2. Could create a view in the control flow,before execution of the DataFlow with generic column names against a variable table and use this same view for every lookup - again not sure of performance etc
3. could just replace this with a merge/join as long as it does full outer, have not used this option so I'm not quite clear on the dynamic properties

now the last part update or insert
Insert

1. Seems like I could use the OLEDB destination and make the table a variable - have not tried to see if this works.

Update-

1. looking at the OLEDB command but not sure how it would handle a variable table name in an update statement - will need to try this out
2. OLEDB command that calls a proc that executes a dynamically built update statement
3. Write the update items to a generic holding table then run an update in the control flow from a dymanically built sql statement.

View 14 Replies View Related

How To Make A Temp Table Using Info Fromtwo Tables

Mar 8, 2008

I have one database named StudInfo. It has two tables named StudentInfo, and GradeInfo.
StudentInfo conntains 4 columns. The 1st one is StudentID (PK) int, LastName varchar(10), FirstName varchar(10), and PhoneNumber int.

GradeInfo contains 4 columns also StudentID (FK) int, GradeID varchar(10), Grade int, Date Datetime.

What I would like to know is how using a T-sql query I could make a temp table with studentID, LastName, FirstName, and then the average of all the different types under GradeID. As of right now I have been limiting the names that are put into GradeID to Homework, Daily, Test, Quiz, and Bonus. When I say average I mean the average of all Homeworks under one studentID, and all Daily under one studentID... etc. I would like the info returned for each student in studentID. Allow Nulls has been turned off.

Never assume someone knows what you are talking about.

View 6 Replies View Related

Is It Possible To Make An Installer Package(msi And Exe Files) For Stored Procedures,tables,views

Nov 9, 2007

Hi,

I've a doubt regarding deploying and creating package (MSI and EXE files) for SQL Stored procedures,views,tables,functions,triggers etc.,just like ASP.NET application by publishing and deploying..Is it possible in the same way for sql objects.If so,pls help me how to do it?

Thanks in advance.

View 1 Replies View Related

DB Design :: Buffer Database - Insert Information From Partners Then Make Update To Main Database

Oct 29, 2015

I actually work in an organisation and we have to find a solution about the data consistancy in the database. our partners use to send details to the organisation and inserted directly in the database, so we want to create a new database as a buffer database to insert informations from the partners then make an update to the main database. is there a better solution instead of that?

View 6 Replies View Related

Best Way To Make A Database Not In Use?

Apr 9, 2006

Hi.

I am almost wrapping up a project of my own and I will have the option to restore the database, so dropping the existing one and then running the SQL script to create the database, tables, stored procedures and so on.



My question is, (using .NET 2.0 C#) - what is the best way to resolve the "cannot drop database as it is currently in use" message, or some message of the similar sort?

Even though I specified "USE MASTER" in the commandText string, there will be somewhere, in a situation, where the database will still be in use.

How can I forcefully make it NOT in use, drop it and do other things I like to?

What is the best way?



Many thanks!

View 9 Replies View Related

Make A Copy Of Database

Nov 17, 2006

Hi:
 I have installed sql server 2005 express and SQL Server Management Studio Express
How can I generate a database from another copying the structure and data?
 For example I have a database named Customers, I need to make a copy of Customers named Customers2. Customers2 also will be attached to the same Database Engine Server where Customers is attached.
How I Can do it?
Thanks!
P.S.
I tryied to make a copy of mdf an ldf files from Windows Explorer and renamed these files but I could not attach to the same Database Engine Server because I got an error.

View 1 Replies View Related

How To Make Copies Of Your Sql Database?

Jan 31, 2008

Hi,

at work all the databases i use are only accessible via the local network, i am wanting to take a copy of the databases and save them as a database file so i can burn them onto cd and take home with me so i can get some extra work done on the weekend (i'd also like to start doing this so i have backed up copies of the database incase anything happens to it)

i was wondering how i can do this? are there any tutorials on the web that someone can point me to? i have SQL Server 2005 Management Studio Express.

TIA

View 1 Replies View Related

Make A User For The Database

Nov 14, 2003

hi
how can i make a user give it a name ReportUser and a password msdn for a certain database named on the sql server 2000 and thank you for your help and oyur time

View 1 Replies View Related

How To Make Database Unavailable?

Apr 4, 2002

Hi!
Do you now if it is possible to make database unavailable for users after business hours and how.

Thank you in advance,
Elena.

View 6 Replies View Related

Looking To Make A Database Of Fingerprints

Jun 8, 2007

I work as a computer repair tech for my company and have been offered the opportunity to do a project. I'm looking to make a database of about 2000 peoples fingerprints (2 copies of each finger). We have Microsoft SQL Server but I have no Idea where to start. The vision is, to have an RFID scanner and have everyone swipe their badge then scan their prints and it automatically associates their prints with the badge number. Is there an easier or more simple way to do this or do you have any pointers on where to start? any help will be greatly appreciated. Thanks.:angel:

View 6 Replies View Related

How To Make Database For Reference

Jun 9, 2014

I am making a project where I have to add city, agentname, rankofagent, referenceagent name the problem is that who can I make a table where suppose I add member a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p like that

b is joined by a
c is joined by b
d by c, e by d and so on,

What I want here is that how can I get the result suppose i want to see that chain of p. I want result to be printed as a,b,c,d,e,f,g,h,i,j,k,l,m,n,o either result should be in horizontal form or vertical. with or without comma. I am doing this in SQL....

View 2 Replies View Related

How To Make Backup Of Database To URL

Aug 3, 2015

There is a need to make a backup of a database to URL. how to do this.

View 2 Replies View Related

Make Changes To A Production Database!

Jul 23, 2005

Hello faculties,We've a production database that is being used by one of our clientsas a backend for his website. The database size is around 1GB.Recently we added some tables to our local database which is areplica of the production database. Now we need to apply the samechanges at the production one aslo.I've no clue about what steps should i implement.Please guide me!Thanks in advanceDebian*** Sent via Developersdex http://www.developersdex.com ***

View 3 Replies View Related

Make Copy Of Database

Jan 8, 2008

Hi

I need to make a copy of a sql server database for test purposes but the database is live
how would i make a copy of it without it being affected?

thanks

View 4 Replies View Related

How To Make This Insert Data Into Sql Database

Dec 26, 2007

Hallow
My code does not insert Data into Database, please can someone look on it and give a technical problem over here please
It does not generate any error please, when I CLICK THE BUTTON IT DOES NOT GENERATE ERROR, IT GIVE ME THE MESSAGE THAT ITEM ADDED, BUT WHEN I LOOK MY TABLE NOTHING ID INSIDE Sub Add_To_Cart(ByVal Src As Object, ByVal Args As EventArgs)
 Dim FVProductID As Label = FormView1.FindControl("ProductID")
Dim FVProductName As Label = FormView1.FindControl("ProductName")Dim FVProductPrice As Label = FormView1.FindControl("ProductPrice")
 Dim DBConnection As SqlConnection Dim DBCommand As SqlCommand
Dim sql As String
Dim SQLAddString As String
 DBConnection = New SqlConnection("Data Source=MANDARISQLEXPRESS;Initial Catalog=SHOES;Integrated Security=True")
DBConnection.Open()
If Not Session("OrderID") Is Nothing Then
 sql = "SELECT Count(*) FROM ShoppingCart " & _ "WHERE OrderID = '" & CType(Session("OrderID"), String) & "' " _
& "AND ProductID = '" & FVProductID.Text & "'"
 DBCommand = New SqlCommand(sql, DBConnection)
 
If DBCommand.ExecuteScalar() = 0 Then
 SQLAddString = "INSERT INTO ShoppingCart (OrderID, ProductID, OrderDate, ProductName, ProductPrice, ProductQnty) VALUES (" & _
"'" & CType(Session("OrderID"), String) & "', " & _"'" & FVProductID.Text & "', " & _
"'" & Today() & "', " & _"'" & FVProductName.Text & "', " & _
"'" & FVProductPrice.Text & "', 1)"DBCommand = New SqlCommand(SQLAddString, DBConnection)
DBCommand.ExecuteNonQuery()
End If
End If
DBConnection.Close()
 
Src.Text = "Item Added"Src.ForeColor = Color.FromName("#990000") Src.BackColor = Color.FromName("#E0E0E0")
Src.Font.Bold = True
 
End Sub

View 3 Replies View Related

How To Make Database Accessible To User

Apr 12, 2008

I am setting up a web application, where the application needs to access a database. I have created the user (for the application) and it can log in to the SQL 2005 Sp2 server, but when I try to open the required database using Server Management Studio, it says "The database [name] is not accessible. (ObjectExplorer)"How do I make a database accessible to a login, using Server Management Studio?

View 2 Replies View Related

How To Make Database / Log Size Smaller

Apr 16, 2002

Hi all,

I found a database file and a log file over 2G on mssql 2000 server. Actually, they only need around 200M. I try to backup, truncate the database in order make the size smaller. But the size cannot be smaller. How can I do it?

Simon

View 3 Replies View Related

How To Make Genric Connection To SQL Database

Jun 16, 2003

I want to remove hard codings like below

servername.EcomAdminDB.dbo.tablename

to

ecom_link.dbo.tablename


I am using this in views

how we do it can somebody send me links on this ASAP.

View 2 Replies View Related

Is It Possible To Make Use Of Database Relationships In A Join?

Aug 2, 2004

When you make a join, it may look something like this:

SELECT Products.ProductName from Products, Categories
WHERE Categories.CategoryName = 'Seafood' AND
Products.CategoryID = Categories.CategoryID

In this query you use 'Products.CategoryID = Categories.CategoryID' to give the relation between the two tables. But if you already added the relationships to your database, this should be known.

My question is, why is it necessary to add the relation in the query when the relationships are already in the database? Is it somehow possible to ommit the relation in the query and make use of the relationships in the database.

Kind regards,
Iwan Rotteveel

View 5 Replies View Related

Make A Copy Of SQL Server Database

Mar 13, 2007

I'm trying to make a copy of our 2005 SQL Server production database (25 meg) so we can install it in a new office being set up in another state. I have right clicked on the database I want to copy, selected Tasks, then option Copy Database... I'm trying to put the copy on the same server, and I am doing this work signed into the Management Studio as "sa" The wizard creates 5 steps, the first 4 run ok, then the 5th step runs for 10 to 20 seconds, then quits. The message says to look in the log on the server for the reason it quit. The only log I can find is the Error Logs at the bottom of the Object Explorer window. I look into the current log, then select the SQL Server log, the current one. There is only one line in here about the copy I just tried, and it only says "Starting up database XXXXXXXX" which is the database I'm trying to create through the copy process. Within Database Mail, SQL Agent, and Windows NT log lines, I can not find any reference to the copy job that just bombed. Needless to say, I'm VERY new to all of this SQL Server admin stuff. If someone could point me in the right direction, it would really help! Thanks!

View 2 Replies View Related

Make Database Case Sensitive

Apr 25, 2007

How can I make my existing database case sensitive.
How to make SQL Queries also case sensitive from Application

ie:while running from VB,

Should work
rs.open"Select * from Employees"

Should Not work
rs.open"Select * from employees"
error should come as invalid table name.

View 8 Replies View Related

Make The Database Unavailable While Loading It

Jul 16, 2007

Hi All:I need to make my database unavailable when i am loading the db. Thishappens daily and the db is not connected to any online app, to makethe app unavailable. It is queried thru an Access and hence availableall the time.The load happens daily for an hour in the morning.Is there anyway to make it inaccessible to users while loading dataand then make it accessibleThank youRS

View 1 Replies View Related

How To Make New Database Sql Server 2005!

Aug 29, 2006

i had no problems working whith sql server 2000
but whith 2005 i am unable to make new database!
question : HOW?
respond asap

View 1 Replies View Related

How To Make A Single Database From Two Databases ....

Nov 8, 2006

Hi ...

I have two separete databases, what Ineed is that I want to make a single database of the two. Although all the table definitions of both the database are same.

I will be glad to know "how to make a single database from two" and i will be happy to see the query to insert the values from one database to another one.

Abdul Ghaffar

View 1 Replies View Related

Make A Database Record Read Only?

Oct 22, 2007



Hi.

I have a table where I need to set some rows to Read only (to protect the rows from being edited). Can I do this with a trigger checking against a column (where dataReadOnly = 1)?

Or is there a better way?

thankyou

View 6 Replies View Related

How To Make A Simple Database In SQL Server

Oct 22, 2007

Hi,
I am beginner developer, Creating simple application which will create, handle small database of genral store products (like adding products and substracting no. of products) . I am creating application with native win32 APIs in VS 2005.
Please suggest , how to create such data base , and suggest me link where i will get step by step knowledge to do (learn) it.
Do i need to learn ODBC or OLEDB or SQL server


Thanks

View 4 Replies View Related

Asp.net Want To Make SQL Time Format Of 00:00:00:000 To 14:42:51:153 When Inserting In Database

Nov 12, 2007

I have asp.net 1.1 web form and it inserts date and time in  SQL database, but it insert only date not time , It insert date time in following format
2002-01-22 00:00:00.000
some one tell me why it is not inserting time or why it is inserting time as 00:00:00:000.
I want to my time to look like 14:42:51:153. (format)
How can I change my time format
give me asp.net codes for time formating or what do I need to do to resolve the problem,
 
thank you
maxmax

View 1 Replies View Related







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