Forum Replies Created

Viewing 15 posts - 76 through 90 (of 95 total)

  • RE: how to check size of database

    You can also run sp_spaceused with no parameters in the database you need to know the size of.

  • RE: partitioning table @ sql server 2000

    Yes, SQL Server 2000 does support Partitioned Tables.  You ceate a seperate table for each partition and add a CHECK contraint for each table which specifies which data will appear on which table.

    You...

  • RE: proper SQL Permission required in application programming

    If I understand you correctly, you want to run GRANT on the tables.

    e.g.

    GRANT INSERT ON table TO AllUsers

    If you use DENY then the users will not be able to access...

  • RE: Catch SQL statement ?

    DBCC INPUTBUFFER(spid) will display the last statement executed for a connection (spid).

    Profiler will show all sql statements executing on the server.

  • RE: Generate SQL Scripts using T-SQL

    No exactly sure, but you can try the sp_help system stored procedures, but I have only used sp_helptext on sprocs before, which will show the text of the sproc (which...

  • RE: BULK INSERT / TRUNCATE permission problems

    Jeff is correct in his last point.  If you just give the user the bulkadmin  server role, and access to the table in question, the user can run a bulk...

  • RE: Using a UDF Table In a Stored Procedure

    DWaldock:  The statement you are executing won't work because 'SELECT SUM(column) FROM [dbo].[rules_Test](acctNo) ' returns a resultset, and you are trying to put it in the place where a column name...

  • RE: Need an alternative to replication

    MG:  If you are not familiar with DTS, a quick way to set this up is to do the following:

    Go into EM and select your source database

    Select Tools/Data Transformation Services/Export...

  • RE: Generate a script with carriage return

    This should do the job.  The PRINT statement is better for this task than SELECT.

     

    DECLARE C1 CURSOR

    READ_ONLY

    FOR SELECT tablename FROM TableList

    DECLARE @tablename varchar(40)

    OPEN C1

    FETCH NEXT FROM C1 INTO @tablename

    WHILE (@@fetch_status...

  • RE: Having killed a SPID, it still exists, how do I get rid of it?

    If the killed SPID was doing a lot of updates/inserts, then I'd say wait for it to finish rollback.  SQL needs to keep the integrity of it's database intact so it will...

  • RE: Inserting Data into a Table

    Try this as an example:

    CREATE TABLE #ALLCommuniteID (CommID int)

    INSERT INTO #ALLCommuniteID VALUES (1)

    INSERT INTO #ALLCommuniteID VALUES (2)

    INSERT INTO #ALLCommuniteID VALUES (3)

    Change

    'Select ID from tbl_Users, Set CommuniteID = 1, 3, 7,...

  • RE: Using a UDF Table In a Stored Procedure

    If I understand this correctly, you could try using a cursor on tblAccount, saving acctNo to @acctNo and execute the first select you coded for every row in tblAccount.  You...

  • RE: Trapping errors on linked servers

    If your query hits a fatal error, it will terminate immediately and control won't continue to the If statement.  Fatal errors are typically severity 20 - 25.

    Read this:

    http://www.sqlteam.com/item.asp?ItemID=2463

     

  • RE: BULK INSERT / TRUNCATE permission problems

    Be wary using xp_shell.  You need sa rights to execute xp_shell, but remember that it can be used in other ways than BCP.  Somone with access to execute xp_shell on your...

  • RE: write cursor output to a file

    osql -Sserver

    -E -ddatabase -Q"EXEC sproc" -o"C:\temp\OSQLOutput.txt"

     

    The file will contain your output.  Put the cursor in a stored procedure.

    The file will need to be cleaned though, as it will contain...

Viewing 15 posts - 76 through 90 (of 95 total)