Forum Replies Created

Viewing 15 posts - 346 through 360 (of 1,346 total)

  • RE: delete

    theres no way to do delete all data with on simple command.

     

    But you can use enterprise manager and generate a sql script of all objects tables indexes constraints etc. It...

  • RE: Dynamic Number Data Sources?

    Create a Centralized Report database

    Make that database your Data Source,

    Encapsulate all your query logic within a stored procedure in that database

    Use Partitioned Views and or Dynamic Sql to query...

  • RE: SQL Transactions Question

    http://www.devx.com/tips/Tip/13337

    By setting Implicit transaction on, simply executing a statement implies a begin tran. Check out the Article

    Prettly clear in

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

    I have not experienced an issue with implicit...

  • RE: Newbie to TSQL needs suggestions

    This will give you all orders where there all orderdetails are completed.

    Select *

    From Orders A

    Where not exists (Select *

                             From OrderDetails B

                             where a.OrderNum = B.OrderNum

                               and OrderDetailStatus <>  'completed')

  • RE: Creating new transactions

    declare @foo table (pk int identity,

                         bar int)

    insert into @foo (bar)

    select 1 union all

    select 2 union all

    select 0 union all

    select -1 union all

    select -4

    select *

    from @foo

    where...

  • RE: Query to Restrict delete.

    Can you please post your proc?

    or a similar example,

    How is your delete structured?

    Just a guess here.

    Delete tblAuthors

    where authID = @authid

      and empid <> (select empid from tbljobs where jobid=6)

    It...

  • RE: Creating new transactions

    If you post a sample table and sample data someone could easily help.

    How are you inserting the records one at a time?

    If you want to create 1000 new records using...

  • RE: Query to Restrict delete.

    Delete what empid?

    you may have an issue with this

    select authid from tblauthors where empid=(select empid from tbljobs where jobid=6)

    because in your subquery if there are more than 1 tbljob...

  • RE: Help with SQL

    You can do it a couple ways

     

    SELECT COUNT(*)

    FROM (SELECT col1 FROM TableA

          union

          SELECT col1 FROM TableB

          union

          SELECT col1 FROM TableC) as DerivedTable

    OR

    SELECT Sum(Number)

    FROM (select count(*) as Number from...

  • RE: What tools should developers use to work in SQL Server?

    " (assuming it is not correctly secured). "

     

    Well thats the key! No matter what they use if you do not have the databases properly secured then of course they can/will...

  • RE: self join or subquery?

    Try this

    select distinct a1.people_code_id

              ,a1.academic_year

              ,a1.academic_term

              ,a1.academic_session

    FROM academic a1

    WHERE a1.academic_session = 'main'

    and a1.academic_term='summer'

    and a1.academic_year='2007'

      and not exists (select *

                     FROM academic a2

                     WHERE a2.academic_session = ''

                       and a2.academic_term='summer'

                       and a2.academic_year='2007'

                      ...

  • RE: Can a Stored Procedure accept an array from a VB Script?

    The short answer is not really.

    But as always it depends what your trying to do.

    You can pass in XML, and use the sp_xmlpreparedocument, and with.

    or you can pass in comma...

  • RE: bcp file extract(.csv) with unicode (-w) not displaying properly when open in excel

    You have to go through the little wizard excel provides.

    Execute excel first.

    Then open the .csv file, and it will pop up the little wizard.

    There is no way to put the...

  • RE: Table Size

    Check out this post, and subsequent responses

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=169&messageid=300786

  • RE: Incremental INSERT statement

    Your Request does not make sense, 6/6/2079, or 6/6/1979?

    anyhooo

    Try this.

    set nocount on

    create table #mydatetable (pk int identity, Mydaveval smalldatetime)

    SELECT TOP 20000 nmbr_pk = IDENTITY(int, 1, 1)

    INTO   #t_Numbers

    FROM   sysobjects t1, sysobjects...

Viewing 15 posts - 346 through 360 (of 1,346 total)