Forum Replies Created

Viewing 15 posts - 16 through 30 (of 58 total)

  • RE: why the insert statement not work

    I agree with Ken, you should try to avoid cursors whenever possible. Also, I suggest the use of sys.columns instead of information_schema.columns. Querying the catalog views is the...

  • RE: Reporting Services and Sharepoint conflict on Port 80

    At this point, is Reporting Services actually running, and you just need to connect to it via SSMS?

    If so, have you tried connecting SSMS 2008 to your Reporting Services 2005...

  • RE: why the insert statement not work

    My guess is that there's no table called "AGEN." If that's only part of the table name, then try something like this...

    Insert Into #DISTINCTC

    Select Column_Name

    From INFORMATION_SCHEMA.COLUMNS

    Where...

  • RE: Passing number of rows to be returned as a SP parameter

    No problem, I'm happy I could help! 🙂

  • RE: Date stored as a Decimal

    Try using Cast(yourDecimalColumn As datetime), i.e.

    Declare @myDate decimal;

    Set @myDate = 39838;

    Select Cast(@myDate As datetime);

  • RE: Passing number of rows to be returned as a SP parameter

    NULL is not a valid value for TOP, so you either need to change your parameter initialization, i.e.

    ,@ReturnNumber int = 1

    Or change your SELECT statement, i.e.

    SELECT TOP (ISNULL(@ReturnNumber, 1)) feProduct.ProductID,...

  • RE: bcp and bulk insert

    Of course, you could always query your column to see if the delimiter exists there, too. 🙂

  • RE: bcp and bulk insert

    The one time I had that same error, it was because my delimiter value was contained in one of my varchar columns.

    Try a ridiculous delimiter, like

    bcp test..INCOMINGBUFFER2 in "c:\file.txt"...

  • RE: Dynamic Coding

    That's pretty neat, Jeffrey... I've never used synonyms before. Then again, I don't really have any need to, but still an interesting approach. 🙂

  • RE: Dynamic Coding

    Sorry for the confusion, that's just sample code.

    You'll want to use your own view definition for the @mySQL parameter.

  • RE: UPDATE QUERY based on value from SELECT

    Steve's right. But if necessary, you could also write this update as...

    UPDATE p

    SET p.MaterialCost = x.LabourCost

    FROM dbo.Products As p

    JOIN (

    SELECT DISTINCT COUNT(ProductId) AS ProductCount,ProductId, AVG(CONVERT(money,TotalCost))...

  • RE: Dynamic Coding

    You could try something like...

    Create Procedure exampleProc

    As

    Begin

    Declare @mySQL nvarchar(1000)

    , @databaseName varchar(128);

    Select Top 1 @databaseName = name

    From sys.databases

    Where name Like 'yourDatabaseName%'

    Order By database_id...

  • RE: Dynamic Coding

    Hi Tracey,

    You could use stored procedures to change the view definition. If necessary, you can use sys.databases to find the appropriate database name.

    Also, I'd highly recommend the use of...

  • RE: "Calling" an HTTPS site from T-SQL?

    You probably want the C# to actually call the website. For logging, you'd also use C# to call a stored proc, which would then store the data in SQL...

  • RE: "Calling" an HTTPS site from T-SQL?

    I'm not sure if you can do it in T-SQL, but C# is definitely much better for this task.

Viewing 15 posts - 16 through 30 (of 58 total)