Forum Replies Created

Viewing 15 posts - 46 through 60 (of 206 total)

  • RE: bug with sp_msforeachdb?

    I guess the first question is, are you really running this on SQL 7 or 2000?

  • RE: Use PARAMETER in WHERE statement

    htilburgs (10/22/2009)


    I like to use something like the following:

    DECLARE @P_Overzicht VARCHAR(250)

    SET @P_Overzicht = ''

    DECLARE @P_Afdeling VARCHAR(250)

    SET@P_Afdeling = 'Managed Server Environment'

    DECLARE @P_Type VARCHAR(250)

    SET@P_Type = 'Geregistreerd'

    If @P_Type='Totaal'Set...

  • RE: Use PARAMETER in WHERE statement

    The problem is you can't use a variable to define a column name like that. You could do something like build an SQL string and then use the exec...

  • RE: String functions

    I think this will work.

    DECLARE @cod INT

    DECLARE @strValue VARCHAR(5)

    SET @strValue = '00'

    SET @cod = 0

    WHILE (@cod <= 9)

    BEGIN

    PRINT @strValue + CONVERT(VARCHAR,@cod)

    SET @cod = @cod + 1

    END

    GO

  • RE: Getting only the top number from a dataset

    Table definitions and sample data would help but this might get you started.

    select * from person P

    where numOfYears = (select max(numOfYears) from person P2 where P.cus_key = P2.cus_key)

    This assumes you...

  • RE: More recent rows by user

    How about this, I don't think it has any features above 2000.

    edit: to allow for a variable to be passed

    Use TempDB --Do this sometplace safe...

    --CREATE Test Data

    CREATE TABLE #PasswordHistory(

    ...

  • RE: More recent rows by user

    EDIT: And then I saw the section this was posted in. Sorry.

    I think this will get you want you are looking for. If not then maybe it...

  • RE: Case Statement??

    I dont think you are going to be able to return 2 different data types in the same column but you could round to the nearest integer for those that...

  • RE: Incorrect syntax in sp_send_dbmail

    ssismaddy (10/16/2009)


    EXEC msdb.dbo.sp_send_dbmail

    @recipients = 'EMAIL REMOVED',

    @subject = 'Something Important',

    ...

  • RE: Insert Query issue

    You need the CTE above the entire insert statement. This should work.

    ;with cteDelegates(stu_id, Student_Forename, middlename, Surname, Date_of_Birth, Sex, NI_Number, Learning_Difficulty, Learning_Diff, Disability, Ethnicity, Student_Address_1, Student_Address_2, Student_Address_3, Student_Address_4, Student_Postcode, Telephone,...

  • RE: CHANGE TRACKING CDC IN Sql Server 2008 Express

    From what I found:

    CDC is a feature of SQL Server 2008 Enterprise, Developer, and Evaluation editions.

  • RE: masking a field in sql

    There is a free ebook here: http://www.sqlservercentral.com/articles/books/68066/

    It covers more than just masking but it is a pretty good read.

  • RE: Need Help to split Single String data and insert into many columns.

    Try looking at the left(), mid(), and charindex() functions in books online. You should be able to parse anything you need with those. There might be better ways...

  • RE: get a field count from multiple tables

    If you could post the table definitions and some sample data (using insert statements) that would help. But the below code should work. I can't test it since...

  • RE: DTS - SQL 2000 Server

    Can you let us know what you have tried already? If you haven't checked I would make sure the datatypes in your source (GroupID) and destination (TermGroupID) are compatible.

Viewing 15 posts - 46 through 60 (of 206 total)