Forum Replies Created

Viewing 15 posts - 7,261 through 7,275 (of 7,466 total)

  • RE: How to Find Default File Group

    exec sp_msforeachdb "select '?',

    groupname from ?.dbo.sysfilegroups

    where FILEGROUPPROPERTY(groupname, 'IsDefault') = 1 "

  • RE: Free space in Data file

    quote:


    sp_helpfile will tell you the database file size which have been allocated to your database.

    SELECT FILEPROPERTY('yourdatabaselogicalfilename', 'spaceused') will give you space used...

  • RE: restoring db on cluster

    it reads the filelocations from the backup-set, so you'll have to change file-locations to those available on your clustered-sqlserver-instance.

    e.g. :

    Restore database mydb

    from DISK = '\\myserver\drive$\msSQL\BACKUP\mydbFull.BAK'

    with MOVE N'mydb_data' TO N'x:\MSSQL$instance\Data\mydb_data.mdf'

    ,...

  • RE: Accessing 2 servers from the same SP

    check books online (BOL) for "Linked server"

    you would create a linked server on server A to server B and then you can use Server B tables like this :

    select ......

  • RE: Date Operation

    Maybe this is wat you're looking for to add the remaining 50%

    CREATE FUNCTION dbo.udf_convert_date2WeekRange (@RefDate datetime, @FirstLast char(1) = 'F')

    RETURNS datetime

    AS

    BEGIN

    DECLARE @return_date as datetime

    ...

  • RE: Date Operation

    Might be conveniant if you had a dates-table (like in most datawarehouse-env)

    Then you would have a materialized week-start and week-end date, so you could join both tables.

    table might contain :

    [Calender_YEAR]...

  • RE: %COMPUTERNAME% does not work

    "It returns the computer name on which the command runs. Why are you asking?"

    to start on the quest for "why isn't this working".

    "So basically I'm guessing no environment variables...

  • RE: A Sticky One

    - can you define "last" ?

    does your table Test_Results contain a column with datetime of registration ?

    - can you post both tables DDL ?

    Edited by - alzdba on 12/30/2003 ...

  • RE: New DB – Determining the data and log file size

    - which Recovery-model did you specify on your sql2000 db ?

    Maybe switching to bulk-logged may help out.

    Edited by - alzdba on 12/30/2003 01:24:52 AM

  • RE: Index rebuild made it worse ?

    keep in mind that rebuild index will not affect your datapages, unless you have specified a clustered index. (there should be one "by default dba behaviour" for every table )

    Also...

  • RE: Generate Sequence Number Safely

    "as part of the invoicenumber" ?

    Is your invoicenumber still numeric ?

    Is this to-be-generated-sequence-number used as a suffix to a fixed prefix (e.g. yearmonth&sequencenumber) ?

    maybe this can help out :

    You would...

  • RE: Stars

    proposition:

    4 stars = SQLSir

    5 stars = SQLKnight/SQLord

    6 stars = SQLSaint

    I guess an indication based on # of accepted responses might be preferable over a "rating" but...

  • RE: %COMPUTERNAME% does not work

    What is it returning when you schedule a job (owned by sa) which runs TSQL:

    exec xp_cmdshell 'echo %computername%'

  • RE: Enterprise Manager does not work properly

    you could try to figure out what's going on using profiler.

    Check the T-sql ExecPreparedSQL, PrepareSQL.

    I don't know if there is a way to pull this info straight forward from a...

  • RE: String Aggregate Function

    create table #tmp1 (SeqNo int not null identity(1,1) ,col1 int, col2 varchar(125))

    go

    set nocount on

    insert into #tmp1 (col1,col2) values(1, 'Abc')

    go

    insert into #tmp1 (col1,col2) values(1, 'xyz')

    go

    insert into #tmp1 (col1,col2) values(1, 'PQr')

    go

    insert into...

Viewing 15 posts - 7,261 through 7,275 (of 7,466 total)