Showing posts with label quickest. Show all posts
Showing posts with label quickest. Show all posts

Tuesday, March 20, 2012

Quickest way to show table relationships

Heard that VISIO allows you to import tables and it will
build a schema for you, is this true? Absent other
design tools besides SQL, is there another way that's user
friendly?This is a multi-part message in MIME format.
--=_NextPart_000_005E_01C34C53.29978BE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Just create a database diagram in Enterprise Manager and include all =tables.
-- Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Janice J. Bush" <jbush@.stinsonmoheck.com> wrote in message =news:0ae401c34c73$7e6abbe0$a501280a@.phx.gbl...
Heard that VISIO allows you to import tables and it will build a schema for you, is this true? Absent other design tools besides SQL, is there another way that's user friendly?
--=_NextPart_000_005E_01C34C53.29978BE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Just create a database diagram in =Enterprise Manager and include all tables.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"Janice J. Bush" =wrote in message news:0ae401c34c73$7e=6abbe0$a501280a@.phx.gbl...Heard that VISIO allows you to import tables and it will build a schema =for you, is this true? Absent other design tools besides SQL, is =there another way that's user friendly?

--=_NextPart_000_005E_01C34C53.29978BE0--

Quickest Way

Dear Professionals,
One quick question, what is the quickest way to copy the all the database
from one server to another including database logins and jobs and every
thing..
Thanks
The quickest way to get the db's over is probably a detach, copy and attach.
Logins and such require a little more work. But here are some links that
should help:
http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
http://www.databasejournal.com/featu...le.php/3379901 Moving
system DB's
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://www.support.microsoft.com/?id=221465 Using WITH MOVE in a Restore
http://www.sqlservercentral.com/colu...rdatabases.asp
Moving Users
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after
a Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scri...p?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
http://www.support.microsoft.com/?id=320125 Moving a Diagram
http://www.support.microsoft.com/?id=274463 Copy DB Wizard issues 2000
http://www.sqlservercentral.com/scri...tions/1598.asp Script
Roles and Permissions
Andrew J. Kelly SQL MVP
"Rogers" <naissani@.hotmail.com> wrote in message
news:%237EBVKJGGHA.3176@.TK2MSFTNGP12.phx.gbl...
> Dear Professionals,
> One quick question, what is the quickest way to copy the all the database
> from one server to another including database logins and jobs and every
> thing..
> Thanks
>

Quickest query to know if a record exist or not

I have a lookup table like:
ID Desc
-- --
1 AAa
2 B
3 C
I know there are some queries to to see if an ID exist in this table or not
,but I just wondered which one is the quickest one.
ThanksSomething like this:
IF EXISTS (SELECT * FROM T_CorpData WHERE CorpID = 'acn1')
PRINT 'Row Exists'
Keith
"RayAll" <RayAll@.microsft.com> wrote in message
news:esE9X2BIFHA.1288@.TK2MSFTNGP10.phx.gbl...
> I have a lookup table like:
> ID Desc
> -- --
> 1 AAa
> 2 B
> 3 C
> I know there are some queries to to see if an ID exist in this table or
not
> ,but I just wondered which one is the quickest one.
> Thanks
>|||Try,
declare @.id ...
if exists(select * from t where [ID] = @.id)
print 'yes'
else
print 'no'
go
AMB
"RayAll" wrote:

> I have a lookup table like:
> ID Desc
> -- --
> 1 AAa
> 2 B
> 3 C
> I know there are some queries to to see if an ID exist in this table or no
t
> ,but I just wondered which one is the quickest one.
> Thanks
>
>|||Hi
This may depend on what the context is that you require to know the
existance, but try:
IF EXISTS ( SELECT 1 FROM [Lookup Table] where Id = 1)
...
Please post DDL as http://www.aspfaq.com/etiquette.asp?id=5006 and
example data as insert statements http://vyaskn.tripod.com/code.htm#inserts
John
"RayAll" wrote:

> I have a lookup table like:
> ID Desc
> -- --
> 1 AAa
> 2 B
> 3 C
> I know there are some queries to to see if an ID exist in this table or no
t
> ,but I just wondered which one is the quickest one.
> Thanks
>
>|||IF EXISTS (SELECT * FROM YourTable WHERE ID = xx)
Print 'It exists'
Andrew J. Kelly SQL MVP
"RayAll" <RayAll@.microsft.com> wrote in message
news:esE9X2BIFHA.1288@.TK2MSFTNGP10.phx.gbl...
>I have a lookup table like:
> ID Desc
> -- --
> 1 AAa
> 2 B
> 3 C
> I know there are some queries to to see if an ID exist in this table or
> not ,but I just wondered which one is the quickest one.
> Thanks
>

Quickest method of updating a Table

I have a DataSet which I am holding in .NET and I would like to know the quickest way to get the DataSet in to a Table on SQL Server?

Any sample code would be great.

How many tables you have in dataset?

Fastest and easiest way to do it is probably using Data Adapter.

Thanks

|||Only one table, with over 1,000,000 records|||

And How you generate this data in your DataSet it is loaded from somewhere?

Fastest way will be to save it to file and next import to SQL using SSIS package or bulk copy command.

You can also try DataAdapter but

Thanks

it|||

And How you generate this data in your DataSet it is loaded from somewhere?

Fastest way will be to save it to file and next import to SQL using SSIS package or bulk copy command.

You can also try DataAdapter but

Thanks

it is|||

And How you generate this data in your DataSet it is loaded from somewhere?

Fastest way will be to save it to file and next import to SQL using SSIS package or bulk copy command.

You can also try DataAdapter but it

Thanks

|||

Hi CopperMill,

I agree that you can use SSIS to import data. You can also use bcp utility to perform fast bulk copy.

The bcp utility bulk copies data between an instance of Microsoft SQL Server 2005 and a data file in a user-specified format. The bcp utility can be used to import large numbers of new rows into SQL Server tables or to export data out of tables into data files. Except when used with the queryout option, the utility requires no knowledge of Transact-SQL. To import data into a table, you must either use a format file created for that table or understand the structure of the table and the types of data that are valid for its columns.


For more information, please check

http://msdn2.microsoft.com/en-us/library/ms162802.aspx

If the data you need to insert has to be stay in the DataSet, The only way I can see is to use a SqlDataAdapter

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and we will look into it again. Thanks!

Wednesday, March 7, 2012

Quick Method to delete from Two Tables

I have two tables ( a & b ) Both are linked by a ledgerref field. table what
would be the quickest and easiest way to delete records from both when
a.textStatus = 1the only way.. the usual way
delete from b from a,b
where b.ledgerref = a.ledgerref
and a.textStatus = 1
delete from a where textStatus = 1
-Omnibuzz (The SQL GC)
http://omnibuzz-sql.blogspot.com/|||and of course enclose it with a transaction :)
--
-Omnibuzz (The SQL GC)
http://omnibuzz-sql.blogspot.com/|||If the two tables are PK-FK linked, you could use CASCADE DELETE.
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"Peter Newman" <PeterNewman@.discussions.microsoft.com> wrote in message
news:1523DBF8-B27F-4351-970C-AF93A4316705@.microsoft.com...
>I have two tables ( a & b ) Both are linked by a ledgerref field. table
>what
> would be the quickest and easiest way to delete records from both when
> a.textStatus = 1|||Or getting it out of dialect, and correcting the "textStatus" data
element name (test and status are both suffixes to an attribute in
ISO-11179). I will not comment on the practice of using flags in SQL
to mimic an assembly language programming, or redundant tables to mimic
scratch tapes.
DELETE FROM Beta
WHERE EXISTS
(SELECT *
FROM Alpha
WHERE Beta.ledger_ref = Alpha.ledger_ref
AND Alpha.foobar_status = 1);
DRI action would be better. The best solution would be a proper
relational design.