Forum Replies Created

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

  • RE: Permission on SP

    For the following procedure:

    use Northwind

    Create Proc checkCrossCall

    as

    Declare @sql as nvarchar(4000)

    Set @sql=N'use pubs select * from publishers'

    exec sp_executeSQL @sql

     

    This is the easiest solution:

    You must grant the user execute permission in Northwind...

  • RE: Stored Procedure is not working in .net application

    This error sounds like a VB error not a SQL error.

    Could you post the code you are calling the proc with?

     

     

     

  • RE: sql server and photos

    For the Most Part,

    I would Agree Keep Pictures in the File System not in the SQL.

    If however you, for instance, had an application like this forum, I think it would...

  • RE: Hierarchial tree with child count, indentation and dynamic levels

    BTW,

     

    Here is a Query that will work against a nested set Hierarchy that will return a column that you can use for indenting.

    SELECT T1.pk_location AS pk_Item,

     (COUNT(T2.pk_location)-1) AS indentation,

     T1.location AS Item

    FROM  h_location...

  • RE: Save Value Passed back from UDF

    Hi,

    Here is a proc I use to list and enumerate entities from a specific report:

     

    SELECT

    identity(INT,1,1) AS [count],

    pk_entity,

    fk_entityType,

    FullName,

    DateOfBirth,

    Address,

    CityStateZip,

    gender,

    Race,

    HairColor,

    Eyecolor,

    Height,

    Weight,

    DriversLicenseNumber,

    DriversLicenseState,

    fullstring,

    badgeNumber,

    ContactType,

    PhotoFile,

    fk_Report,

    DateDiff(year,DateOfBirth,getdate()) AS age

    into #temp

    FROM ReportEntityInfoList

    WHERE fk_Report=@pk_Report

     

    ORDER BY ContactType

    SELECT *  FROM #temp

    END

     

    It...

  • RE: How to call SQL store procedure

    Here is a Vb.net flavor Connection:

    Dim SqlConnection1 as new System.Data.SqlClient.SqlConnectionSqlConnection1.ConnectionString =YourConnectionStringDim SqlCommand1 as new System.Data.SqlClient.SqlCommandSqlCommand1.CommandText = YourProcedureNameSqlCommand1.CommandType = System.Data.CommandType.StoredProcedureSqlCommand1.Connection = Me.SqlConnection1SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@YourParameter", System.Data.SqlDbType.Int, 4))SqlCommand1.Parameters.Item(0).Value = YourValue dim dr as System.Data.SqlClient.SqlDataReaderSqlConnection1.Open()dr...

  • RE: Hierarchial tree with child count, indentation and dynamic levels

    Welcome to the forum Joe,

     

    I have tried, all be it poorly, to explain your nested set hierarchy in a few posts. 

    I use it a lot; it works very well...

  • RE: sql experts help!

    I would agree with olavho with  these exceptions. 

    I feel safer putting the wildcards in my procedure not in the Parameters.

    I also delcare the Parameters so I can use...

  • RE: string functions in sql

    HI, it will work with colum name as well, thing is you have the order of the variables backwards.

    the first string is what your looking for, the second is what...

  • RE: Date Problem in Query

    Hi, first you are missing a paran after data add

     

    Both Of These Work:

    Select * from Report where datediff(dd,Recorddate,'02/08/2004 4:15:04 PM')<100

    Select * from Report where datediff(dd,Recorddate,'02/aug/2004 4:15:04 PM')<100

     

    HTH

     

    tal...

  • RE: How to get the last record from cursor?.

    I would like to emphasize that robbac had the correct solution. 

    Using a cursor is generally bad mojo--especially if you can just query to get a specific record do that.

    a...

  • RE: Add the content of a text file in database

    Beware of web services,

    Out of the box reading all of the Propoganda they are really cool. But, currently, they are not designed for anonymous public use like...oh say the internet. ...

  • RE: Combining results from multiple tables

    Hi,  I think that you need to be a bit more specific about what exactely your tables hold. 

    it appears that you have "simplified" it and now it is confusing. ...

  • RE: Add the content of a text file in database

    In short, Yes it is possible.  Your post however does not give enough information for someone to tell you how.

    You can store the Text of a text file in a...

  • RE: Changing default directory for data

    Yeah I hate posts that end with ...."Nevermind I Got it"

     

    t

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